add packaging for Debian

This commit is contained in:
Max Erenberg 2021-08-29 19:57:27 -04:00
parent 7957d645db
commit 7f7e30a04a
9 changed files with 64 additions and 3 deletions

9
.gitignore vendored
View File

@ -2,3 +2,12 @@ __pycache__/
*.swp
*.egg-info/
build/
/.pybuild/
# Ignore Debian auto-generated files.
/debian/debhelper-build-stamp
/debian/files
/debian/csc-milter/**
/debian/*.log
/debian/*.debhelper
/debian/*.substvars

View File

@ -116,9 +116,14 @@ def main():
if args.mynetworks is not None:
networks = args.mynetworks.split()
else:
networks = get_postconf('mynetworks').split()
networks_str = get_postconf('mynetworks').replace(',', ' ')
networks = networks_str.split()
MYNETWORKS = [
ipaddress.ip_network(s.replace('[', '').replace(']', ''))
ipaddress.ip_network(
s.replace('[', '')
.replace(']', '')
.strip()
)
for s in networks
]

23
debian/changelog vendored Normal file
View File

@ -0,0 +1,23 @@
csc-milter (0.1.1-1) buster; urgency=medium
* Fix bug in mynetworks parsing.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Sun, 29 Aug 2021 19:45:44 -0400
csc-milter (0.1.0-3) buster; urgency=medium
* Update absolute path in systemd service.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Sun, 29 Aug 2021 19:15:24 -0400
csc-milter (0.1.0-2) buster; urgency=medium
* Add systemd service to debian folder.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Sun, 29 Aug 2021 19:07:58 -0400
csc-milter (0.1.0-1) buster; urgency=medium
* Initial release.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Sun, 29 Aug 2021 22:22:55 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
10

15
debian/control vendored Normal file
View File

@ -0,0 +1,15 @@
Source: csc-milter
Maintainer: Systems Committee <syscom@csclub.uwaterloo.ca>
Section: mail
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>=9),
dh-python,
python3-setuptools,
python3-all
Package: csc-milter
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}, python3-milter (>=1.0)
Description: Custom mail filter ("milter") for CSC.
This package implements custom filtering logic for the CSC mail server.

1
debian/copyright vendored Normal file
View File

@ -0,0 +1 @@
License: GPL-3.0

View File

@ -6,7 +6,7 @@ Wants=postfix.service
User=postfix
Group=postfix
RuntimeDirectory=csc-milter
ExecStart=/usr/local/bin/csc-milter
ExecStart=/usr/bin/csc-milter
[Install]
WantedBy=multi-user.target

6
debian/rules vendored Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/make -f
export PYBUILD_NAME=csc-milter
%:
dh $@ --with python3 --buildsystem=pybuild

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)