Merge lp:~teratorn/frack/setup-py-debian into lp:frack

Proposed by Eric P. Mangold
Status: Needs review
Proposed branch: lp:~teratorn/frack/setup-py-debian
Merge into: lp:frack
Diff against target: 334 lines (+246/-3)
14 files modified
debian/changelog (+7/-0)
debian/compat (+1/-0)
debian/control (+28/-0)
debian/copyright (+15/-0)
debian/frack-server.dirs (+3/-0)
debian/frack-server.init (+76/-0)
debian/frack-server.postinst (+30/-0)
debian/pydist-overrides (+3/-0)
debian/python-frack.install (+3/-0)
debian/python-frack.postinst (+16/-0)
debian/python-frack.postrm (+16/-0)
debian/rules (+10/-0)
frack/test/test_db.py (+3/-3)
setup.py (+35/-0)
To merge this branch: bzr merge lp:~teratorn/frack/setup-py-debian
Reviewer Review Type Date Requested Status
Allen Short Pending
Review via email: mp+134803@code.launchpad.net

Description of the change

Initial Debian packaging and setup.py

To post a comment you must log in.
lp:~teratorn/frack/setup-py-debian updated
45. By Eric P. Mangold

typo

Unmerged revisions

45. By Eric P. Mangold

typo

44. By Eric P. Mangold

fixup POSIX sh script

43. By Eric P. Mangold

fixicate init script to use sqlite by default

42. By Eric P. Mangold

avoid set literals to support python 2.6

41. By Eric P. Mangold

test_db.py requires python 2.7 so go ahead and require it for now

40. By Eric P. Mangold

don't depend on dojo and mustache
TODO since they are bundled presently we don't depend on them in the
debian package. In future Debian packaging may contain a patch to
remove bundled libs such as these that are available through repos.

39. By Eric P. Mangold

correct pyopenssl package

38. By Eric P. Mangold

update packaging

37. By Eric P. Mangold

initial work-in-progress of debian packaging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'debian'
2=== added file 'debian/changelog'
3--- debian/changelog 1970-01-01 00:00:00 +0000
4+++ debian/changelog 2012-11-18 10:55:23 +0000
5@@ -0,0 +1,7 @@
6+frack (0.0.1) unstable; urgency=low
7+
8+ * Initial pre-beta Debian packaging.
9+
10+ * Initial setup.py skeleton.
11+
12+ -- Eric P. Mangold <eric@teratorn.org> Sun, 18 Nov 2012 01:35:00 +0000
13
14=== added file 'debian/compat'
15--- debian/compat 1970-01-01 00:00:00 +0000
16+++ debian/compat 2012-11-18 10:55:23 +0000
17@@ -0,0 +1,1 @@
18+7
19\ No newline at end of file
20
21=== added file 'debian/control'
22--- debian/control 1970-01-01 00:00:00 +0000
23+++ debian/control 2012-11-18 10:55:23 +0000
24@@ -0,0 +1,28 @@
25+Source: frack
26+Section: mail
27+Priority: optional
28+Maintainer: Eric P. Mangold <eric@catturavideo.com>
29+Uploaders: Eric P. Mangold <eric@catturavideo.com>
30+Build-Depends: debhelper (>= 7.0.50~), python-support (>= 0.3)
31+Standards-Version: 3.9.2
32+Homepage: https://launchpad.net/frack
33+XS-Python-Version: >= 2.6
34+
35+Package: python-frack
36+Architecture: all
37+Depends: python-twisted (>= 11.0), ${python:Depends}
38+Provides: ${python:Provides}
39+Recommends: frack-server
40+Description: Frack
41+ A parasite on issue trackers. Frack presents a useful web UI to Trac data.
42+ .
43+ This package contains the core Python library files.
44+
45+Package: frack-server
46+Architecture: all
47+Depends: python-frack (= ${binary:Version})
48+Recommends: python-psycopg2, python-pg8000
49+Description: Frack
50+ A parasite on issue trackers. Frack presents a useful web UI to Trac data.
51+ .
52+ This package installs a stand-alone Frack server instance.
53
54=== added file 'debian/copyright'
55--- debian/copyright 1970-01-01 00:00:00 +0000
56+++ debian/copyright 2012-11-18 10:55:23 +0000
57@@ -0,0 +1,15 @@
58+Format: http://dep.debian.net/deps/dep5
59+Upstream-Name: frack
60+Upstream-Contact: Allen Short <washort42@gmail.com>
61+Source: https://launchpad.net/frack
62+
63+Files: *
64+Copyright: (c) 2011 Allen Short
65+Copyright: (c) 2011 J.P. Calderone
66+Copyright: (c) 2012 Jonathan Jacobs
67+Copyright: (c) 2012 Eric P. Mangold
68+License: ISC
69+
70+Files: debian/*
71+Copyright: (c) 2012 Eric P. Mangold
72+License: ISC
73
74=== added file 'debian/frack-server.dirs'
75--- debian/frack-server.dirs 1970-01-01 00:00:00 +0000
76+++ debian/frack-server.dirs 2012-11-18 10:55:23 +0000
77@@ -0,0 +1,3 @@
78+/etc/frack
79+/etc/frack/cert
80+/var/lib/frack
81
82=== added file 'debian/frack-server.init'
83--- debian/frack-server.init 1970-01-01 00:00:00 +0000
84+++ debian/frack-server.init 2012-11-18 10:55:23 +0000
85@@ -0,0 +1,76 @@
86+#!/bin/sh
87+
88+# twistd plugin name comes from filename of this init script.
89+#PLUGIN="${0##*/}"
90+
91+PLUGIN=frack
92+
93+### BEGIN INIT INFO
94+# Provides: frack
95+# Required-Start: $all
96+# Required-Stop: $all
97+# Default-Start: 2 3 4 5
98+# Default-Stop: 0 1 6
99+# Short-Description: Starts a service for the Twisted plugin 'frack'
100+# Description: Generic plugin starter for twistd plugins
101+### END INIT INFO
102+# Author: Garret Heaton (powdahound@gmail.com)
103+
104+DAEMON=/usr/bin/twistd
105+PIDFILE=/var/run/$PLUGIN.pid
106+LOGFILE=/var/log/$PLUGIN.log
107+DBFILE=/var/lib/frack/$PLUGIN.db
108+DAEMON_OPTS="--pidfile=$PIDFILE --logfile=$LOGFILE $PLUGIN --sqlite_db=$DBFILE"
109+
110+if [ ! -x $DAEMON ]; then
111+ echo "ERROR: Can't execute $DAEMON."
112+ exit 1
113+fi
114+
115+start_service() {
116+ echo -n " * Starting $PLUGIN... "
117+ start-stop-daemon -Sq -p $PIDFILE -x $DAEMON -- $DAEMON_OPTS
118+ e=$?
119+ if [ $e -eq 1 ]; then
120+ echo "already running"
121+ return
122+ fi
123+
124+ if [ $e -eq 255 ]; then
125+ echo "couldn't start :("
126+ return
127+ fi
128+
129+ echo "done"
130+}
131+
132+stop_service() {
133+ echo -n " * Stopping $PLUGIN... "
134+ start-stop-daemon -Kq -R 10 -p $PIDFILE
135+ e=$?
136+ if [ $e -eq 1 ]; then
137+ echo "not running"
138+ return
139+ fi
140+
141+ echo "done"
142+}
143+
144+case "$1" in
145+ start)
146+ start_service
147+ ;;
148+ stop)
149+ stop_service
150+ ;;
151+ restart)
152+ stop_service
153+ start_service
154+ ;;
155+ *)
156+ echo "Usage: /etc/init.d/$PLUGIN {start|stop|restart}" >&2
157+ exit 1
158+ ;;
159+esac
160+
161+exit 0
162
163=== added file 'debian/frack-server.install'
164=== added file 'debian/frack-server.postinst'
165--- debian/frack-server.postinst 1970-01-01 00:00:00 +0000
166+++ debian/frack-server.postinst 2012-11-18 10:55:23 +0000
167@@ -0,0 +1,30 @@
168+#!/bin/sh
169+
170+set -e
171+
172+#DEBHELPER#
173+
174+SSL_KEY=/etc/frack/cert/key.pem
175+SSL_CRT=/etc/frack/cert/cert.pem
176+
177+_show_ssl_note () {
178+ echo
179+ echo "NOTE!!! You must manually install an SSL key and certificate"
180+ echo "under /etc/frack/cert/ directory. See \`twistd frack --help'"
181+ echo "for details on the expected files."
182+ echo
183+ echo "The certs may be self-signed or signed by a well-known Root CA."
184+ echo
185+}
186+
187+case "$1" in
188+ configure)
189+ if [ ! -f $SSL_KEY ]; then
190+ _show_ssl_note
191+ elif [ ! -f $SSL_CRT ]; then
192+ _show_ssl_note
193+ fi
194+ ;;
195+esac
196+
197+exit 0
198
199=== added file 'debian/pydist-overrides'
200--- debian/pydist-overrides 1970-01-01 00:00:00 +0000
201+++ debian/pydist-overrides 2012-11-18 10:55:23 +0000
202@@ -0,0 +1,3 @@
203+Twisted python-twisted
204+pyOpenSSL python-openssl
205+pyasn1 python-pyasn1
206
207=== added file 'debian/python-frack.dirs'
208=== added file 'debian/python-frack.install'
209--- debian/python-frack.install 1970-01-01 00:00:00 +0000
210+++ debian/python-frack.install 2012-11-18 10:55:23 +0000
211@@ -0,0 +1,3 @@
212+debian/tmp/usr/lib/python*/*-packages/frack
213+debian/tmp/usr/lib/python*/*-packages/twisted/plugins/frackplugin.py
214+debian/tmp/usr/lib/python*/*-packages/*.egg-info
215
216=== added file 'debian/python-frack.postinst'
217--- debian/python-frack.postinst 1970-01-01 00:00:00 +0000
218+++ debian/python-frack.postinst 2012-11-18 10:55:23 +0000
219@@ -0,0 +1,16 @@
220+#!/bin/sh
221+
222+set -e
223+
224+#DEBHELPER#
225+
226+case "$1" in
227+ configure)
228+ # semi hack to rebuild Twisted's plugin cache files
229+ for p in $(pyversions -i); do
230+ $p -c 'from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin));' >/dev/null 2>&1 || true
231+ done
232+ ;;
233+esac
234+
235+exit 0
236
237=== added file 'debian/python-frack.postrm'
238--- debian/python-frack.postrm 1970-01-01 00:00:00 +0000
239+++ debian/python-frack.postrm 2012-11-18 10:55:23 +0000
240@@ -0,0 +1,16 @@
241+#!/bin/sh
242+
243+set -e
244+
245+#DEBHELPER#
246+
247+case "$1" in
248+ remove)
249+ for p in $(pyversions -i); do
250+ # semi hack to rebuild Twisted's plugin cache files
251+ $p -c 'from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin));' >/dev/null 2>&1 || true
252+ done
253+ ;;
254+esac
255+
256+exit 0
257
258=== added file 'debian/rules'
259--- debian/rules 1970-01-01 00:00:00 +0000
260+++ debian/rules 2012-11-18 10:55:23 +0000
261@@ -0,0 +1,10 @@
262+#!/usr/bin/make -f
263+# -*- makefile -*-
264+
265+export DH_VERBOSE=1
266+
267+%:
268+ dh --with python2 --buildsystem=python_distutils $@
269+
270+override_dh_auto_install:
271+ python setup.py install --force --root=debian/tmp --no-compile -O0 --install-layout=deb --single-version-externally-managed
272
273=== modified file 'frack/test/test_db.py'
274--- frack/test/test_db.py 2012-10-10 05:38:27 +0000
275+++ frack/test/test_db.py 2012-11-18 10:55:23 +0000
276@@ -24,15 +24,15 @@
277 d = store.fetchTicket(4712)
278 def _check(result):
279 self.assertEqual(set(result.keys()),
280- {"type", "status", "summary", "time", "reporter",
281+ set(("type", "status", "summary", "time", "reporter",
282 "owner", "priority", "resolution", "component",
283 "keywords", "cc", "branch", "branch_author",
284 "launchpad_bug", "description", "changes",
285- "attachments", "id", "changetime"})
286+ "attachments", "id", "changetime")))
287
288 self.assertEqual(len(result['changes']), 45)
289 self.assertEqual(set(result['changes'][0].keys()),
290- {"newvalue", "author", "oldvalue", "time", "field"})
291+ set(("newvalue", "author", "oldvalue", "time", "field")))
292
293 return d.addCallback(_check)
294
295
296=== added file 'setup.py'
297--- setup.py 1970-01-01 00:00:00 +0000
298+++ setup.py 2012-11-18 10:55:23 +0000
299@@ -0,0 +1,35 @@
300+# We are OK using distribute, these days, right?
301+from setuptools import setup
302+import subprocess, os.path
303+
304+# Fetch version number from Debian changelog file, if we have functional
305+# Debian support commands on this machine, otherwise parse it lamely.
306+try:
307+ p = subprocess.Popen(['dpkg-parsechangelog'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
308+ out, err = p.communicate()
309+ for line in out.split('\n'):
310+ if line.startswith('Version:'):
311+ version = line.split(" ", 1)[1]
312+
313+except OSError:
314+ with open(os.path.join(os.path.dirname(__file__), 'debian', 'changelog')) as f:
315+ l1 = f.readline().rstrip()
316+ # first parenthesised group is version string
317+ version = l1.split('(', 1)[1].split(')', 1)[0]
318+
319+
320+setup(name="frack",
321+ version=version,
322+ description="A parasite on issue trackers. Frack presents a useful web UI to Trac data.",
323+ author="Allen Short <washort42@gmail.com>",
324+ author_email="washort42@gmail.com",
325+ packages=['frack', 'frack.test', 'twisted.plugins'],
326+ package_data = {
327+ 'frack' : ['media/*'],
328+ 'frack.test' : ['trac_test.sql']
329+ },
330+
331+ # pypi depends: (duplicates some info from debian control file - meh :-()
332+ install_requires=['distribute', 'Twisted >= 11.0', 'pyOpenSSL', 'pyasn1'],
333+ )
334+

Subscribers

People subscribed via source and target branches

to all changes: