source: debian/rules @ b4524c6

Last change on this file since b4524c6 was b4524c6, checked in by HungryHobo <HungryHobo@…>, 10 years ago

Make separate i386 and amd64 packages, this fixes the arch-independent-package-contains-binary-or-object lintian error

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#!/usr/bin/make -f
2
3VERSION=`grep String\ VERSION core/java/src/net/i2p/CoreVersion.java | cut -d\" -f2`
4SOURCEURL=http://mirror.i2p2.de/i2psource_${VERSION}.tar.bz2
5
6DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
7ifeq ($(DEB_HOST_ARCH),i386)
8wrapperpath = installer/lib/wrapper/linux
9else ifeq ($(DEB_HOST_ARCH),amd64)
10wrapperpath = installer/lib/wrapper/linux64
11# other architectures could be supported by using runplain.sh
12endif
13
14build:
15        echo Target Architecture is $(DEB_HOST_ARCH)
16ifndef wrapperpath
17        @echo "Architecture not supported: $(DEB_HOST_ARCH)"
18        exit 1
19endif
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
61binary: 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
67clean:
68        rm -f debian/build
69        rm -rf debian/tmp/
70        ant distclean
71        @exit 0
72
73get-orig-source:
74        wget ${SOURCEURL}
Note: See TracBrowser for help on using the repository browser.