File: makedeb

package info (click to toggle)
xsnow 1:3.1.1-1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 2,524 kB
  • sloc: ansic: 9,248; xml: 5,034; sh: 1,659; cpp: 118; pascal: 105; makefile: 70
file content (75 lines) | stat: -rwxr-xr-x 2,209 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# parameter all: produce debs for i386-stretch, amd64=stretch, amd64-sid
curdir=$PWD
unset CXXFLAGS
version=`./getversion`
echo "version = $version"
tar=$PWD/../versions/xsnow-$version.tar.gz
dir=xsnow-$version
dsc=xsnow_$version-1.dsc
debdir=$PWD/../debian/xsnow-$version-deb
#for d in debian debian.disco debian.stretch debian.sid ; do
#   if [ -e $d/changelog ] ; then
#      sed -i "1s/(.*)/($version-1)/" $d/changelog   || exit 1
#   fi
#done
./maketar || exit 1
rm -rf $debdir
mkdir -p $debdir || exit 1
cd $debdir || exit 1
cp $tar . || exit 1
tar xf $tar || exit
cd $dir || exit
codename=`lsb_release -sc`
rm -rf debian
cp -r $curdir/../xsnow-debian/debian .
cp $curdir/../xsnow-debian/debian.$codename/* debian || exit
#dh_make --yes -s -f $tar
echo xxxxxxxxx dh_make
dh_make --yes -s --createorig
cd ..
echo xxxxxxxxx "dpkg-source -b $dir"
dpkg-source -b $dir || exit 1
cd -
#debuild -us -uc --lintian-opts --profile debian || exit
echo xxxxxxxxx dpkg-buildpackage
dpkg-buildpackage -us -uc --check-command=lintian --check-option='--profile' --check-option=debian
if test "x$1" != xall ; then 
   cd ..
   rm -r $dir || exit 1
   echo $0 done
   exit 0
fi
cd ..
#for dist in amd64-sid ; do
for dist in i386-stretch amd64-stretch ; do
#for dist in amd64-sid i386-stretch amd64-stretch ; do
   debdirbuild=$curdir/../debian/xsnow-$version-deb-build.$dist
   rm -rf $debdirbuild
   mkdir -p $debdirbuild || exit 1
   workdir=`mktemp -d --tmpdir xsnow-pbuilder-$dist.XXXXXXX`
   echo building for $dist in $workdir ...
   cd $workdir || exit 1
   mkdir w || exit 1
   cd w || exit 1
   tar xf $tar || exit 1
   cd $dir || exit 1
   rm -rf debian
   cp -r $curdir/../xsnow-debian/debian .
   case $dist in
      *stretch*)
	 cp $curdir/../xsnow-debian/debian.stretch/* debian || exit 1
	 ;;
      *sid*)
	 cp $curdir/../xsnow-debian/debian.sid/* debian || exit 1
	 ;;
   esac
   dh_make --yes -s --createorig
   cd ..
   dpkg-source -b $dir || exit 1
   sudo pbuilder --build --configfile /root/pbuilderrc.$dist --buildresult $debdirbuild $workdir/w/*dsc
   sudo chown -h $USER.$USER $debdirbuild/* || exit 1
   debsign $debdirbuild/*.changes || exit 1
done
rm -r $dir || exit 1
echo $0 done