woody-buildpackage 2.21 KB
Newer Older
1 2
#! /bin/sh

3
# $Id: woody-buildpackage,v 1.7 2003/02/17 07:22:05 sam Exp $
4 5 6 7 8 9 10 11
# Build VLC for a Woody Debian system

if test ! -d debian
then
  echo "No debian/ directory"
  exit 1
fi

12
# changelog: replace (1.2.3-4) with (1.2.3-0woody.4)
13
sed -e 's/^vlc (\([^)]*\)-\([^-)]*\))/vlc (\1-0woody.\2)/' \
14
    < debian/changelog > debian/changelog.woody
15

16 17
# control: replace liba52-*-dev with a52dec-dev (>=0.7.3)
#                  libdv*-dev with libdv-dev
18 19
#                  kdelibs4-dev with kdelibs-dev
#                  libarts1-dev with libarts-dev
20
#          remove libwxgtk2.4-dev
21 22
sed -e 's/liba52-[^-]*-dev/a52dec-dev (>=0.7.3)/' \
    -e 's/libdv[0-9]*-dev/libdv-dev/' \
23 24 25
    -e 's/kdelibs[0-9]*-dev/kdelibs-dev/' \
    -e 's/libqt[0-9]*-dev/libqt-dev/' \
    -e 's/libarts[0-9]*-dev/libarts-dev/' \
26 27
    -e 's/, libwx[^,]*//' \
    -e '/Package: wxvlc/,/^ *$/d' \
28
    < debian/control > debian/control.woody
29

30 31
# rules: remove wxwindows stuff
#        change changelog path
32
sed -e '/# Package: wxvlc/,/^ *$/d' \
33
    -e 's,^ARCH_EXCLUDE =,& -Nwxvlc,' \
34
    -e 's,--enable-wxwindows,--disable-wxwindows,' \
35 36
    -e 's, debian/changelog , debian/changelog.woody ,' \
    -e 's,dh_gencontrol[^#]*,& -- -ldebian/changelog.woody,' \
37
    < debian/rules > debian/rules.woody
38 39
chmod a+x debian/rules.woody

40
# Environment variables - taken from dpkg-buildpackage
41 42 43 44 45 46 47 48 49 50 51 52
curd="`pwd`"
dirn="`basename \"$curd\"`"
package="`dpkg-parsechangelog -ldebian/changelog.woody | sed -n 's/^Source: //p'`"
version="`dpkg-parsechangelog -ldebian/changelog.woody | sed -n 's/^Version: //p'`"
maintainer="`dpkg-parsechangelog -ldebian/changelog.woody | sed -n 's/^Maintainer: //p'`"
eval `dpkg-architecture -a -t -s -f`
arch="`dpkg-architecture -a -t -qDEB_HOST_ARCH`"
sversion=`echo "$version" | perl -pe 's/^\d+://'`
pv="${package}_${sversion}"
pva="${package}_${sversion}_${arch}"
chg=../"$pva.changes"

53
# Do the real work
54
dpkg-checkbuilddeps -B debian/control.woody || exit 1
55
fakeroot debian/rules.woody clean
56
cd ..; dpkg-source -l"$dirn"/debian/changelog.woody -b "$dirn"; cd "$dirn"
57
debian/rules.woody build
58 59
fakeroot debian/rules.woody binary
dpkg-genchanges -ldebian/changelog.woody -cdebian/control.woody >"$chg"
60

61 62 63
# Clean up
rm -f debian/rules.woody debian/control.woody debian/changelog.woody