-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-znc.sh
53 lines (48 loc) · 1.48 KB
/
build-znc.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
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
BUILDDIR="/root/build"
DEBDIR="/root/latestbuilds"
MAINTAINER="[email protected]"
LOGFILE="/root/logbuilds"
if [ "$1" == "" ]; then
echo "Must provide version to download!"
exit
fi
#####################
# Cleanup, dl, untar
#####################
cd "$BUILDDIR"
rm -R znc*
wget http://znc.in/releases/znc-$1.tar.gz
tar xvf znc*tar.gz
rm znc*tar.gz
cd znc*
#####################
#####################
# Control files
#####################
mkdir -p tmp/DEBIAN
echo "Package: znc" >> tmp/DEBIAN/control
echo "Maintainer: $MAINTAINER" >> tmp/DEBIAN/control
echo "Architecture: amd64" >> tmp/DEBIAN/control
echo "Version: $1" >> tmp/DEBIAN/control
echo "Provides: znc" >> tmp/DEBIAN/control
echo "Depends: libc-ares2 (>= 1.7.0), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6)" >> tmp/DEBIAN/control
echo "Priority: optional" >> tmp/DEBIAN/control
echo "Section: main" >> tmp/DEBIAN/control
echo "Filename: pool/main/z/znc/znc_$1_amd64.deb" >> tmp/DEBIAN/control
echo "Description: znc is an IRC proxy (bouncer)." >> tmp/DEBIAN/control
chmod -R a-s tmp/DEBIAN
echo "#!/bin/sh" >> tmp/DEBIAN/postinst
echo "ldconfig" >> tmp/DEBIAN/postinst
chmod 755 tmp/DEBIAN/postinst
#####################
#####################
# Build it!
#####################
./configure
make DESTDIR="$(pwd)"/tmp install
dpkg-deb --build tmp "znc_$1_amd64.deb"
rm $DEBDIR/znc*deb 2> /dev/null
mv *deb "$DEBDIR/"
echo "$(date) - znc $1 build ready" >> "$LOGFILE"
#####################