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
=== added directory 'debian'
=== added file 'debian/changelog'
--- debian/changelog 1970-01-01 00:00:00 +0000
+++ debian/changelog 2012-11-18 10:55:23 +0000
@@ -0,0 +1,7 @@
1frack (0.0.1) unstable; urgency=low
2
3 * Initial pre-beta Debian packaging.
4
5 * Initial setup.py skeleton.
6
7 -- Eric P. Mangold <eric@teratorn.org> Sun, 18 Nov 2012 01:35:00 +0000
08
=== added file 'debian/compat'
--- debian/compat 1970-01-01 00:00:00 +0000
+++ debian/compat 2012-11-18 10:55:23 +0000
@@ -0,0 +1,1 @@
17
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'debian/control'
--- debian/control 1970-01-01 00:00:00 +0000
+++ debian/control 2012-11-18 10:55:23 +0000
@@ -0,0 +1,28 @@
1Source: frack
2Section: mail
3Priority: optional
4Maintainer: Eric P. Mangold <eric@catturavideo.com>
5Uploaders: Eric P. Mangold <eric@catturavideo.com>
6Build-Depends: debhelper (>= 7.0.50~), python-support (>= 0.3)
7Standards-Version: 3.9.2
8Homepage: https://launchpad.net/frack
9XS-Python-Version: >= 2.6
10
11Package: python-frack
12Architecture: all
13Depends: python-twisted (>= 11.0), ${python:Depends}
14Provides: ${python:Provides}
15Recommends: frack-server
16Description: Frack
17 A parasite on issue trackers. Frack presents a useful web UI to Trac data.
18 .
19 This package contains the core Python library files.
20
21Package: frack-server
22Architecture: all
23Depends: python-frack (= ${binary:Version})
24Recommends: python-psycopg2, python-pg8000
25Description: Frack
26 A parasite on issue trackers. Frack presents a useful web UI to Trac data.
27 .
28 This package installs a stand-alone Frack server instance.
029
=== added file 'debian/copyright'
--- debian/copyright 1970-01-01 00:00:00 +0000
+++ debian/copyright 2012-11-18 10:55:23 +0000
@@ -0,0 +1,15 @@
1Format: http://dep.debian.net/deps/dep5
2Upstream-Name: frack
3Upstream-Contact: Allen Short <washort42@gmail.com>
4Source: https://launchpad.net/frack
5
6Files: *
7Copyright: (c) 2011 Allen Short
8Copyright: (c) 2011 J.P. Calderone
9Copyright: (c) 2012 Jonathan Jacobs
10Copyright: (c) 2012 Eric P. Mangold
11License: ISC
12
13Files: debian/*
14Copyright: (c) 2012 Eric P. Mangold
15License: ISC
016
=== added file 'debian/frack-server.dirs'
--- debian/frack-server.dirs 1970-01-01 00:00:00 +0000
+++ debian/frack-server.dirs 2012-11-18 10:55:23 +0000
@@ -0,0 +1,3 @@
1/etc/frack
2/etc/frack/cert
3/var/lib/frack
04
=== added file 'debian/frack-server.init'
--- debian/frack-server.init 1970-01-01 00:00:00 +0000
+++ debian/frack-server.init 2012-11-18 10:55:23 +0000
@@ -0,0 +1,76 @@
1#!/bin/sh
2
3# twistd plugin name comes from filename of this init script.
4#PLUGIN="${0##*/}"
5
6PLUGIN=frack
7
8### BEGIN INIT INFO
9# Provides: frack
10# Required-Start: $all
11# Required-Stop: $all
12# Default-Start: 2 3 4 5
13# Default-Stop: 0 1 6
14# Short-Description: Starts a service for the Twisted plugin 'frack'
15# Description: Generic plugin starter for twistd plugins
16### END INIT INFO
17# Author: Garret Heaton (powdahound@gmail.com)
18
19DAEMON=/usr/bin/twistd
20PIDFILE=/var/run/$PLUGIN.pid
21LOGFILE=/var/log/$PLUGIN.log
22DBFILE=/var/lib/frack/$PLUGIN.db
23DAEMON_OPTS="--pidfile=$PIDFILE --logfile=$LOGFILE $PLUGIN --sqlite_db=$DBFILE"
24
25if [ ! -x $DAEMON ]; then
26 echo "ERROR: Can't execute $DAEMON."
27 exit 1
28fi
29
30start_service() {
31 echo -n " * Starting $PLUGIN... "
32 start-stop-daemon -Sq -p $PIDFILE -x $DAEMON -- $DAEMON_OPTS
33 e=$?
34 if [ $e -eq 1 ]; then
35 echo "already running"
36 return
37 fi
38
39 if [ $e -eq 255 ]; then
40 echo "couldn't start :("
41 return
42 fi
43
44 echo "done"
45}
46
47stop_service() {
48 echo -n " * Stopping $PLUGIN... "
49 start-stop-daemon -Kq -R 10 -p $PIDFILE
50 e=$?
51 if [ $e -eq 1 ]; then
52 echo "not running"
53 return
54 fi
55
56 echo "done"
57}
58
59case "$1" in
60 start)
61 start_service
62 ;;
63 stop)
64 stop_service
65 ;;
66 restart)
67 stop_service
68 start_service
69 ;;
70 *)
71 echo "Usage: /etc/init.d/$PLUGIN {start|stop|restart}" >&2
72 exit 1
73 ;;
74esac
75
76exit 0
077
=== added file 'debian/frack-server.install'
=== added file 'debian/frack-server.postinst'
--- debian/frack-server.postinst 1970-01-01 00:00:00 +0000
+++ debian/frack-server.postinst 2012-11-18 10:55:23 +0000
@@ -0,0 +1,30 @@
1#!/bin/sh
2
3set -e
4
5#DEBHELPER#
6
7SSL_KEY=/etc/frack/cert/key.pem
8SSL_CRT=/etc/frack/cert/cert.pem
9
10_show_ssl_note () {
11 echo
12 echo "NOTE!!! You must manually install an SSL key and certificate"
13 echo "under /etc/frack/cert/ directory. See \`twistd frack --help'"
14 echo "for details on the expected files."
15 echo
16 echo "The certs may be self-signed or signed by a well-known Root CA."
17 echo
18}
19
20case "$1" in
21 configure)
22 if [ ! -f $SSL_KEY ]; then
23 _show_ssl_note
24 elif [ ! -f $SSL_CRT ]; then
25 _show_ssl_note
26 fi
27 ;;
28esac
29
30exit 0
031
=== added file 'debian/pydist-overrides'
--- debian/pydist-overrides 1970-01-01 00:00:00 +0000
+++ debian/pydist-overrides 2012-11-18 10:55:23 +0000
@@ -0,0 +1,3 @@
1Twisted python-twisted
2pyOpenSSL python-openssl
3pyasn1 python-pyasn1
04
=== added file 'debian/python-frack.dirs'
=== added file 'debian/python-frack.install'
--- debian/python-frack.install 1970-01-01 00:00:00 +0000
+++ debian/python-frack.install 2012-11-18 10:55:23 +0000
@@ -0,0 +1,3 @@
1debian/tmp/usr/lib/python*/*-packages/frack
2debian/tmp/usr/lib/python*/*-packages/twisted/plugins/frackplugin.py
3debian/tmp/usr/lib/python*/*-packages/*.egg-info
04
=== added file 'debian/python-frack.postinst'
--- debian/python-frack.postinst 1970-01-01 00:00:00 +0000
+++ debian/python-frack.postinst 2012-11-18 10:55:23 +0000
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -e
4
5#DEBHELPER#
6
7case "$1" in
8 configure)
9 # semi hack to rebuild Twisted's plugin cache files
10 for p in $(pyversions -i); do
11 $p -c 'from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin));' >/dev/null 2>&1 || true
12 done
13 ;;
14esac
15
16exit 0
017
=== added file 'debian/python-frack.postrm'
--- debian/python-frack.postrm 1970-01-01 00:00:00 +0000
+++ debian/python-frack.postrm 2012-11-18 10:55:23 +0000
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -e
4
5#DEBHELPER#
6
7case "$1" in
8 remove)
9 for p in $(pyversions -i); do
10 # semi hack to rebuild Twisted's plugin cache files
11 $p -c 'from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin));' >/dev/null 2>&1 || true
12 done
13 ;;
14esac
15
16exit 0
017
=== added file 'debian/rules'
--- debian/rules 1970-01-01 00:00:00 +0000
+++ debian/rules 2012-11-18 10:55:23 +0000
@@ -0,0 +1,10 @@
1#!/usr/bin/make -f
2# -*- makefile -*-
3
4export DH_VERBOSE=1
5
6%:
7 dh --with python2 --buildsystem=python_distutils $@
8
9override_dh_auto_install:
10 python setup.py install --force --root=debian/tmp --no-compile -O0 --install-layout=deb --single-version-externally-managed
011
=== modified file 'frack/test/test_db.py'
--- frack/test/test_db.py 2012-10-10 05:38:27 +0000
+++ frack/test/test_db.py 2012-11-18 10:55:23 +0000
@@ -24,15 +24,15 @@
24 d = store.fetchTicket(4712)24 d = store.fetchTicket(4712)
25 def _check(result):25 def _check(result):
26 self.assertEqual(set(result.keys()),26 self.assertEqual(set(result.keys()),
27 {"type", "status", "summary", "time", "reporter",27 set(("type", "status", "summary", "time", "reporter",
28 "owner", "priority", "resolution", "component",28 "owner", "priority", "resolution", "component",
29 "keywords", "cc", "branch", "branch_author",29 "keywords", "cc", "branch", "branch_author",
30 "launchpad_bug", "description", "changes",30 "launchpad_bug", "description", "changes",
31 "attachments", "id", "changetime"})31 "attachments", "id", "changetime")))
3232
33 self.assertEqual(len(result['changes']), 45)33 self.assertEqual(len(result['changes']), 45)
34 self.assertEqual(set(result['changes'][0].keys()),34 self.assertEqual(set(result['changes'][0].keys()),
35 {"newvalue", "author", "oldvalue", "time", "field"})35 set(("newvalue", "author", "oldvalue", "time", "field")))
3636
37 return d.addCallback(_check)37 return d.addCallback(_check)
3838
3939
=== added file 'setup.py'
--- setup.py 1970-01-01 00:00:00 +0000
+++ setup.py 2012-11-18 10:55:23 +0000
@@ -0,0 +1,35 @@
1# We are OK using distribute, these days, right?
2from setuptools import setup
3import subprocess, os.path
4
5# Fetch version number from Debian changelog file, if we have functional
6# Debian support commands on this machine, otherwise parse it lamely.
7try:
8 p = subprocess.Popen(['dpkg-parsechangelog'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
9 out, err = p.communicate()
10 for line in out.split('\n'):
11 if line.startswith('Version:'):
12 version = line.split(" ", 1)[1]
13
14except OSError:
15 with open(os.path.join(os.path.dirname(__file__), 'debian', 'changelog')) as f:
16 l1 = f.readline().rstrip()
17 # first parenthesised group is version string
18 version = l1.split('(', 1)[1].split(')', 1)[0]
19
20
21setup(name="frack",
22 version=version,
23 description="A parasite on issue trackers. Frack presents a useful web UI to Trac data.",
24 author="Allen Short <washort42@gmail.com>",
25 author_email="washort42@gmail.com",
26 packages=['frack', 'frack.test', 'twisted.plugins'],
27 package_data = {
28 'frack' : ['media/*'],
29 'frack.test' : ['trac_test.sql']
30 },
31
32 # pypi depends: (duplicates some info from debian control file - meh :-()
33 install_requires=['distribute', 'Twisted >= 11.0', 'pyOpenSSL', 'pyasn1'],
34 )
35

Subscribers

People subscribed via source and target branches

to all changes: