source: debian/rules @ b7a3b7b

Last change on this file since b7a3b7b was 8ba493c, checked in by kytv <kytv@…>, 7 years ago

debian: compress package with xz

All currently supported distros support this format.

  • Property mode set to 100755
File size: 4.1 KB
RevLine 
[7365ca8]1#!/usr/bin/make -f
2
[b6fab82]3# Quoting Policy version 3.9.2.0, 2011-04-07 section 4.9:
[af54166]4
[b6fab82]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#
[b4524c6]23
[7365ca8]24build:
[b6fab82]25        @echo 'The build target is disabled. Use the appropriate binary target.'
26
27JAVA_HOME=/usr/lib/jvm/default-java
28I2P=$(CURDIR)/pkg-temp
[3a2286f]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
[b6fab82]33export JAVA_HOME I2P
[db6b8d3]34export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/^Version:/{print $$2}' |sed 's/.*-\([0-9A-Za-z~]\{1,\}\)$$/\1/')
[b6fab82]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:
[3a2286f]43        -[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION)
[b6fab82]44        dh_auto_clean
45        ant distclean
[db6b8d3]46        find $(CURDIR)/core -name '*\.[s]o' -exec rm -f {} \;
47        rm -rf $(CURDIR)/core/c/jcpuid/lib/
[84e4558]48        #rm -f $(CURDIR)/installer/lib/wrapper/all/wrapper.jar
[b6fab82]49        debconf-updatepo
50
51override_dh_auto_build:
52
53binary-indep: build-indep
54build-indep:
55        dh_prep
[db6b8d3]56        if [ ! -e $(CURDIR)/debian/routerversion.java.bak ]; then \
57                cp $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak; \
58        fi
59ifeq "$(findstring deb,$(shell grep 'deb' $(ROUTERVERSION)))" ""
[3a2286f]60        sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp
61        mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION)
[db6b8d3]62else
63        @echo "Already found deb in version, not doing anything"
64endif
[2902a708]65        sh -n installer/resources/i2prouter || exit 1
66        sh -n installer/resources/runplain.sh || exit 1
[db6b8d3]67        TZ=UTC ant preppkg-unix javadoc
[0000e4f]68        echo router.updateDisabled=true > $(I2P)/router.config
[4433a3d]69        mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper
[ae101f6]70       
[5d9a7b9]71
[b6fab82]72binary-arch: build-arch
73build-arch:
74        # build jbigi
[49d7dace]75        cd $(CURDIR)/core/c/jbigi && ./build_jbigi.sh dynamic
[b6fab82]76        # build jcpuid
[89c01696]77        cd $(CURDIR)/core/c/jcpuid && ./build.sh
[b6fab82]78
79binary: binary-arch binary-indep
80
81createcopyright:
82        @echo " *** Creating debian/copyright*** "
83        @rm -f $(CURDIR)/debian/copyright
84        @/bin/echo -e "This package was Debianized by kytv <killyourtv@i2pmail.org>" >> $(CURDIR)/debian/copyright
85        @/bin/echo -e "Sun, 23 Jan 2011 20:26:51 +0000" >> $(CURDIR)/debian/copyright
86        @/bin/echo -e "\nIt was downloaded from http://www.i2p2.de" >> $(CURDIR)/debian/copyright
87        @/bin/echo -e "\nI2P is tracked upstream using the Monotone VCS" >> $(CURDIR)/debian/copyright
88        @/bin/echo -e "Complete information on fetching the source with monotone can be found" >> $(CURDIR)/debian/copyright
89        @/bin/echo -e "at http://www.i2p2.de/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright
90        @/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright
91
92override_dh_compress:
93        dh_compress -X.xsl -X.xml
94
95override_dh_installchangelogs:
96        dh_installchangelogs history.txt
[b97197c]97
[b6fab82]98override_dh_installdocs:
[164f060a]99        dh_installdocs -pi2p -plibjbigi-jni --link-doc=i2p-router
[b6fab82]100        dh_installdocs --remaining-packages
[e963c3d]101
[b6fab82]102override_dh_dhlibdeps:
103        dh_shlibdeps -llibjbigi-jni debian/libjbigi-jni/usr/lib/jni/*.so
[e963c3d]104
[b6fab82]105#override_dh_installinit:
106#       dh_installinit -r
[af54166]107
[2253ad1]108override_dh_builddeb:
[8ba493c]109        dh_builddeb -- -Zxz
[2253ad1]110
[af54166]111get-orig-source:
[b6fab82]112        uscan --verbose --rename --destdir $(CURDIR)/.. --watchfile debian/watch --force-download
Note: See TracBrowser for help on using the repository browser.