File: make_pkg_deb.sh

package info (click to toggle)
uhub 0.4.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,436 kB
  • ctags: 2,270
  • sloc: ansic: 18,123; xml: 575; perl: 568; sh: 368; makefile: 24
file content (95 lines) | stat: -rwxr-xr-x 2,389 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
. admin/common.sh

export_source_directory
build_binaries

DEB_REVISION=1

if [ -d deb ]; then
	rm -Rf deb
fi

mkdir -p \
	deb/DEBIAN \
	deb/usr/bin \
	deb/usr/share/man/man1/ \
	deb/usr/share/doc/uhub \
	deb/etc/uhub \
	|| exit 1

find deb -type d | xargs chmod 755

# Copy binaries...
cp ${PACKAGE}/${BINARY} deb/usr/bin
strip deb/usr/bin/${BINARY}

# Copy configuration files...
cp ${PACKAGE}/doc/uhub.conf deb/etc/uhub
cp ${PACKAGE}/doc/users.conf deb/etc/uhub
echo "Welcome to uHub" > deb/etc/uhub/motd.txt

# Copy other files
cp ${PACKAGE}/README deb/usr/share/doc/uhub
cp ${PACKAGE}/AUTHORS deb/usr/share/doc/uhub
gzip -c --best < ${PACKAGE}/ChangeLog > deb/usr/share/doc/uhub/changelog.gz
gzip -c --best < ${PACKAGE}/doc/uhub.1 > deb/usr/share/man/man1/uhub.1.gz

cat > deb/usr/share/doc/uhub/copyright <<EOF
uHub - a high performance hub for the ADC peer-to-peer network

Copyright (C) 2007-2009 Jan Vidar Krey <janvidar@extatic.org>

uHub is free and open source software, licensed under the
GNU General Public License version 3.

For details, see /usr/share/common-licenses/GPL-3
EOF

gzip -c --best > deb/usr/share/doc/uhub/changelog.Debian.gz <<EOF
uhub (${VERSION}) stable; urgency=low

  * See changelog.gz for details.

 -- Jan Vidar Krey <janvidar@extatic.org>  `date -R`
EOF

### Write control files
cd deb
echo "/etc/uhub/uhub.conf"   > DEBIAN/conffiles
echo "/etc/uhub/users.conf" >> DEBIAN/conffiles
echo "/etc/uhub/motd.txt"   >> DEBIAN/conffiles

md5sum `find usr -type f` > DEBIAN/md5sums

INSTALL_SIZE=`du -s | cut -f 1`

cat > DEBIAN/control <<EOF
Package: uhub
Version: ${VERSION}-${DEB_REVISION}
Architecture: ${HOST_MACHINE}
Maintainer: Jan Vidar Krey <janvidar@extatic.org>
Installed-Size: ${INSTALL_SIZE}
Depends: libc6 (>= 2.7-1), libevent1 (>= 1.3e-1)
Section: net
Priority: optional
Description: a high performance hub for the ADC peer-to-peer network
 uHub is a high performance peer-to-peer hub for the ADC network.
 Its low memory footprint allows it to handle several thousand users
 on high-end servers, or a small private hub on embedded hardware.
 .
Homepage: http://www.extatic.org/uhub/
EOF
cd ..

### Create deb file
fakeroot dpkg-deb --build deb
mv deb.deb uhub_${VERSION}-${DEB_REVISION}_${HOST_MACHINE}.deb

### Check for errors
lintian uhub_${VERSION}-${DEB_REVISION}_${HOST_MACHINE}.deb

### Cleanup
rm -Rf deb
rm -Rf ${PACKAGE}