Alternc  latest
Alternc logiel libre pour l'hébergement
build.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 VERSION="1.0"
4 # We launch this script inside the home directory of the "nigthly build user"
5 cd ~
6 
7 # Shall we build or not ?
8 links -dump "http://alternc.org/svn/" | head -1 >new
9 if [ "`cat new`" == "`cat old`" ]
10 then
11  echo "No need to build : no change in the source since last launch"
12  exit 0
13 fi
14 mv -f new old
15 
16 DATE="`date +%Y%m%d%H%M`"
17 
18 mkdir ~/www/$DATE
19 
20 echo "BuildRoot cleanup"
21 cd ~/buildroot/ && rm -rf *
22 
23 echo "Building AlternC"
24 svn export -q http://alternc.org/svn/alternc/trunk/ alternc
25 cd alternc
26 mv debian/changelog debian/changelog.orig
27 cat >debian/changelog <<EOF
28 alternc (${VERSION}~nightly${DATE}) stable; urgency=low
29  * Automatic Nightly build of AlternC
30  * `cat ~/old`
31 
32  -- Nightly Build <nightly@alternc.org> `date -R`
33 
34 EOF
35 cat debian/changelog.orig >>debian/changelog
36 debuild -k0x1994905A >/dev/null
37 cd ..
38 rm -rf alternc
39 mv *.deb *.dsc *.build *.changes *.tar.gz ~/www/$DATE
40 
41 for module in awstats mailman changepass procmail
42  do
43  echo "Building AlternC-${module}"
44  svn export -q http://alternc.org/svn/alternc-${module}/trunk/ alternc-${module}
45  cd alternc-${module}
46  mv debian/changelog debian/changelog.orig
47  cat >debian/changelog <<EOF
48 alternc-${module} (${VERSION}~nightly${DATE}) stable; urgency=low
49  * Automatic Nightly build of AlternC-${module}
50  * `cat ~/old`
51 
52  -- Nightly Build <nightly@alternc.org> `date -R`
53 
54 EOF
55  cat debian/changelog.orig >>debian/changelog
56  debuild -k0x1994905A >/dev/null
57  cd ..
58  rm -rf alternc-${module}
59  mv *.deb *.dsc *.build *.changes *.tar.gz ~/www/$DATE
60 done
61 
62 rm ~/www/latest
63 ln -sf ~/www/$DATE ~/www/latest
64 
65 cd ~/www
66 apt-ftparchive packages $DATE/ | tee $DATE/Packages | gzip -c9 >$DATE/Packages.gz
67 (echo "Suite: $DATE"
68 echo "Codename: latest"
69 echo "Components: main"
70 echo "Origin: AlternC"
71 echo "Label: AlternC Nightly Build dated $DATE"
72 echo "Architectures: i386 amd64"
73 echo "Description: This repository contains a nightly build of all AlternC packages"
74 apt-ftparchive release $DATE/ ) >$DATE/Release
75 
76 gpg -ba $DATE/Release
77 mv $DATE/Release.asc $DATE/Release.gpg
78