-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdeb-czmq.sh
executable file
·65 lines (64 loc) · 2.68 KB
/
deb-czmq.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
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
export NAME=libczmq
export VERSION=3.0.2
export DEBVERSION=${VERSION}-1
export URL=https://github.com/zeromq/czmq/releases/download/v${VERSION}/czmq-${VERSION}.tar.gz
#Download it
wget "$URL" -O ${NAME}_${VERSION}.orig.tar.gz
tar xzvf ${NAME}_${VERSION}.orig.tar.gz
cd czmq-${VERSION}
rm -rf debian
mkdir -p debian
#Use the existing COPYING file
cp COPYING debian/copyright
#Create the changelog (no messages - dummy)
dch --create -v $DEBVERSION --package ${NAME} ""
#Create copyright file
cp COPYING debian/copyright
#Create control file
echo "Source: $NAME" > debian/control
echo "Maintainer: None <none@example.com>" >> debian/control
echo "Section: misc" >> debian/control
echo "Priority: optional" >> debian/control
echo "Standards-Version: 3.9.2" >> debian/control
echo "Build-Depends: debhelper (>= 8), libzmq4-dev" >> debian/control
#Main library package
echo "" >> debian/control
echo "Package: $NAME" >> debian/control
echo "Architecture: any" >> debian/control
echo "Provides: libczmq1" >> debian/control
echo "Replaces: libczmq" >> debian/control
echo "Conflicts: libczmq" >> debian/control
echo "Depends: ${shlibs:Depends}, ${misc:Depends}, libzmq4 (>= 4.0)" >> debian/control
echo "Homepage: http://czmq.zeromq.org/" >> debian/control
echo "Description: ZeroMQ (0MQ) lightweight messaging kernel CZMQ High-Level C-Binding" >> debian/control
#-dev package
echo "" >> debian/control
echo "Package: $NAME-dev" >> debian/control
echo "Architecture: all" >> debian/control
echo "Provides: libczmq-dev" >> debian/control
echo "Replaces: libczmq-dev" >> debian/control
echo "Conflicts: libczmq-dev" >> debian/control
echo "Depends: libzmq4-dev (>= 3.0), libczmq (= $DEBVERSION), " >> debian/control
echo "Homepage: http://czmq.zeromq.org/" >> debian/control
echo "Description: ZeroMQ (0MQ) lightweight messaging kernel CZMQ High-Level C-Binding (development headers)" >> debian/control
#Create rules file
echo '#!/usr/bin/make -f' > debian/rules
echo '%:' >> debian/rules
echo -e '\tdh $@' >> debian/rules
echo 'override_dh_auto_configure:' >> debian/rules
echo -e "\tCCFLAG='-pthread' ./configure --prefix=`pwd`/debian/${NAME}/usr" >> debian/rules
echo 'override_dh_auto_build:' >> debian/rules
echo -e '\tmake -j4' >> debian/rules
echo 'override_dh_auto_test:' >> debian/rules
echo 'override_dh_auto_install:' >> debian/rules
echo -e '\tmake install' >> debian/rules
echo -e "\tmkdir -p debian/$NAME-dev/usr" >> debian/rules
echo -e "\tmv debian/$NAME/usr/include debian/$NAME-dev/usr/" >> debian/rules
echo -e "\tcd debian/$NAME/usr/bin/ && mv makecert zmq-makecert" >> debian/rules
#Create some misc files
mkdir -p debian/source
echo "8" > debian/compat
echo "3.0 (quilt)" > debian/source/format
#Build it
debuild -us -uc