aboutsummaryrefslogtreecommitdiff
path: root/scripts/upload-pd-extended-to-launchpad.sh
blob: 66c2e6a8fa7db7e43991cc8db3680a7f6d9ac7f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

set -x

IPBASE=`ifconfig  | grep 'inet addr' \
    | sed -n 's|.*inet addr:\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p' \
    | grep -v '127\.0\.0'`

if [ "$IPBASE" = "10.4.0" ]; then
    DOWNLOAD_SERVER=10.4.0.50
else
    DOWNLOAD_SERVER=blinky.at.or.at:8888
fi

VERSION=0.43.4
DEBIAN_SOURCE_DATE=`date +%Y%m%d`
URL_DATE=`date +%Y-%m-%d`
ORIG=Pd-extended_${VERSION}~$DEBIAN_SOURCE_DATE-source.tar.bz2
DEBIAN=Pd-extended_${VERSION}~$DEBIAN_SOURCE_DATE-source.debian.tar.bz2
BASE_URL=http://${DOWNLOAD_SERVER}/auto-build/$URL_DATE

echo "Downloading source package from $BASE_URL"

# get the tarballs, and use existing versions if already there
wget -c ${BASE_URL}/${ORIG}
wget -c ${BASE_URL}/${DEBIAN}
# always fetch MD5s to make sure the existing tarballs were correct
rm -f *.md5
wget ${BASE_URL}/${ORIG}.md5
wget ${BASE_URL}/${DEBIAN}.md5
md5sum -c ${ORIG}.md5
md5sum -c ${DEBIAN}.md5

if [ -d pd-extended ]; then
    rm -rf pd-extended
fi
tar xjf ${ORIG}
# rename tarball to Debian orig name
mv $ORIG `echo $ORIG | sed 's,^P,p,' | sed 's,-source,.orig,'`
cd pd-extended
tar xjf ../${DEBIAN}

sed -i \
    's|^\(pd-extended (0.*-[0-9]\).*) [a-zA-Z][a-zA-Z]*;|\1~lucid) lucid;|' \
    debian/changelog
debuild -S
sed -i s,lucid,maverick,g debian/changelog && debuild -S
sed -i s,maverick,natty,g debian/changelog && debuild -S
sed -i s,natty,oneiric,g debian/changelog && debuild -S
sed -i s,oneiric,precise,g debian/changelog && debuild -S
sed -i s,precise,quantal,g debian/changelog && debuild -S

for f in ../pd-extended_*~*.changes; do
    echo $f
    dput ppa:eighthave/pd-extended $f
done