source: debian/rules @ 2253ad1

Last change on this file since 2253ad1 was 2253ad1, checked in by kytv <kytv@…>, 9 years ago

Use bzip2 to compress debian packages

This mainly has an effect on the size of the javadocs package (i2p-doc shrinks
to half of its present size when using bzip2). xz would give better
compression, of course, but xz support isn't isn't available in the version of
dpkg that ships with Lucid. All supported versions of Debian and Ubuntu support
bzip2 in .debs, so this will only have the impact of giving us smaller javadoc
packages.

  • Property mode set to 100755
File size: 4.1 KB
Line 
1#!/usr/bin/make -f
2
3# Quoting Policy version 3.9.2.0, 2011-04-07 section 4.9:
4
5# /start quote
6# For some packages, notably ones where the same source tree is compiled in
7# different ways to produce two binary packages, the build target does not make
8# much sense. For these packages it is good enough to provide two (or more)
9# targets (build-a and build-b or whatever) for each of the ways of building the
10# package, and a build target that does nothing. The binary target will have to
11# build the package in each of the possible ways and make the binary package out
12# of each.
13# ...
14# When a package has a configuration and build routine which takes a long time,
15# or when the makefiles are poorly designed, or when build needs to run clean
16# first, it is a good idea to touch build when the build process is complete.
17# This will ensure that if debian/rules build is run again it will not rebuild
18# the whole program.
19# /end quote
20
21# Since that fits building I2P very well, we override the build target.
22#
23
24build:
25        @echo 'The build target is disabled. Use the appropriate binary target.'
26
27JAVA_HOME=/usr/lib/jvm/default-java
28I2P=$(CURDIR)/pkg-temp
29ROUTERVERSION=$(CURDIR)/router/java/src/net/i2p/router/RouterVersion.java
30
31# I2P's version will be displayed in the router console as "$I2PVERSION-$EXTRAPREFIX$DEBIANVERSION", eg. 0.8.12-0-deb1
32export EXTRAPREFIX := deb
33export JAVA_HOME I2P
34export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/Version/{print $$2}' |sed 's/.*-\([[:digit:]]\{1,\}\).*$$/\1/')
35#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
36
37%:
38        dh $@ --with quilt
39
40clean: createcopyright
41
42override_dh_auto_clean:
43        -[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION)
44        dh_auto_clean
45        ant distclean
46        # The next line is used by KYTV when building from source packages
47        #rm -f apps/jetty/jetty-5.1.15.tgz
48        rm -f core/c/jbigi/*.[s]o
49        rm -rf core/c/jcpuid/lib/
50        debconf-updatepo
51
52override_dh_auto_build:
53
54binary-indep: build-indep
55build-indep:
56        dh_prep
57        cp -f $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak
58        sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp
59        mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION)
60        # The next line is used by KYTV when building from source packages
61        #[ -r jetty/jetty-5.1.15.tgz ] && ln -sf $(CURDIR)/jetty/jetty-5.1.15.tgz $(CURDIR)/apps/jetty/jetty-5.1.15.tgz
62        ant preppkg-unix javadoc
63        echo router.updateDisabled=true > $(I2P)/router.config
64        mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper
65        #-cp -fv /usr/share/tor/geoip $(CURDIR)/pkg-temp/geoip/geoip.txt
66       
67
68binary-arch: build-arch
69build-arch:
70        # build jbigi
71        cd $(CURDIR)/core/c/jbigi && ./mbuild_jbigi.sh dynamic
72        # build jcpuid
73        cd $(CURDIR)/core/c/jcpuid && ./build.sh
74
75binary: binary-arch binary-indep
76
77createcopyright:
78        @echo " *** Creating debian/copyright*** "
79        @rm -f $(CURDIR)/debian/copyright
80        @/bin/echo -e "This package was Debianized by kytv <killyourtv@i2pmail.org>" >> $(CURDIR)/debian/copyright
81        @/bin/echo -e "Sun, 23 Jan 2011 20:26:51 +0000" >> $(CURDIR)/debian/copyright
82        @/bin/echo -e "\nIt was downloaded from http://www.i2p2.de" >> $(CURDIR)/debian/copyright
83        @/bin/echo -e "\nI2P is tracked upstream using the Monotone VCS" >> $(CURDIR)/debian/copyright
84        @/bin/echo -e "Complete information on fetching the source with monotone can be found" >> $(CURDIR)/debian/copyright
85        @/bin/echo -e "at http://www.i2p2.de/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright
86        @/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright
87
88override_dh_compress:
89        dh_compress -X.xsl -X.xml
90
91override_dh_installchangelogs:
92        dh_installchangelogs history.txt
93
94override_dh_installdocs:
95        dh_installdocs -pi2p -plibjbigi-jni --link-doc=i2p-router
96        dh_installdocs --remaining-packages
97
98override_dh_dhlibdeps:
99        dh_shlibdeps -llibjbigi-jni debian/libjbigi-jni/usr/lib/jni/*.so
100
101#override_dh_installinit:
102#       dh_installinit -r
103
104override_dh_builddeb:
105        dh_builddeb -- -Zbzip2
106
107get-orig-source:
108        uscan --verbose --rename --destdir $(CURDIR)/.. --watchfile debian/watch --force-download
Note: See TracBrowser for help on using the repository browser.