source: debian/rules @ 5d1796b

Last change on this file since 5d1796b was bfba732, checked in by kytv <kytv@…>, 6 years ago

Debian: Add systemd support (ticket #1208)

Currently just for Debian unstable and Ubuntu Saucy and newer.

  • Property mode set to 100755
File size: 4.7 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/.*-\([0-9A-Za-z~]\{1,\}\)$$/\1/')
35#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
36
37%:
38        dh $@ --with quilt
39        # with systemd needs dh-systemd which isn't available in Wheezy (except from backports),
40        # and is only Ubuntu as of "Saucy". The official packages will enable this for Debian unstable and
41        # Ubuntu Saucy (and newer)
42        #dh $@ --with systemd,quilt
43
44clean: createcopyright
45
46override_dh_auto_clean:
47        -[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION)
48        dh_auto_clean
49        ant distclean
50        find $(CURDIR)/core -name '*\.[s]o' -exec rm -f {} \;
51        rm -rf $(CURDIR)/core/c/jcpuid/lib/
52        #rm -f $(CURDIR)/installer/lib/wrapper/all/wrapper.jar
53        debconf-updatepo
54
55override_dh_auto_build:
56
57# Uncomment the next override line for systems that support dh-systemd
58# (currently Debian unstable and Ubuntu Saucy (and newer))
59#override_dh_systemd_enable:
60        # We purposely do not set I2P to start at boot.
61        # This matches the behavior of the initscript
62        # and the setting RUN_DAEMON=false in /etc/default/i2p
63
64binary-indep: build-indep
65build-indep:
66        dh_prep
67        if [ ! -e $(CURDIR)/debian/routerversion.java.bak ]; then \
68                cp $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak; \
69        fi
70ifeq "$(findstring deb,$(shell grep 'deb' $(ROUTERVERSION)))" ""
71        sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp
72        mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION)
73else
74        @echo "Already found deb in version, not doing anything"
75endif
76        sh -n installer/resources/i2prouter || exit 1
77        sh -n installer/resources/runplain.sh || exit 1
78        TZ=UTC ant preppkg-unix javadoc
79        echo router.updateDisabled=true > $(I2P)/router.config
80        mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper
81       
82
83binary-arch: build-arch
84build-arch:
85        # build jbigi
86        cd $(CURDIR)/core/c/jbigi && ./build_jbigi.sh dynamic
87        # build jcpuid
88        cd $(CURDIR)/core/c/jcpuid && ./build.sh
89
90binary: binary-arch binary-indep
91
92createcopyright:
93        @echo " *** Creating debian/copyright*** "
94        @rm -f $(CURDIR)/debian/copyright
95        @/bin/echo -e "This package was Debianized by kytv <killyourtv@i2pmail.org>" >> $(CURDIR)/debian/copyright
96        @/bin/echo -e "Sun, 23 Jan 2011 20:26:51 +0000" >> $(CURDIR)/debian/copyright
97        @/bin/echo -e "\nIt was downloaded from http://www.i2p2.de" >> $(CURDIR)/debian/copyright
98        @/bin/echo -e "\nI2P is tracked upstream using the Monotone VCS" >> $(CURDIR)/debian/copyright
99        @/bin/echo -e "Complete information on fetching the source with monotone can be found" >> $(CURDIR)/debian/copyright
100        @/bin/echo -e "at http://www.i2p2.de/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright
101        @/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright
102
103override_dh_compress:
104        dh_compress -X.xsl -X.xml
105
106override_dh_installchangelogs:
107        dh_installchangelogs history.txt
108
109override_dh_installdocs:
110        dh_installdocs -pi2p -plibjbigi-jni --link-doc=i2p-router
111        dh_installdocs --remaining-packages
112
113override_dh_dhlibdeps:
114        dh_shlibdeps -llibjbigi-jni debian/libjbigi-jni/usr/lib/jni/*.so
115
116#override_dh_installinit:
117#       dh_installinit -r
118
119override_dh_builddeb:
120        dh_builddeb -- -Zxz
121
122get-orig-source:
123        uscan --verbose --rename --destdir $(CURDIR)/.. --watchfile debian/watch --force-download
Note: See TracBrowser for help on using the repository browser.