chris@1: #!/bin/bash -x
chris@1: PACKAGE_ROOT=sonews
chris@1: 
chris@1: # Compile classes 
chris@1: scons
chris@1: 
chris@1: # Create JAR files; this cannot be done with SCons,
chris@1: # because Scons looses inner classes.
chris@1: jar -cf sonews.jar -C classes/ org/
chris@3: jar -ufe sonews.jar org.sonews.Main
chris@1: jar -cf test.jar -C classes/ test/ 
chris@1: jar -ufe test.jar test.TestBench
chris@1: jar -cf sonews-helpers.jar helpers/
chris@1: 
chris@1: # Create faked root for packaging
chris@1: sudo rm -r $PACKAGE_ROOT/
chris@1: mkdir -p $PACKAGE_ROOT/usr/share/java
chris@1: mkdir -p $PACKAGE_ROOT/usr/bin
chris@1: mkdir -p $PACKAGE_ROOT/etc/sonews
chris@1: mkdir -p $PACKAGE_ROOT/usr/share/doc/sonews/
chris@1: cp -r DEBIAN $PACKAGE_ROOT/
chris@1: cp helpers/sonews $PACKAGE_ROOT/usr/bin/sonews
chris@1: cp helpers/sonews.conf.sample $PACKAGE_ROOT/etc/sonews/sonews.conf
chris@1: cp helpers/copyright $PACKAGE_ROOT/usr/share/doc/sonews/
chris@1: cp sonews*.jar $PACKAGE_ROOT/usr/share/java/
chris@1: 
chris@1: sudo chown root:root -R $PACKAGE_ROOT/
chris@1: 
chris@1: dpkg-deb --build $PACKAGE_ROOT
chris@1: 
chris@1: # Cleanup
chris@1: sudo rm -r $PACKAGE_ROOT
chris@1: rm -r classes/
chris@1: 
chris@1: # Check debs
chris@1: lintian sonews.deb