-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkdeb
executable file
·117 lines (95 loc) · 3.49 KB
/
mkdeb
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash -ev
# Before using this you probably need to install
# sudo pbuilder yada devscripts lintian cdeboostrap (or debootstrap)
# and maybe dpkg-sig. Also:
# set up for sudo
# set up pbuilder with
# sudo emacs -nw /etc/pbuilderrc
# ...change MIRRORSITE & DEBSECSERVER
# sudo pbuilder create --distribution sarge/etch/whatever
# and/or update with
# sudo pbuilder update
# Expect a lot of warnings re LOGNAME - see Debian bug Bug#275118
# TODO: DEBEMAIL
VER=`./VERSION`
TARBALL=fracplanet-${VER}.tar.gz
if [ ! -s ${TARBALL} ] ; then
echo "Could't find ${TARBALL}" ;
exit ;
fi
export DISTRIBUTION=`lsb_release -s -c`
echo "*** Will package ${TARBALL} for distribution \"${DISTRIBUTION}\""
echo -n "*** Starting in 10 seconds..."
for t in 10 9 8 7 6 5 4 3 2 1 ; do sleep 1 ; echo -n "." ; done
PROJECT=`echo $TARBALL | sed 's/-.*//'`
TARBALLORIG="${PROJECT}_${VER}.orig.tar.gz"
REV="1${DISTRIBUTION}1"
WORKDIR=pkg_${VER}-${REV}
rm -r -f ${WORKDIR}
mkdir ${WORKDIR}
cd ${WORKDIR}
cp ../${TARBALL} ${TARBALLORIG}
tar xvfz ${TARBALLORIG}
mv ${PROJECT} ${PROJECT}-${VER}
cd ${PROJECT}-${VER}
sed -i "s/${VER}/${VER}-${REV}/g" VERSION
mkdir debian
echo "${PROJECT} (${VER}-${REV}) ${DISTRIBUTION}; urgency=low" > debian/changelog
echo >> debian/changelog
echo " * Package created by ${PROJECT}'s mkdeb script." >> debian/changelog
echo >> debian/changelog
DATE=`date -R`
echo " -- $USER <$EMAIL> $DATE" >> debian/changelog
# Presumably a dch -i here would increment revision
cat << EOF > debian/packages
Source: fracplanet
Section: graphics
Priority: extra
Maintainer: Tim Day <[email protected]>
Standards-Version: 3.6.1
Upstream-Source: <URL:http://sourceforge.net/projects/fracplanet/index.htm>
Home-Page: <URL:http://www.bottlenose.demon.co.uk/share/fracplanet>
Description: Fractal terrain generator
Copyright: GPL
Copyright 2009 Tim Day
Build-Depends: qt4-qmake,libqt4-dev,libqt4-opengl-dev,libboost-dev,libboost-program-options-dev,xsltproc
Build: sh
export QTDIR=/usr/share/qt4
# Note: yada install deals with DEB_BUILD_OPTIONS 'nostrip'
if [ "${DEB_BUILD_OPTIONS#*noopt}" != "$DEB_BUILD_OPTIONS" ]; then
./configure "CONFIG -= release" "CONFIG += debug"
else
./configure # No noticeable advantage in overriding default qt optimisation options
fi
make
Clean: sh
make distclean || make clean || true
Package: fracplanet
Architecture: any
Depends: []
Suggests: povray,blender
Description: Fractal terrain generator
Fracplanet generates random planets and terrain with oceans,
mountains, icecaps and rivers. Parameters are specified interactively
and the results displayed using OpenGL. The generated objects can be
exported as geometry for Pov-Ray or Blender, or as textures.
Install: sh
yada install -bin fracplanet
yada install -doc fracplanet.htm fracplanet.css
yada install -doc BUGS TODO NEWS THANKS
yada install -man man/man1/fracplanet.1
Menu: ?package(fracplanet): needs="x11" section="Applications/Graphics" title="Fracplanet" command="/usr/bin/fracplanet" longtitle="Fractal terrain generator"
EOF
yada rebuild
cd ..
dpkg-source -b ${PROJECT}-${VER} ${TARBALLORIG}
# Alternative but inferior approach is apparently to do
# dpkg-buildpackage -rfakeroot
mkdir result
echo "Building package"
sudo pbuilder build --buildresult ./result ${PROJECT}_${VER}-${REV}.dsc
sudo chown ${USER}:${USER} result/*
RESULT=`(cd .. ; find ${WORKDIR} -name '*.deb')`
echo "Results: ${RESULT}"
echo "Don't forget to lintian ${RESULT}"
echo 'Also dpkg-sig --sign builder -k $DPKGSIG_KEYID any .deb files'