9 echo "We need 3 arguments"
14 DIR="/home/autobuild/packages/staging/freeside$FS_VERSION/$FS_REPO"
15 TARGET="/home/autobuild/public_html/freeside$FS_VERSION-$DISTRO-$FS_REPO"
17 if [ ! -d "$DIR" -a -d $TARGET ]; then
19 echo "Staging or Target directories do not exist"
23 GIT_VERSION=`grep '^$VERSION' $DIR/freeside/FS/FS.pm | cut -d\' -f2`
25 # Clean configuration file
26 rm -fr $DIR/freeside/debian/freeside-ng-selfservice.conffiles
30 git checkout -- debian/changelog
34 # Add the build information to changelog
35 if [ $FS_REPO != "stable" ]; then
36 dch -b --newversion $GIT_VERSION-$DATE "Auto-Build"
39 # Using pbuilder and pdebuild in chroot instead of building directly : dpkg-buildpackage -b -rfakeroot -uc -us
41 pdebuild --pbuilderroot sudo --debbuildopts "-b -rfakeroot -uc -us" --buildresult $TARGET --architecture all -- --distribution $DISTRO --basetgz /var/cache/pbuilder/$DISTRO.tgz
43 #--buildresult gets the file where it needs to be, may need to clean up DIR
45 cd $DIR && rm -f freeside_*
46 cd $TARGET && rm -f *.gz
48 apt-ftparchive -qq packages ./ | gzip >Packages.gz
49 apt-ftparchive -qq sources ./ | gzip >Sources.gz
50 apt-ftparchive -qq packages ./ | bzip2 >Packages.bz2
51 apt-ftparchive -qq sources ./ | bzip2 >Sources.bz2
52 apt-ftparchive -qq release ./ >Release