r359 - schooltool/trunk/debian

Brian Sutherland jinty-guest at costa.debian.org
Wed Oct 25 18:03:18 UTC 2006


Author: jinty-guest
Date: 2006-10-25 18:03:17 +0000 (Wed, 25 Oct 2006)
New Revision: 359

Added:
   schooltool/trunk/debian/python-schooltool.manpages
   schooltool/trunk/debian/schooltool.py
Removed:
   schooltool/trunk/debian/python2.4-schooltool.docs
   schooltool/trunk/debian/python2.4-schooltool.manpages
   schooltool/trunk/debian/schooltool.examples
Modified:
   schooltool/trunk/debian/changelog
   schooltool/trunk/debian/control
   schooltool/trunk/debian/rules
   schooltool/trunk/debian/schooltool.conf.default
   schooltool/trunk/debian/schooltool.docs
   schooltool/trunk/debian/schooltool.logrotate
   schooltool/trunk/debian/schooltool.postinst
   schooltool/trunk/debian/schooltool.postrm
Log:
Major packaging change to update to new version.

Modified: schooltool/trunk/debian/changelog
===================================================================
--- schooltool/trunk/debian/changelog	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/changelog	2006-10-25 18:03:17 UTC (rev 359)
@@ -1,6 +1,24 @@
 schooltool (2006.0-beta1-1) UNRELEASED; urgency=low
 
   * (NOT RELEASED YET) New upstream release
+  * Handle upgrades from pre-2006 packages by:
+    - Adding site-definition value to the config file.
+    - Cleaning up the database_ver on the filesystem.
+  * debian/rules, debian/control: Major re-write related to new python policy
+    and a totally different schooltool tarball format. Highlights are:
+    - python-schooltool does not depend on python schoolbell anymore.
+    - depend on various python-zc.* and python-hurry.query packages.
+    - follow new python policy.
+  * debian/schooltool.{postrm,postinst}: Remove traces of old database_ver.
+  * debian/schooltool.docs: remove RELEASE.txt
+  * debian/schooltool.conf.default: add site definition.
+  * Disable the build time tests as they are very fragile.
+  * debian/schooltool.logrotate: Use copytruncate as to not need to re-start
+    the server. (Closes: 365049)
+  * This package follows the new python policy (Closes: 378066),
+    thanks to Matthias Klose for his NMU fixing this bug.
+  * Build depends on debhelper (which depends on po-debconf)
+    Closes: 392640.
 
  -- Brian Sutherland <jinty at web.de>  Wed, 25 Oct 2006 16:08:47 +0200
 

Modified: schooltool/trunk/debian/control
===================================================================
--- schooltool/trunk/debian/control	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/control	2006-10-25 18:03:17 UTC (rev 359)
@@ -3,14 +3,15 @@
 Section: web
 Maintainer: Debian/Ubuntu Zope Team <pkg-zope-developers at lists.alioth.debian.org>
 Uploaders: Brian Sutherland <jinty at web.de>, Fabio Tranchitella <kobold at debian.org>
-Build-Depends-Indep: debhelper (>= 5.0.37.2), python (>= 2.3.5-11), python2.4-dev (>= 2.4.1), python-xml (>= 0.8.4-5), python-libxml2 (>= 2.6.26.dfsg-2), python-reportlab (>= 1.20debian-7), python2.4-schoolbell (>= 1.2.4-2), python-central (>= 0.5)
+Build-Depends: debhelper
+Build-Depends-Indep: python, python-all-dev, python-xml, python-libxml2, python-reportlab, zope3 (>= 3.3.0~b2-2), python-zc.resourcelibrary, python-zc.table, python-zc.datetimewidget, python-hurry.query, python-central (>= 0.4.10), python-setuptools, python-imaging
 XS-Python-Version: 2.4
 Standards-Version: 3.7.2
 
 Package: schooltool
 Section: web
 Architecture: all
-Depends: ${python:Depends}, ssl-cert, openssl, lsb-base, python2.4-schooltool (= ${Source-Version}), adduser, ${misc:Depends}
+Depends: ${python:Depends}, adduser, ssl-cert, openssl, lsb-base, python-schooltool (= ${Source-Version}), ${misc:Depends}
 Description: common platform for school administration
  SchoolTool is an open source school management information system.  It is
  a distributed client/server system.  The SchoolTool server presents two
@@ -36,12 +37,14 @@
  .
  Homepage: http://www.schooltool.org/
 
-Package: python2.4-schooltool
+Package: python-schooltool
 Section: python
 Architecture: all
-Depends: ${python:Depends}, python-xml (>= 0.8.4-5), python2.4-xml, python-libxml2 (>= 2.6.26.dfsg-2), python2.4-libxml2, python2.4-schoolbell (>= 1.2.4-2), python2.4-schoolbell (<< 1.3), ${misc:Depends}
-Conflicts: schooltool-clients, libschooltool-clients
-Replaces: schooltool-clients, libschooltool-clients, libschooltool
+Depends: ${python:Depends}, python-xml, python-libxml2, python-reportlab, zope3 (>= 3.3.0~b2-2), zope3 (<< 3.4), python-zc.resourcelibrary, python-zc.table, python-zc.datetimewidget, python-hurry.query, python-imaging, ${misc:Depends}
+Provides: ${python:Provides}
+Suggests: msttcorefonts
+Conflicts: schooltool-clients, libschooltool-clients, python2.4-schooltool (<< 2006)
+Replaces: schooltool-clients, libschooltool-clients, libschooltool, python2.4-schooltool (<< 2006)
 XB-Python-Version: ${python:Versions}
 Description: common platform for school administration
  SchoolTool is an open source school management information system.  It is

Copied: schooltool/trunk/debian/python-schooltool.manpages (from rev 357, schooltool/trunk/debian/python2.4-schooltool.manpages)
===================================================================
--- schooltool/trunk/debian/python-schooltool.manpages	                        (rev 0)
+++ schooltool/trunk/debian/python-schooltool.manpages	2006-10-25 18:03:17 UTC (rev 359)
@@ -0,0 +1,2 @@
+debian/schooltool-client.1
+debian/import-sampleschool.1

Deleted: schooltool/trunk/debian/python2.4-schooltool.docs
===================================================================
--- schooltool/trunk/debian/python2.4-schooltool.docs	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/python2.4-schooltool.docs	2006-10-25 18:03:17 UTC (rev 359)
@@ -1,3 +0,0 @@
-README.txt
-RELEASE.txt
-doc/*

Deleted: schooltool/trunk/debian/python2.4-schooltool.manpages
===================================================================
--- schooltool/trunk/debian/python2.4-schooltool.manpages	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/python2.4-schooltool.manpages	2006-10-25 18:03:17 UTC (rev 359)
@@ -1,2 +0,0 @@
-debian/schooltool-client.1
-debian/import-sampleschool.1

Modified: schooltool/trunk/debian/rules
===================================================================
--- schooltool/trunk/debian/rules	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/rules	2006-10-25 18:03:17 UTC (rev 359)
@@ -2,85 +2,90 @@
 
 #export DH_VERBOSE=1
 
-# This variable, control file and the names of the .manpages and .docs files
-# should be the only thing needed to change the python version
-PYTHON=python2.4
+# Knobs for the python modules
+PYVERS=$(shell pyversions -vr debian/control)
+PYMOD=schooltool
+PACKAGE=python-$(PYMOD)
+DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog \
+		             | grep ^Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
+# Knobs for the Server Packages
+SERVER=schooltool
+SERVERPYVER=2.4
 
-# Server Packages
-package=schooltool
-library=python2.4-schooltool
+check: $(PYVERS:%=check-python%)
+	touch $@
+check-python%:
+	python$* install.py -q install --no-compile --skip-build --home=check-python$*
+	# XXX --------- Nasty hack so that the tests run fine ----------------
+	# (get our included zope.wfmc and zope.app.wfmc onto the pythonpath)
+	# zope is a namespace package, so all we need is the __init__.py
+	cd check-python$*/lib/python/zope && ln -s /usr/lib/python$*/site-packages/zope/__init__.py
+	# zope.app is harder, so we just symlink all of it into out testing directory (big hammer)
+	cd check-python$*/lib/python/zope/app && ln -s /usr/lib/python$*/site-packages/zope/app/* .
+	# XXX --------- END NASTY HACK ---------------------------------------
+	cd check-python$* && python$* bin/schooltooltest -ufq1 
+	touch $@
 
+build: $(PYVERS:%=build-python%)
+	# Someday enable this
+	# [ z$(ST_SKIP_CHECK) == ztrue ] || $(MAKE) -f debian/rules check
+	touch $@
 
-Zope3.bak:
-	# first half of an evil hack to make sure the self tests are run against
-	# the depended on Zope and not the one included in the 1.2 tarball will
-	# go away soon
-	mv Zope3 Zope3.bak
-
-Zope3:
-	# second half of hack
-	mv Zope3.bak Zope3
-
-schoolbell.bak:
-	# repeat of the dirty hack for schoolbell
-	mv src/schoolbell schoolbell.bak
-
-src/schoolbell:
-	mv schoolbell.bak src/schoolbell
-
-.PHONY: build
-build: build-stamp check
-build-stamp: Zope3.bak schoolbell.bak
+build-python%:
 	dh_testdir
-	$(PYTHON) setup.py build
-	$(MAKE) update-translations
-	touch build-stamp
+	python$* install.py -q build
+	# zpkg doesn't build translations, so we build them ourselves
+	set -e; \
+	    for f in build/lib/schooltool/locales/*/*/*.po; do \
+		msgfmt -o $${f%.po}.mo $$f;\
+	    done
+	touch $@
 
 .PHONY: clean
-clean:: Zope3 src/schoolbell
+clean::
 	dh_testdir
 	dh_testroot
-	-$(MAKE) PYTHON=$(PYTHON) clean
-	rm -f install-arch-stamp
-	rm -f build-stamp
-	rm -f check-stamp
-	rm -f install-indep-stamp
+	rm -rf check check-python?.?
+	rm -rf build build-python?.?
+	rm -rf install install-python?.?
+	find -name '*.py[co]' -exec rm -f {} \;
 	dh_clean
 	debconf-updatepo
 
-
-.PHONY: check
-check: check-stamp
-check-stamp:
-	$(PYTHON) test.py -fu
-	touch check-stamp
-
-.PHONY: install-indep
-install-indep: install-indep-stamp
-install-indep-stamp: build
+.PHONY: install-pre
+install-pre:
 	dh_testdir
 	dh_testroot
 	dh_clean -k -i
 	dh_installdirs -i
 
-	$(PYTHON) setup.py install --no-compile \
-	    --prefix=debian/$(library)/usr \
-	    --default-config=/etc/$(package)/$(package).conf
-
+install: build install-pre $(PYVERS:%=install-python%)
+	#### Move some files installed into the server package###
+	# zcml configuration to usr/share
+	install -m 644 -D install-python$(SERVERPYVER)/schooltool-skel/etc/site.zcml \
+	    debian/$(SERVER)/usr/share/$(SERVER)/zcml/site.zcml
+	mv install-python$(SERVERPYVER)/schooltool-skel/etc/package-includes \
+	    debian/$(SERVER)/usr/share/$(SERVER)/zcml
 	# move the server executable to the configuration package
-	install -m 755 -D -p debian/$(library)/usr/bin/$(package) \
-		debian/$(package)/usr/bin/$(package)
-	rm debian/$(library)/usr/bin/$(package)
+	install -m 755 -D -p debian/$(SERVER).py \
+		debian/$(SERVER)/usr/bin/$(SERVER)
 	# Copy some debian specific stuff across
-	install -m 644 -D -p debian/$(package).logrotate \
-	    debian/$(package)/etc/logrotate.d/$(package)
+	install -m 644 -D -p debian/$(SERVER).logrotate \
+	    debian/$(SERVER)/etc/logrotate.d/$(SERVER)
 	install -m 644 -D -p debian/ssl-cert.cnf \
-	    debian/$(package)/etc/$(package)/ssl-cert.cnf
-	install -m 644 -D -p debian/$(package).conf.default \
-	    debian/$(package)/usr/share/$(package)/$(package).conf.default
+	    debian/$(SERVER)/etc/$(SERVER)/ssl-cert.cnf
+	install -m 644 -D -p debian/$(SERVER).conf.default \
+	    debian/$(SERVER)/usr/share/$(SERVER)/$(SERVER).conf.default
+	touch $@
 
-	touch install-indep-stamp
+install-python%:
+	python$* install.py -q install --no-compile --skip-build --home=install-python$*
+	# Python modules to to the python path, inside the python module package
+	install -d debian/$(PACKAGE)/usr/lib/python$*/site-packages 
+	mv install-python$*/lib/python/* debian/$(PACKAGE)/usr/lib/python$*/site-packages
+	touch $@
 
+
 .PHONY: binary-common
 binary-common:
 	dh_testdir
@@ -94,17 +99,15 @@
 	dh_strip
 	dh_compress
 	dh_fixperms
-	DH_PYCENTRAL=nomove dh_pycentral
+	dh_pycentral
 	dh_python
-	dh_makeshlibs
 	dh_installdeb
-	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 .PHONY: binary-indep
-binary-indep: build install-indep
+binary-indep: build install
 	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
 
 .PHONY: binary-arch

Modified: schooltool/trunk/debian/schooltool.conf.default
===================================================================
--- schooltool/trunk/debian/schooltool.conf.default	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.conf.default	2006-10-25 18:03:17 UTC (rev 359)
@@ -3,6 +3,8 @@
 # Look at /usr/share/doc/schooltool/examples/schooltool.conf.in
 # for a detailed example with comments.
 
+# Site definition file:
+site-definition /usr/share/schooltool/zcml/site.zcml
 
 
 ## You can easily change the following settings using dpkg-reconfigure

Modified: schooltool/trunk/debian/schooltool.docs
===================================================================
--- schooltool/trunk/debian/schooltool.docs	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.docs	2006-10-25 18:03:17 UTC (rev 359)
@@ -1,2 +1 @@
 README.txt
-RELEASE.txt

Deleted: schooltool/trunk/debian/schooltool.examples
===================================================================
--- schooltool/trunk/debian/schooltool.examples	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.examples	2006-10-25 18:03:17 UTC (rev 359)
@@ -1 +0,0 @@
-schooltool.conf.in

Modified: schooltool/trunk/debian/schooltool.logrotate
===================================================================
--- schooltool/trunk/debian/schooltool.logrotate	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.logrotate	2006-10-25 18:03:17 UTC (rev 359)
@@ -8,8 +8,6 @@
     rotate 12
     weekly
     compress
-    sharedscripts
-    postrotate
-    [ -x /etc/init.d/schooltool ] && /etc/init.d/schooltool restart > /dev/null
-    endscript
+    copytruncate
+    missingok
 }

Modified: schooltool/trunk/debian/schooltool.postinst
===================================================================
--- schooltool/trunk/debian/schooltool.postinst	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.postinst	2006-10-25 18:03:17 UTC (rev 359)
@@ -26,7 +26,6 @@
 sslkey=/etc/$package/$package.privkey.pem
 sslconf=/etc/$package/ssl-cert.cnf
 config=/etc/$package/$package.conf
-db_version=0.10     # TODO - delete this when schooltool can upgrade it's own database
 
 # Helper Functions
 set_simple () {
@@ -66,6 +65,7 @@
         --home /var/lib/$package --no-create-home \
         $package
     fi
+    
     # Create files and directories
     [ -d /var/run/$package ] \
         || install --group $package --owner $package -d /var/run/$package
@@ -75,16 +75,11 @@
     [ -d /var/log/$package ] \
         || install --group $package --owner $package --mode 0750 -d \
                 /var/log/$package
-    # The next two lines are to fix a security hole in pre 1.2.0 versions of schoolbell
-    # and should probably go away in a few years.
+    
+    # Let's just make sure our data directories are not world readable
     chmod -R o-rx /var/lib/$package
     chmod -R o-rx /var/log/$package
 
-    # Set the database version.
-    # This is depended on and depends on code in preinst
-    # TODO - delete this when schooltool can upgrade it's own database
-    echo $db_version > /var/lib/$package/database_ver
-
     #Make the config file
     #Put the default template there if none exists
     if [ ! -e $config ]; then
@@ -160,6 +155,15 @@
         chmod 600 $sslkey
         set_simple ssl_certificate $sslkey
     fi
+    
+    ############# UPGRADES ##############
+
+    if dpkg --compare-versions "$2" lt "2005.99999999";
+    then
+        # Handle upgrades from pre-2006 version of schooltool
+        rm -f /var/lib/$package/database_ver
+        set_simple site-definition /usr/share/schooltool/zcml/site.zcml
+    fi 
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Modified: schooltool/trunk/debian/schooltool.postrm
===================================================================
--- schooltool/trunk/debian/schooltool.postrm	2006-10-25 17:32:46 UTC (rev 358)
+++ schooltool/trunk/debian/schooltool.postrm	2006-10-25 18:03:17 UTC (rev 359)
@@ -47,12 +47,12 @@
                 && rm -f /var/log/$package/$i.log* || true
         done
         rmdir /var/log/$package || true
-        # Clean up database as reccomended in TODO
+        # Clean up database as reccomended
         db_input high $package/purge_db || true
         db_go || true
         db_get $package/purge_db
         if [ z"$RET" == ztrue ]; then
-            for i in database_ver Data.fs Data.fs.index \
+            for i in Data.fs Data.fs.index \
                     Data.fs.lock Data.fs.tmp ; do
                 rm -f /var/lib/$package/$i ||true
             done

Added: schooltool/trunk/debian/schooltool.py
===================================================================
--- schooltool/trunk/debian/schooltool.py	                        (rev 0)
+++ schooltool/trunk/debian/schooltool.py	2006-10-25 18:03:17 UTC (rev 359)
@@ -0,0 +1,22 @@
+#!/usr/bin/python2.4
+"""
+A script to start the Debian SchoolTool server.
+"""
+
+import sys
+import os.path
+
+CONFIG_FILE = os.path.join("etc", "schooltool", "schooltool.conf")
+
+def run():
+    # This removes the script directory from sys.path, which we do
+    # since there are no modules here.
+    #
+    basepath = filter(None, sys.path)
+
+    from schooltool.app import main
+
+    main.StandaloneServer().main(sys.argv + ['--config', CONFIG_FILE])
+
+if __name__ == '__main__':
+    run()


Property changes on: schooltool/trunk/debian/schooltool.py
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the pkg-zope-commits mailing list