Index: openacs-dist/create-package.sh
===================================================================
RCS file: /usr/local/cvsroot/openacs-dist/create-package.sh,v
diff -u -r1.1 -r1.9
--- openacs-dist/create-package.sh	12 Sep 2006 14:02:48 -0000	1.1
+++ openacs-dist/create-package.sh	7 Dec 2006 07:53:03 -0000	1.9
@@ -1,7 +1,54 @@
 #!/bin/bash
 
-# todo: set permissions on files properly
-# todo: check whether openacs or .lrn is in /var/www
+# Written by Dirk Gomez (openacs@dirkgomez.de) on 11-Sep-2006
+# License: GPL
 
+if [ $# != 1 ]; then
+  echo "invoke with these command-line arguments"
+  echo "1 - for openacs-5-2-3"
+  echo "2 - for dotlrn-2-2-0"
+  exit
+fi
+
+if [ $1 -eq "1" ]; then
+  CVSTAG="openacs-5-2-3"
+  PACKAGENAME=openacs52.deb
+fi
+
+if [ $1 -eq "2" ]; then
+  CVSTAG="openacs-5-2-3"
+  PACKAGENAME=dotlrn22.deb
+fi
+
+pushd debian/debian/var/www/
+rm -rf *
+cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot export -r $CVSTAG openacs-4
+mv openacs-4/* .
+if [ $1 -eq "2" ]; then
+  mv packages/dotlrn/install.xml .
+fi
+popd
+
+echo "Setting the permissions on the package shell scripts"
+
+if [ $1 -eq "1" ]; then
+  cp control-openacs52 debian/debian/DEBIAN/control
+  cp changelog-openacs52 debian/debian/DEBIAN/changelog
+fi
+
+if [ $1 -eq "2" ]; then
+  cp control-dotlrn22 debian/debian/DEBIAN/control
+  cp changelog-dotlrn22 debian/debian/DEBIAN/changelog
+fi
+
+chmod 755 debian/debian/DEBIAN/control debian/debian/DEBIAN/postinst debian/debian/DEBIAN/prerm
+chown -R root:root debian/debian/DEBIAN/control debian/debian/DEBIAN/postinst debian/debian/DEBIAN/prerm
+
+echo "Setting OpenACS' ownership to root data. The package's postinst script will set the owner to dotlrn."
+chown -R root:root debian/debian/var/www
+
+echo "Building the debian package"
+pushd debian
 dpkg-deb --build debian
-mv debian.deb dotlrn-2.2.0-0.deb 
+mv debian.deb ../${PACKAGENAME}
+popd