diff --git a/debian/TODO.txt b/debian/TODO.txt new file mode 100644 index 0000000..f3d7c03 --- /dev/null +++ b/debian/TODO.txt @@ -0,0 +1,5 @@ + - Generate random secret key - why doesn't CMS do this when creating a + contest? + base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes) + + - Configure DB. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e6271a0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,11 @@ +cms (1.1.0~pre~git20130315~145248+b85e8a5-1quantal) quantal; urgency=low + + * Build for quantal. + + -- Bernard Blackham Fri, 15 Mar 2013 20:37:45 +0000 + +cms (1.1.0~pre~git20130315~145248+b85e8a5-1precise) precise; urgency=low + + * New upstream git snapshot. + + -- Bernard Blackham Fri, 15 Mar 2013 20:36:49 +0000 diff --git a/debian/cms-doc.docs b/debian/cms-doc.docs new file mode 100644 index 0000000..d4f4542 --- /dev/null +++ b/debian/cms-doc.docs @@ -0,0 +1 @@ +#DOCS# diff --git a/debian/cms-doc.install b/debian/cms-doc.install new file mode 100644 index 0000000..d4f4542 --- /dev/null +++ b/debian/cms-doc.install @@ -0,0 +1 @@ +#DOCS# diff --git a/debian/cms.default b/debian/cms.default new file mode 100644 index 0000000..cfb8f1b --- /dev/null +++ b/debian/cms.default @@ -0,0 +1,7 @@ +# Defaults for cms initscript +# sourced by /etc/init/cms.conf + +# Additional options that are passed to the cmsResourceService. +SHARD=0 +CONTEST_ID=1 +DAEMON_OPTS="-a $CONTEST_ID $SHARD" diff --git a/debian/cms.dirs b/debian/cms.dirs new file mode 100644 index 0000000..ae629ae --- /dev/null +++ b/debian/cms.dirs @@ -0,0 +1,3 @@ +/var/log/cms +/var/cache/cms +/var/lib/cms diff --git a/debian/cms.doc-base.EX b/debian/cms.doc-base.EX new file mode 100644 index 0000000..808934a --- /dev/null +++ b/debian/cms.doc-base.EX @@ -0,0 +1,20 @@ +Document: cms +Title: Debian cms Manual +Author: +Abstract: This manual describes what cms is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/cms/cms.sgml.gz + +Format: postscript +Files: /usr/share/doc/cms/cms.ps.gz + +Format: text +Files: /usr/share/doc/cms/cms.text.gz + +Format: HTML +Index: /usr/share/doc/cms/html/index.html +Files: /usr/share/doc/cms/html/*.html diff --git a/debian/cms.install b/debian/cms.install new file mode 100644 index 0000000..dcfa469 --- /dev/null +++ b/debian/cms.install @@ -0,0 +1,5 @@ +debian/tmp/usr/bin /usr +debian/tmp/usr/lib /usr +examples/cms.conf.sample /usr/share/doc/cms/examples/ +examples/cms.ranking.conf.sample /usr/share/doc/cms/examples/ +cms/server/mo/* /usr/share/locale diff --git a/debian/cms.postinst b/debian/cms.postinst new file mode 100644 index 0000000..82d603d --- /dev/null +++ b/debian/cms.postinst @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for cms +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + adduser --quiet --system --group --no-create-home --home /var/lib/cms cmsuser + adduser cmsuser isolate + chown -R cmsuser:cmsuser /var/log/cms /var/cache/cms /var/lib/cms + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/cms.postrm b/debian/cms.postrm new file mode 100644 index 0000000..1faca0a --- /dev/null +++ b/debian/cms.postrm @@ -0,0 +1,47 @@ +#!/bin/sh +# postrm script for cms +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + deluser --quiet --system cmsuser || echo "Failed to remove cmsuser." + # But succeed anyway. + update-rc.d -f cms remove || true + ;; + + purge) + rm -rf /var/log/cms /var/cache/cms /var/lib/cms + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/cms.prerm b/debian/cms.prerm new file mode 100644 index 0000000..8ca35c6 --- /dev/null +++ b/debian/cms.prerm @@ -0,0 +1,38 @@ +#!/bin/sh +# prerm script for cms +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/cms.upstart b/debian/cms.upstart new file mode 100644 index 0000000..f1103f5 --- /dev/null +++ b/debian/cms.upstart @@ -0,0 +1,18 @@ +# cms - Contest Management System + +description "Contest Management System" + +start on runlevel [2345] +stop on runlevel [!2345] + +respawn + +pre-start script + test -f /etc/cms.conf || { echo "Not starting as /etc/cms.conf does not exist." 1>&2 ; stop ; exit 0; } +end script + +script + test -r /etc/default/cms && . /etc/default/cms || true + + exec start-stop-daemon --start -c cmsuser --exec /usr/bin/cmsResourceService -- $DAEMON_OPTS +end script diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8b8f5f5 --- /dev/null +++ b/debian/control @@ -0,0 +1,61 @@ +Source: cms +Section: misc +Priority: extra +Maintainer: Bernard Blackham +Uploaders: Giovanni Mascellani +Build-Depends: + debhelper (>= 8.0.0), + python (>= 2.7), + python-mechanize (>= 0.2), + python-beautifulsoup (>= 3.2), + python-coverage (>= 3.4), + python-setuptools, + gettext +Standards-Version: 3.9.3 +Homepage: https://github.com/cms-dev/cms +Vcs-Git: git://github.com/cms-dev/cms-debian.git +Vcs-Browser: https://github.com/cms-dev/cms-debian +X-Python-Version: >= 2.7, << 3.0 + +Package: isolate +Section: utils +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + adduser, + cgroup-lite | cgroup-bin +Description: utility to isolate processes using namespaces + The isolate utility can run a process in an isolated environment. Using + Linux's namespace support, the process can be given an independent view of the + filesystem, networking and process trees. + . + It can also be used to measure the time and memory used by a process (and its + children). + +Package: cms +Architecture: all +Depends: + ${misc:Depends}, + ${python:Depends}, + isolate, + adduser, + python-setuptools (>= 0.6), + python-tornado (>= 2.0), + python-psycopg2 (>= 2.4), + python-simplejson (>= 2.1), + python-sqlalchemy (>= 0.7), + python-netifaces (>= 0.5), + python-crypto (>= 2.3), + python-yaml (>= 3.10), + python-tz (>= 2011k), + python-psutil (>= 0.2), + python-six (>= 1.1), + iso-codes, + shared-mime-info +Recommends: + stl-manual +Description: Contest Management System for running programming contests + CMS, or Contest Management System, is a distributed system for running and (to + some extent) organizing a programming contest. It has been designed to be + general and to handle many different types of contests, tasks, scorings, etc. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..6dc3048 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,77 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: cms +Upstream-Contact: CMS Mailing List +Source: http://github.com/cms-dev/cms +Copyright: 2010-2013 The CMS development team +License: AGPL-3+ + +License: AGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: * +Copyright: 2010-2013 The CMS development team +License: AGPL-3+ + +Files: cmsranking/images/* + cmsranking/static/img/*.png +Copyright: 2011-2012 Luca Wehrstedt +License: CC-BY-SA-3.0 + +Files: cmsranking/static/lib/jquery.js +Copyright: 2012 jQuery Foundation and other contributors, http://jquery.org/ +License: Expat or GPL-2 +Comment: See http://jquery.org/license + +Files: cmsranking/static/lib/explorercanvas.js +Copyright: 2006 Google Inc., http://code.google.com/p/explorercanvas/ +License: Apache-2.0 + +Files: cmsranking/static/lib/eventsource.js +Copyright: 2012 Remy Sharp, http://remysharp.com +License: Expat +Comment: See http://rem.mit-license.org/ + +Files: cmsranking/static/lib/raphael.js +Copyright: 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) + 2008-2012 Sencha Labs (http://sencha.com) +License: Expat +Comment: See http://raphaeljs.com/license.html + +Files: cms/server/static/jq/jquery-1.7.1.min.js +Copyright: 2011 John Resig, http://jquery.com/ +License: Expat or GPL-2 + +Files: cms/server/static/jq/jquery.jqplot* + cms/server/static/jq/jqplot* +Copyright: 2009-2011 Chris Leonello +License: Expat or GPL-2 + +Files: cms/server/static/css/bootstrap.css + cms/server/static/js/bootstrap.js + cms/server/static/img/glyphicons-halflings*.png +Copyright: 2012 Twitter, Inc. +License: Apache-2.0 + +Files: cms/server/static/img/mimetypes/*.png +Copyright: 2009 Tango Desktop Project, http://tango.freedesktop.org/ +License: public-domain + +Files: isolate/* +Copyright: 2012-2013 Martin Mares + 2012-2013 Bernard Blackham +License: GPL-2 + +Files: debian/* +Copyright: 2013 Bernard Blackham +License: GPL-2.0+ diff --git a/debian/create-unreleased.sh b/debian/create-unreleased.sh new file mode 100755 index 0000000..7f3cc36 --- /dev/null +++ b/debian/create-unreleased.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +usage() { + cat < + +This script will generate a dev tarball of cms from a git tree. +All desired changes must be committed to the tree. +DO NOT USE THIS FOR RELEASE PACKAGES. +EOT + exit 2 +} + +error() { + echo "$@" 1>&2 + exit 1 +} + +[ -z "$1" ] && usage + +GIT_DIR=$1 + +test -d "$GIT_DIR" || error "Path '$GIT_DIR' does not exist." +REV=$(cd "$GIT_DIR" && git rev-parse --short HEAD) || error "$GIT_DIR is not a git repo?" +RELEASE=$(cd "$GIT_DIR/docs" && python -c 'import conf ; print conf.release') +DATE=$(TZ=UTC date --date="@$(cd "$GIT_DIR" && git log -1 --format=%ct $REV)" +%Y%m%d~%H%M%S) + +# Make the version number sortable if a pre-release. +case "$RELEASE" in + *[0-9]pre) RELEASE=${RELEASE%pre}~pre +esac + +ORIGVERSION="${RELEASE}~git$DATE+$REV" + +dch --force-bad-version -v "${ORIGVERSION}-1" "New upstream git snapshot." + +TARBALL=../cms_${ORIGVERSION}.orig.tar.gz +echo "Writing archive to $TARBALL" +(cd "$GIT_DIR" && git archive $REV) | gzip --best > "$TARBALL" + +set -x +#rm -rf src +#mkdir src +#cd src && \ +tar xzf $TARBALL + +echo "Run the following command to build the package." +echo dpkg-buildpackage -us -uc diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..84618d6 --- /dev/null +++ b/debian/docs @@ -0,0 +1,3 @@ +AUTHORS.txt +LICENSE.txt +README.md diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..0f107df --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,6 @@ + +[DEFAULT] +pristine-tar = True +upstream-branch = master +debian-branch = debian + diff --git a/debian/isolate.install b/debian/isolate.install new file mode 100644 index 0000000..aa5d4d9 --- /dev/null +++ b/debian/isolate.install @@ -0,0 +1 @@ +isolate/isolate /usr/bin diff --git a/debian/isolate.lintian b/debian/isolate.lintian new file mode 100644 index 0000000..d0f9c80 --- /dev/null +++ b/debian/isolate.lintian @@ -0,0 +1 @@ +isolate: setuid-binary usr/bin/isolate 4755 root/isolate diff --git a/debian/isolate.postinst b/debian/isolate.postinst new file mode 100644 index 0000000..b050670 --- /dev/null +++ b/debian/isolate.postinst @@ -0,0 +1,45 @@ +#!/bin/sh +# postinst script for cms +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + # Create a group for users allowed to invoke isolate. + addgroup --quiet --system isolate + chown root:isolate /usr/bin/isolate + chmod 4750 /usr/bin/isolate + # Add a user for the UID used by isolate. + getent passwd isolated > /dev/null || adduser --quiet --uid 60000 --no-create-home --disabled-password --gecos "" isolated + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/isolate.postrm b/debian/isolate.postrm new file mode 100644 index 0000000..ce5d1ef --- /dev/null +++ b/debian/isolate.postrm @@ -0,0 +1,42 @@ +#!/bin/sh +# postrm script for cms +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + delgroup --quiet --system isolate || true + deluser isolated || true + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/patches/00-no-install b/debian/patches/00-no-install new file mode 100644 index 0000000..5706b3f --- /dev/null +++ b/debian/patches/00-no-install @@ -0,0 +1,20 @@ +Description: ignore upstream build/install steps + They assume installing onto a live system, not for packaging. + . + cms (0.9+giteec7dca4-1) precise; urgency=low + . + * Initial release. +Author: Bernard Blackham + +--- + +--- cms-0.9+giteec7dca4.orig/setup.py ++++ cms-0.9+giteec7dca4/setup.py +@@ -288,7 +288,3 @@ def install(): + + if __name__ == "__main__": + do_setup() +- if "build" in sys.argv: +- build() +- if "install" in sys.argv: +- install() diff --git a/debian/patches/01-use-non-local-dirs b/debian/patches/01-use-non-local-dirs new file mode 100644 index 0000000..2b6ba07 --- /dev/null +++ b/debian/patches/01-use-non-local-dirs @@ -0,0 +1,74 @@ +Description: Remove the use of .../local/... for directory names. + We are a package. We can get away with it now. + . + cms (0.9+giteec7dca4-1) precise; urgency=low + . + * Initial release. +Author: Bernard Blackham + +--- + +--- cms-0.9+giteec7dca4.orig/cms/__init__.py ++++ cms-0.9+giteec7dca4/cms/__init__.py +@@ -124,9 +124,9 @@ class Config: + sys.argv[0] != '/usr/bin/python' + + if self.installed: +- self.log_dir = os.path.join("/", "var", "local", "log", "cms") +- self.cache_dir = os.path.join("/", "var", "local", "cache", "cms") +- self.data_dir = os.path.join("/", "var", "local", "lib", "cms") ++ self.log_dir = os.path.join("/", "var", "log", "cms") ++ self.cache_dir = os.path.join("/", "var", "cache", "cms") ++ self.data_dir = os.path.join("/", "var", "lib", "cms") + paths = [os.path.join("/", "usr", "local", "etc", "cms.conf"), + os.path.join("/", "etc", "cms.conf")] + else: +--- cms-0.9+giteec7dca4.orig/cms/server/ContestWebServer.py ++++ cms-0.9+giteec7dca4/cms/server/ContestWebServer.py +@@ -140,7 +140,7 @@ class BaseHandler(CommonRequestHandler): + def get_user_locale(self): + if config.installed: + localization_dir = os.path.join( +- "/", "usr", "local", "share", "locale") ++ "/", "usr", "share", "locale") + else: + localization_dir = os.path.join(os.path.dirname(__file__), "mo") + +--- cms-0.9+giteec7dca4.orig/cms/server/AdminWebServer.py ++++ cms-0.9+giteec7dca4/cms/server/AdminWebServer.py +@@ -132,7 +132,7 @@ class BaseHandler(CommonRequestHandler): + self.contest = None + + if config.installed: +- localization_dir = os.path.join("/", "usr", "local", "share", ++ localization_dir = os.path.join("/", "usr", "share", + "locale") + else: + localization_dir = os.path.join(os.path.dirname(__file__), "mo") +--- cms-0.9+giteec7dca4.orig/cmsranking/Config.py ++++ cms-0.9+giteec7dca4/cmsranking/Config.py +@@ -56,9 +56,9 @@ class Config(object): + + self.web_dir = os.path.join(os.path.dirname(__file__), "static") + if self.installed: +- self.log_dir = os.path.join("/", "var", "local", "log", ++ self.log_dir = os.path.join("/", "var", "log", + "cms", "ranking") +- self.lib_dir = os.path.join("/", "var", "local", "lib", ++ self.lib_dir = os.path.join("/", "var", "lib", + "cms", "ranking") + paths = [os.path.join("/", "usr", "local", "etc", + "cms.ranking.conf"), +diff --git a/examples/cms.conf.sample b/examples/cms.conf.sample +index ec1db3e..81a4090 100644 +--- a/examples/cms.conf.sample ++++ b/examples/cms.conf.sample +@@ -137,7 +137,7 @@ + "_help": "change the first item to contain 'python2' or even", + "_help": "'python2.7' instead of just 'python', and the second", + "_help": "one to contain '/usr/bin' instead of /usr/local/bin'.", +- "process_cmdline": ["/usr/bin/python", "/usr/local/bin/cms%s", "%d"], ++ "process_cmdline": ["/usr/bin/python", "/usr/bin/cms%s", "%d"], + "_process_cmdline": ["/usr/bin/python", "./%s.py", "%d"], + + diff --git a/debian/patches/cms.conf-admin-on-localhost b/debian/patches/cms.conf-admin-on-localhost new file mode 100644 index 0000000..20c7437 --- /dev/null +++ b/debian/patches/cms.conf-admin-on-localhost @@ -0,0 +1,20 @@ +Description: Default admin server to bind to localhost + Only binding to local interfaces is a safer default for admin server. Users + can change this if they need to. + . + cms (0.9~git20130120+1~eec7dca4-1) precise; urgency=low + . + * Initial release. +Author: Bernard Blackham + +--- cms-0.9~git20130120+1~eec7dca4.orig/examples/cms.conf.sample ++++ cms-0.9~git20130120+1~eec7dca4/examples/cms.conf.sample +@@ -113,7 +113,7 @@ + "_section": "AdminWebServer", + + "_help": "Listening http address and port for AdminWebServer.", +- "admin_listen_address": "", ++ "admin_listen_address": "127.0.0.1", + "admin_listen_port": 8889, + + diff --git a/debian/patches/cms.conf-delete-sandbox-files b/debian/patches/cms.conf-delete-sandbox-files new file mode 100644 index 0000000..33ae1cd --- /dev/null +++ b/debian/patches/cms.conf-delete-sandbox-files @@ -0,0 +1,20 @@ +Description: Delete sandbox files after use. + . + cms (0.9~git20130120+1~eec7dca4-1) precise; urgency=low + . + * Initial release. +Author: Bernard Blackham + +--- + +--- cms-0.9~git20130120+1~eec7dca4.orig/examples/cms.conf.sample ++++ cms-0.9~git20130120+1~eec7dca4/examples/cms.conf.sample +@@ -49,7 +49,7 @@ + "_help": "Don't delete the sandbox directory under /tmp/ when they", + "_help": "are not needed anymore. Warning: this can easily eat GB", + "_help": "of space very soon.", +- "keep_sandbox": true, ++ "keep_sandbox": false, + + + diff --git a/debian/patches/cms.conf-start-logservice b/debian/patches/cms.conf-start-logservice new file mode 100644 index 0000000..aa6cd65 --- /dev/null +++ b/debian/patches/cms.conf-start-logservice @@ -0,0 +1,20 @@ +Description: Default RS to start LS. + . + cms (0.9~git20130120+1~eec7dca4-1) precise; urgency=low + . + * Initial release. +Author: Bernard Blackham + +--- + +--- a/examples/cms.conf.sample ++++ b/examples/cms.conf.sample +@@ -144,7 +144,7 @@ + + + "_help": "Should ResourceService should start LogService too?", +- "start_logservice": false, ++ "start_logservice": true, + + + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..8dbf0a1 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +start-ls-from-rs +00-no-install +01-use-non-local-dirs +cms.conf-admin-on-localhost +cms.conf-delete-sandbox-files +cms.conf-start-logservice diff --git a/debian/patches/start-ls-from-rs b/debian/patches/start-ls-from-rs new file mode 100644 index 0000000..c0d0522 --- /dev/null +++ b/debian/patches/start-ls-from-rs @@ -0,0 +1,53 @@ +commit 586c80854f2e46cec138a5855c1d0a8acc0a155a +Author: Bernard Blackham +Date: Sun Feb 17 03:03:59 2013 +0000 + + Add config option for RS to start LS. + +diff --git a/cms/__init__.py b/cms/__init__.py +index 02ee25c..91b4252 100644 +--- a/cms/__init__.py ++++ b/cms/__init__.py +@@ -111,6 +111,7 @@ class Config: + + # ResourceService. + self.process_cmdline = ["/usr/bin/python", "./%s.py", "%d"] ++ self.start_logservice = False + + # LogService. + self.color_shell_log = True +diff --git a/cms/service/ResourceService.py b/cms/service/ResourceService.py +index 1e21f1e..de41fab 100755 +--- a/cms/service/ResourceService.py ++++ b/cms/service/ResourceService.py +@@ -114,9 +114,11 @@ class ResourceService(Service): + + # Look for dead processes, and restart them. + for service in self._local_services: +- # We let the user start logservice and resourceservice. +- if service.name == "LogService" or \ +- service.name == "ResourceService": ++ # We let the user start ResourceService. ++ if service.name == "ResourceService": ++ continue ++ # Configurable as to whether we should start LogService. ++ if service.name == "LogService" and not config.start_logservice: + continue + + # If the user specified not to restart some service, we +diff --git a/examples/cms.conf.sample b/examples/cms.conf.sample +index 4e82bb7..18597af 100644 +--- src/examples/cms.conf.sample.tmp 2013-03-12 23:39:26.431926483 +0000 ++++ src/examples/cms.conf.sample 2013-03-12 23:39:49.619926502 +0000 +@@ -145,6 +145,11 @@ + + + ++ "_help": "Should ResourceService should start LogService too?", ++ "start_logservice": false, ++ ++ ++ + "_section": "LogService", + + "_help": "Whether to print ANSI color codes on stdout/logfiles, in", diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..d186ce4 --- /dev/null +++ b/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +# dh_clean doesn't honour --sourcedirectory, so we use '.' for now. +SRCDIR=. + +%: + dh $@ --with python2 --sourcedirectory=$(SRCDIR) + +override_dh_auto_build: + cd $(SRCDIR)/isolate && ./compile.sh + set -x ; for locale in $(SRCDIR)/cms/server/po/*.po ; do \ + cc=$${locale%.po} ; cc=$${cc##*/} \ + path=$(SRCDIR)/cms/server/mo/$$cc/LC_MESSAGES ; \ + mkdir -p $$path ; \ + msgfmt $$locale -o $$path/cms.mo ; \ + done + +override_dh_install: + dh_install + # Remove .sample extension from example files (may not be necessary if we + # are not building the cms package). + d=debian/cms/usr/share/doc/cms/examples && mv $$d/cms.conf.sample $$d/cms.conf || true + d=debian/cms/usr/share/doc/cms/examples && mv $$d/cms.ranking.conf.sample $$d/cms.ranking.conf || true + +override_dh_fixperms: + dh_fixperms + chmod 4750 debian/isolate/usr/bin/isolate || true + +override_dh_clean: + dh_clean + rm -f $(SRCDIR)/isolate/isolate + rm -rf cms.egg-info/ + rm -rf build/ + find -name '*.mo' | xargs rm -f diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..e69de29