_debian.sh 1.6 KB
Newer Older
sten's avatar
sten committed
1 2 3
#!/usr/bin/env bash

[ -n "${BASE}" ] || . scripts/_init.sh
4
[ -f ${RELEASE}/*tar.gz ] || . scripts/_tarball.sh
sten's avatar
sten committed
5 6

[ -d ${RELEASE}/debian ] || mkdir -p ${RELEASE}/debian
7 8 9 10
[ -d ${RELEASE}/debian_osc ] || mkdir -p ${RELEASE}/debian_osc

tgz=$(basename ${RELEASE}/*tar.gz)
ver=$(echo ${tgz%.tar.gz}| sed s/${NAME}-//)
sten's avatar
sten committed
11

12 13 14 15 16
# create regular debian sources
cd ${RELEASE}/debian
cp ${RELEASE}/${tgz} ${NAME}_${ver}.orig.tar.gz
tar xf ${NAME}_${ver}.orig.tar.gz
cd ${NAME}-${ver}
sten's avatar
sten committed
17 18 19
rsync -av ${BASE}/debian .
dpkg-buildpackage -S -sa
cd ${RELEASE}/debian
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
rm -rf ${NAME}-${ver}*


# and now osc hackjobs
cd ${RELEASE}/debian_osc
cp ${RELEASE}/${tgz} ${NAME}_${ver}.orig.tar.gz
cp ${RELEASE}/${tgz} ${NAME}-unstable_${ver}.orig.tar.gz
cp ${RELEASE}/${tgz} ${NAME}-static_${ver}.orig.tar.gz
tar xf ${NAME}_${ver}.orig.tar.gz
cd ${NAME}-${ver}
rsync -av ${BASE}/debian .
dpkg-buildpackage -S -sa -us -uc

# create unstable sources
sed -ie "s/^${NAME}/${NAME}-unstable/" debian/changelog
sed -ie "s/${NAME}\$/${NAME}-unstable/" debian/control
dpkg-buildpackage -S -sa -us -uc

# create static sources
sed -ie "s/^${NAME}-unstable/${NAME}-static/" debian/changelog
sed -ie "s/${NAME}-unstable\$/${NAME}-static/" debian/control
sed -ie "s/CFLAGS/--enable-static-libevent CFLAGS/" debian/rules
dpkg-buildpackage -S -sa -us -uc

cd ${RELEASE}/debian_osc
rm -rf ${NAME}-${ver}*

for dsc in *dsc; do
    flavour=${dsc/_*}
    sed -i 's/^Format:.*/Format: 1.0/' ${dsc}
    sed -i '/^Build-Depends/q' ${dsc}
    echo Debtransform-Files-Tar: debian.tar.gz >> ${dsc}
    echo Debtransform-Tar: ${tgz} >> ${dsc}
    rm ${flavour}_${ver}.orig.tar.gz 
done
sten's avatar
sten committed
55 56

cd ${BASE}