-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilddpkg.sh
executable file
·43 lines (33 loc) · 1.44 KB
/
builddpkg.sh
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
#!/bin/sh
##Build script for Darwin Streaming Server debian package
PLAT=`uname`
VER=`cat revision.h | grep "kVersionString \"" | cut -d \" -f 2`
PACKAGING_DIR=DarwinStreamingSrvr$VER-$PLAT
# Build the tarball first - this will handle getting everything compiled
echo '--- Building linux tarball - to trigger build process'
./buildtarball $VER
# Remove the tarball & clean the dist staging dir
echo '--- Removing results of tarball build'
rm $PACKAGING_DIR.tar.gz
rm -rf $PACKAGING_DIR
# Re-create the root in the dist dir, but not flattened
echo '--- Creating unflatted dist directory'
./DSS_MakeRoot $PACKAGING_DIR $VER
# Create and copy the debian files
echo '--- Creating debian control directory, and copying files over'
mkdir $PACKAGING_DIR/DEBIAN
cp -r dpkg/* $PACKAGING_DIR/DEBIAN/
eval `dpkg-architecture`
sed -i "s/@@DEB_BUILD_ARCH@@/${DEB_BUILD_ARCH}/g" $PACKAGING_DIR/DEBIAN/control
echo '--- Appending version to control file'
# Append the version number to the control file
echo 'Version: '$VER >> $PACKAGING_DIR/DEBIAN/control
echo '--- creating the init.d dir, moving script from it to control dir'
# Create the init.d dir in the dist dir, move script over.
mkdir $PACKAGING_DIR/etc/init.d
mv $PACKAGING_DIR/DEBIAN/streamingserver $PACKAGING_DIR/etc/init.d/
echo '--- Re-naming the config files to .dist'
# Re-name all the config files to .dist
for f in $PACKAGING_DIR/etc/streaming/*; do mv $f $f.dist; done
# Build the package
dpkg -b $PACKAGING_DIR