makedeb
changeset 1 6fceb66e1ad7
child 2 1090e2141798
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/makedeb	Fri Jun 26 16:48:50 2009 +0200
     1.3 @@ -0,0 +1,45 @@
     1.4 +#!/bin/bash -x
     1.5 +PACKAGE_ROOT=sonews
     1.6 +
     1.7 +# Compile classes 
     1.8 +scons
     1.9 +
    1.10 +# Create JAR files; this cannot be done with SCons,
    1.11 +# because Scons looses inner classes.
    1.12 +jar -cf sonews.jar -C classes/ org/
    1.13 +jar -ufe sonews.jar org.sonews.daemon.Main
    1.14 +jar -cf test.jar -C classes/ test/ 
    1.15 +jar -ufe test.jar test.TestBench
    1.16 +jar -cf sonews-helpers.jar helpers/
    1.17 +jar -uf sonews.jar org/sonews/web/*.tmpl
    1.18 +
    1.19 +# Create faked root for packaging
    1.20 +sudo rm -r $PACKAGE_ROOT/
    1.21 +mkdir -p $PACKAGE_ROOT/usr/share/java
    1.22 +mkdir -p $PACKAGE_ROOT/usr/bin
    1.23 +mkdir -p $PACKAGE_ROOT/etc/sonews
    1.24 +mkdir -p $PACKAGE_ROOT/usr/share/doc/sonews/
    1.25 +cp -r DEBIAN $PACKAGE_ROOT/
    1.26 +cp helpers/sonews $PACKAGE_ROOT/usr/bin/sonews
    1.27 +cp helpers/sonews.conf.sample $PACKAGE_ROOT/etc/sonews/sonews.conf
    1.28 +cp helpers/copyright $PACKAGE_ROOT/usr/share/doc/sonews/
    1.29 +cp sonews*.jar $PACKAGE_ROOT/usr/share/java/
    1.30 +
    1.31 +sudo chown root:root -R $PACKAGE_ROOT/
    1.32 +
    1.33 +dpkg-deb --build $PACKAGE_ROOT
    1.34 +
    1.35 +# Cleanup
    1.36 +sudo rm -r $PACKAGE_ROOT
    1.37 +rm -r classes/
    1.38 +
    1.39 +# Create metapackage sonews-web
    1.40 +PACKAGE_ROOT=sonews-web
    1.41 +mkdir $PACKAGE_ROOT
    1.42 +cp -r DEBIAN-web $PACKAGE_ROOT/DEBIAN
    1.43 +dpkg-deb --build $PACKAGE_ROOT
    1.44 +rm -r $PACKAGE_ROOT
    1.45 +
    1.46 +# Check debs
    1.47 +lintian sonews.deb
    1.48 +lintian sonews-web.deb