Skip to content

Commit 7d39025

Browse files
committed
Refactored debian packaging
- Increased debian compatibility level to 11 - Use pybuild as the debian build system - Updated build and package dependencies - Switched from init script to systemd service - Install README to the debian package docs - Removed no longer used pycompat and pyversions debian files - Removed no longer used openxcap.dirs and openxcap.install debian files - Install the configuration sample and extra data files from setup.py
1 parent 866b5f7 commit 7d39025

17 files changed

+74
-134
lines changed

MANIFEST.in

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
recursive-include debian changelog compat control copyright
2-
recursive-include debian pycompat pyversions rules
3-
recursive-include debian *.dirs *.init *.postinst *.postrm *.docs *.install *.default
1+
recursive-include debian changelog compat control copyright docs rules
2+
recursive-include debian format lintian-overrides openxcap.service
43
recursive-include opensips *.cfg
54
recursive-include scripts *.py *.sql
6-
recursive-include tls .placeholder
7-
recursive-include xcap/appusage/xml-schemas *.xsd
8-
recursive-include test *
9-
prune debian/tmp
5+
recursive-include tls README
6+
recursive-include test *
7+
prune debian/.debhelper
108
prune debian/openxcap
11-
prune debian/python-module-stampdir
12-
include INSTALL LICENSE MANIFEST.in TODO config.ini.sample
9+
prune debian/tmp
10+
include INSTALL LICENSE MANIFEST.in TODO

debian/compat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
11

debian/control

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ Source: openxcap
22
Section: net
33
Priority: optional
44
Maintainer: Dan Pascu <[email protected]>
5-
Uploaders: Adrian Georgescu <[email protected]>
6-
Build-Depends: debhelper (>= 9), python(>= 2.7)
5+
Build-Depends: debhelper (>= 11), dh-python, python
76
Standards-Version: 3.9.8
87

98
Package: openxcap
109
Architecture: all
1110
Depends: ${python:Depends}, ${misc:Depends},
12-
lsb-base,
1311
python-application (>= 2.8.0),
1412
python-gnutls (>= 3.1.0),
1513
python-lxml,

debian/docs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README

debian/lintian-overrides

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file may contain passwords.
2+
openxcap: non-standard-file-perm etc/openxcap/config.ini 0600 != 0644

debian/openxcap.default

Lines changed: 0 additions & 8 deletions
This file was deleted.

debian/openxcap.dirs

Lines changed: 0 additions & 4 deletions
This file was deleted.

debian/openxcap.docs

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/openxcap.init

Lines changed: 0 additions & 69 deletions
This file was deleted.

debian/openxcap.install

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/openxcap.service

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Open XCAP Server
3+
After=network.target nss-lookup.target mysqld.service mariadb.service thor-eventserver.service
4+
5+
[Service]
6+
Type=simple
7+
Environment=PYTHONUNBUFFERED=yes
8+
ExecStart=/usr/bin/openxcap --systemd
9+
Restart=on-abnormal
10+
LimitCORE=infinity
11+
12+
[Install]
13+
WantedBy=multi-user.target

debian/pycompat

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/pyversions

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/rules

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
#export DH_VERBOSE=1
44

55
%:
6-
dh $@ --with python2
6+
dh $@ --with python2 --buildsystem=pybuild
77

88
override_dh_clean:
99
dh_clean
1010
rm -rf build dist MANIFEST
1111

12-
override_dh_install:
13-
dh_install
14-
install -m 0644 config.ini.sample debian/openxcap/etc/openxcap/config.ini
12+
override_dh_auto_install:
13+
dh_auto_install
14+
mv debian/openxcap/etc/openxcap/config.ini.sample debian/openxcap/etc/openxcap/config.ini
1515

16-
.PHONY: override_dh_clean override_dh_install
16+
override_dh_installsystemd:
17+
dh_installsystemd --no-start
18+
19+
override_dh_fixperms:
20+
dh_fixperms
21+
chmod 600 debian/openxcap/etc/openxcap/config.ini
22+
23+
override_dh_auto_test:
24+
# do not run tests as they require a configured openxcap server running

setup.py

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
11
#!/usr/bin/env python
22

33
import os
4-
import re
4+
import xcap
55

66
from distutils.core import setup
77

8-
9-
def get_version():
10-
return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('xcap/__init__.py').read()).group('version')
11-
12-
def find_packages(toplevel):
13-
return [directory.replace(os.path.sep, '.') for directory, subdirs, files in os.walk(toplevel) if '__init__.py' in files]
14-
15-
setup(name = "openxcap",
16-
version = get_version(),
17-
author = "AG Projects",
18-
author_email = "[email protected]",
19-
url = "http://openxcap.org/",
20-
description = "An open source XCAP server.",
21-
long_description = """XCAP protocol allows a client to read, write, and modify application
8+
long_description = """XCAP protocol allows a client to read, write, and modify application
229
configuration data stored in XML format on a server. XCAP maps XML document
2310
sub-trees and element attributes to HTTP URIs, so that these components can
2411
be directly accessed by HTTP. An XCAP server is used by the XCAP clients to
2512
store data like Presence policy in combination with a SIP Presence server
2613
that supports PUBLISH/SUBSCRIBE/NOTIFY methods to provide a complete
2714
[http://www.tech-invite.com/Ti-sip-WGs.html#wg-simple SIP SIMPLE] server
28-
solution.""",
29-
license = "GPL",
30-
platforms = ["Platform Independent"],
31-
classifiers = [
32-
"Development Status :: 5 - Production/Stable",
33-
"Intended Audience :: Service Providers",
34-
"License :: OSI Approved :: GNU General Public License (GPL)",
35-
"Operating System :: POSIX :: Linux",
36-
"Programming Language :: Python",
37-
],
38-
packages = find_packages('xcap'),
39-
scripts = ['openxcap'],
40-
package_data = {'xcap.appusage': ['xml-schemas/*']},
41-
)
15+
solution."""
16+
17+
18+
def find_packages(toplevel):
19+
return [directory.replace(os.path.sep, '.') for directory, subdirs, files in os.walk(toplevel) if '__init__.py' in files]
20+
21+
22+
setup(
23+
name='openxcap',
24+
version=xcap.__version__,
25+
26+
description='XCAP server',
27+
long_description=long_description,
28+
url='http://openxcap.org/',
29+
30+
author='AG Projects',
31+
author_email='[email protected]',
32+
33+
license='GPL',
34+
platforms=['Platform Independent'],
35+
36+
classifiers=[
37+
'Development Status :: 5 - Production/Stable',
38+
'Intended Audience :: Service Providers',
39+
'License :: OSI Approved :: GNU General Public License (GPL)',
40+
'Operating System :: POSIX :: Linux',
41+
'Programming Language :: Python',
42+
],
4243

44+
packages=find_packages('xcap'),
45+
package_data={'xcap.appusage': ['xml-schemas/*']},
46+
data_files=[('/etc/openxcap', ['config.ini.sample']), ('/etc/openxcap/tls', ['tls/README'])],
47+
scripts=['openxcap']
48+
)

tls/.placeholder

Lines changed: 0 additions & 2 deletions
This file was deleted.

tls/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TLS certificates used by openxcap can be added to this directory.

0 commit comments

Comments
 (0)