1 | #!/usr/bin/make -f |
---|
2 | |
---|
3 | VERSION=`grep String\ VERSION core/java/src/net/i2p/CoreVersion.java | cut -d\" -f2` |
---|
4 | SOURCEURL=http://mirror.i2p2.de/i2psource_${VERSION}.tar.bz2 |
---|
5 | |
---|
6 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
---|
7 | ifeq ($(DEB_HOST_ARCH),i386) |
---|
8 | wrapperpath = installer/lib/wrapper/linux |
---|
9 | else ifeq ($(DEB_HOST_ARCH),amd64) |
---|
10 | wrapperpath = installer/lib/wrapper/linux64 |
---|
11 | # other architectures could be supported by using runplain.sh |
---|
12 | endif |
---|
13 | |
---|
14 | build: |
---|
15 | echo Target Architecture is $(DEB_HOST_ARCH) |
---|
16 | ifndef wrapperpath |
---|
17 | @echo "Architecture not supported: $(DEB_HOST_ARCH)" |
---|
18 | exit 1 |
---|
19 | endif |
---|
20 | ant preppkg-linux-only |
---|
21 | mkdir -p debian/tmp/usr/lib |
---|
22 | mkdir -p debian/tmp/etc/init.d |
---|
23 | cp -a debian/scripts/init debian/tmp/etc/init.d/i2p |
---|
24 | cp -a pkg-temp debian/tmp/usr/lib/i2p |
---|
25 | sed 's|$$INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/wrapper.config > debian/tmp/usr/lib/i2p/a |
---|
26 | sed 's|$$SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/wrapper.config |
---|
27 | mkdir -p debian/tmp/usr/bin |
---|
28 | sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/eepget > debian/tmp/usr/lib/i2p/a |
---|
29 | mv debian/tmp/usr/lib/i2p/a debian/tmp/usr/lib/i2p/eepget |
---|
30 | ln -s /usr/lib/i2p/eepget debian/tmp/usr/bin/eepget |
---|
31 | chmod +x debian/tmp/usr/lib/i2p/eepget |
---|
32 | sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/runplain.sh > debian/tmp/usr/lib/i2p/a |
---|
33 | sed 's|%SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/runplain.sh |
---|
34 | sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/i2prouter > debian/tmp/usr/lib/i2p/a |
---|
35 | sed 's|%SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/i2prouter |
---|
36 | ln -s /usr/lib/i2p/i2prouter debian/tmp/usr/bin/i2prouter |
---|
37 | chmod +x debian/tmp/usr/lib/i2p/i2prouter |
---|
38 | rm debian/tmp/usr/lib/i2p/a |
---|
39 | touch debian/build |
---|
40 | mkdir -p debian/tmp/usr/share/doc/i2p |
---|
41 | |
---|
42 | @# copy wrapper files |
---|
43 | cp ${wrapperpath}/libwrapper.so debian/tmp/usr/lib/i2p/lib/ |
---|
44 | cp ${wrapperpath}/wrapper.jar debian/tmp/usr/lib/i2p/lib/ |
---|
45 | cp ${wrapperpath}/i2psvc debian/tmp/usr/lib/i2p/ |
---|
46 | chmod +x debian/tmp/usr/lib/i2p/i2psvc |
---|
47 | |
---|
48 | @# Create the Debian copyright file, move the licenses dir, |
---|
49 | @# and delete all license files that are already in /usr/share/common-licenses/ |
---|
50 | cat debian/copyright.part1 LICENSE.txt > debian/tmp/usr/share/doc/i2p/copyright |
---|
51 | mv debian/tmp/usr/lib/i2p/licenses debian/tmp/usr/share/doc/i2p |
---|
52 | rm debian/tmp/usr/lib/i2p/LICENSE.txt |
---|
53 | rm debian/tmp/usr/share/doc/i2p/licenses/LICENSE-Apache2.0.txt |
---|
54 | rm debian/tmp/usr/share/doc/i2p/licenses/LICENSE-GPLv2.txt |
---|
55 | rm debian/tmp/usr/share/doc/i2p/licenses/LICENSE-LGPLv2.1.txt |
---|
56 | |
---|
57 | @# changelog |
---|
58 | gzip -9c history.txt > debian/tmp/usr/share/doc/i2p/changelog.gz |
---|
59 | gzip -9c debian/changelog > debian/tmp/usr/share/doc/i2p/changelog.Debian.gz |
---|
60 | |
---|
61 | binary: build |
---|
62 | mkdir -p debian/tmp/DEBIAN |
---|
63 | dpkg-gencontrol |
---|
64 | cp -a debian/scripts/postinst debian/scripts/postrm debian/scripts/prerm debian/tmp/DEBIAN |
---|
65 | dpkg-deb -b debian/tmp .. |
---|
66 | |
---|
67 | clean: |
---|
68 | rm -f debian/build |
---|
69 | rm -rf debian/tmp/ |
---|
70 | ant distclean |
---|
71 | @exit 0 |
---|
72 | |
---|
73 | get-orig-source: |
---|
74 | wget ${SOURCEURL} |
---|