File: mkdeb

package info (click to toggle)
fracplanet 0.5.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 752 kB
  • sloc: cpp: 6,473; sh: 106; makefile: 62
file content (122 lines) | stat: -rwxr-xr-x 3,810 bytes parent folder | download | duplicates (3)
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
117
118
119
120
121
122
#!/bin/bash -ev

# Based on instructions at https://wiki.debian.org/IntroDebianPackaging

# Before using this you probably need to install
#   sudo pbuilder 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
#   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 5 seconds..."
for t in 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 xfz ${TARBALLORIG}

if [! -d fracplanet-${VER} ] ; then
    echo "Could't find fracplanet-${VER} after unpacking" ; 
    exit ;
fi

cd fracplanet-${VER}

mkdir debian
dch --create -v ${VER}-${REV} --package fracplanet Create debian package from tarball

echo "9" > debian/compat

cat <<EOF > debian/control
Source: fracplanet
Section: graphics
Priority: optional
Standards-Version: 3.9.4
Maintainer: ${DEBEMAIL}
Build-Depends: debhelper (>=9),qt4-qmake,libqt4-dev,libqt4-opengl-dev,libboost-dev,libboost-program-options-dev,xsltproc
Homepage: http://www.bottlenose.demon.co.uk/share/fracplanet/

Package: fracplanet
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends}
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.
Suggests: blender
Homepage: http://www.bottlenose.demon.co.uk/share/fracplanet/
EOF

echo "Copyright 2014 ${DEBEMAIL}" > debian/copyright
echo "GPL2 license; see /usr/share/common-licenses/GPL-2" >> debian/copyright

echo '#!/usr/bin/make -f' > debian/rules
echo '%:' >> debian/rules
echo -e '\tdh $@' >> debian/rules
echo '' >> debian/rules
echo 'override_dh_auto_configure:' >> debian/rules
echo -e '\tQTDIR=/usr/share/qt4 bash -c "`dpkg-buildflags --export=configure` ./configure"' >> debian/rules
echo '' >> debian/rules
echo 'override_dh_auto_install:' >> debian/rules
echo -e '\tmkdir -p debian/fracplanet/usr/bin && cp fracplanet debian/fracplanet/usr/bin/' >> debian/rules
echo -e '\tmkdir -p debian/fracplanet/usr/share/man/man1 && cp man/man1/fracplanet.1 debian/fracplanet/usr/share/man/man1/' >> debian/rules
echo -e '\tmkdir -p debian/fracplanet/usr/share/doc/fracplanet && cp fracplanet.htm fracplanet.css BUGS TODO NEWS THANKS debian/fracplanet/usr/share/doc/fracplanet/' >> debian/rules

cp fracplanet.menu debian/

chmod 755 debian/rules

echo <<EOF > debian/fracplanet.dirs
/usr/bin
/usr/share/man/man1
/usr/share/doc/fracplanet
EOF

mkdir debian/source
echo "3.0 (quilt)" > debian/source/format

debuild -us -uc -S  # -S just builds dsc.
#debuild -us -uc -b  # Builds binary package, but not in isolated enironment.

cd ..

echo ${PROJECT}_${VER}-${REV}.dsc
ls -lh ${PROJECT}_${VER}-${REV}.dsc
mkdir pbuilder
sudo pbuilder --build --buildresult pbuilder ${PROJECT}_${VER}-${REV}.dsc
sudo chown ${USER}:${USER} pbuilder/*

#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'