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 | |
---|
24 | build: |
---|
25 | @echo 'The build target is disabled. Use the appropriate binary target.' |
---|
26 | |
---|
27 | JAVA_HOME=/usr/lib/jvm/default-java |
---|
28 | I2P=$(CURDIR)/pkg-temp |
---|
29 | ROUTERVERSION=$(CURDIR)/router/java/src/net/i2p/router/RouterVersion.java |
---|
30 | export DEB_BUILD_HARDENING=1 |
---|
31 | |
---|
32 | # I2P's version will be displayed in the router console as "$I2PVERSION-$EXTRAPREFIX$DEBIANVERSION", eg. 0.8.12-0-deb1 |
---|
33 | #export EXTRAPREFIX := deb |
---|
34 | export JAVA_HOME I2P |
---|
35 | export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/^Version:/{print $$2}' |sed 's/.*-\([.0-9A-Za-z~+]\{1,\}\)$$/\1/') |
---|
36 | #export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) |
---|
37 | |
---|
38 | %: |
---|
39 | dh $@ --with systemd,quilt |
---|
40 | |
---|
41 | clean: createcopyright |
---|
42 | |
---|
43 | override_dh_auto_clean: |
---|
44 | -[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION) |
---|
45 | dh_auto_clean |
---|
46 | ant distclean |
---|
47 | find $(CURDIR)/core \( -name '*\.so' -o -name '*\.o' \) -exec rm -f {} \; |
---|
48 | rm -rf $(CURDIR)/core/c/jcpuid/lib/ |
---|
49 | rm -f $(CURDIR)/installer/lib/wrapper/all/wrapper.jar |
---|
50 | rm -rf $(CURDIR)/debian/python-i2p |
---|
51 | rm -f $(CURDIR)/override.properties |
---|
52 | debconf-updatepo |
---|
53 | |
---|
54 | override_dh_auto_build: |
---|
55 | |
---|
56 | override_dh_systemd_enable: |
---|
57 | # We purposely do not set I2P to start at boot. |
---|
58 | # This matches the behavior of the initscript |
---|
59 | # and the setting RUN_DAEMON=false in /etc/default/i2p |
---|
60 | |
---|
61 | binary-indep: build-indep |
---|
62 | build-indep: |
---|
63 | dh_prep |
---|
64 | mkdir -p $(CURDIR)/installer/lib/wrapper/all |
---|
65 | ln -sf /usr/share/java/wrapper.jar $(CURDIR)/installer/lib/wrapper/all/wrapper.jar |
---|
66 | if [ ! -e $(CURDIR)/debian/routerversion.java.bak ]; then \ |
---|
67 | cp $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak; \ |
---|
68 | fi |
---|
69 | ifeq "$(findstring deb,$(shell grep 'deb' $(ROUTERVERSION)))" "" |
---|
70 | sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp |
---|
71 | mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION) |
---|
72 | else |
---|
73 | @echo "Already found deb in version, not doing anything" |
---|
74 | endif |
---|
75 | @# build options |
---|
76 | @/bin/echo -e "javac.version=1.7" > $(CURDIR)/override.properties |
---|
77 | @/bin/echo -e "javac.compilerargs=-bootclasspath $(JAVA_HOME)/jre/lib/rt.jar:$(JAVA_HOME)/jre/lib/jce.jar" >> $(CURDIR)/override.properties |
---|
78 | @/bin/echo -e "javac.compilerargs7=-bootclasspath $(JAVA_HOME)/jre/lib/rt.jar:$(JAVA_HOME)/jre/lib/jce.jar" >> $(CURDIR)/override.properties |
---|
79 | @/bin/echo -e "build.built-by=debian" >> $(CURDIR)/override.properties |
---|
80 | |
---|
81 | @# debian and ubuntu: everywhere |
---|
82 | @/bin/echo -e "with-geoip-database=true" >> $(CURDIR)/override.properties |
---|
83 | |
---|
84 | @# ubuntu: not in precise |
---|
85 | @# debian: in wheezy jessie stretch sid |
---|
86 | @/bin/echo -e "with-libjetty8-java=true" >> $(CURDIR)/override.properties |
---|
87 | mkdir -p $(CURDIR)/apps/jetty/jettylib |
---|
88 | ln -sf /usr/share/java/jetty8-continuation.jar $(CURDIR)/apps/jetty/jettylib/jetty-continuation.jar |
---|
89 | ln -sf /usr/share/java/jetty8-deploy.jar $(CURDIR)/apps/jetty/jettylib/jetty-deploy.jar |
---|
90 | ln -sf /usr/share/java/jetty8-http.jar $(CURDIR)/apps/jetty/jettylib/jetty-http.jar |
---|
91 | ln -sf /usr/share/java/jetty8-io.jar $(CURDIR)/apps/jetty/jettylib/jetty-io.jar |
---|
92 | ln -sf /usr/share/java/jetty8-rewrite.jar $(CURDIR)/apps/jetty/jettylib/jetty-rewrite-handler.jar |
---|
93 | ln -sf /usr/share/java/jetty8-security.jar $(CURDIR)/apps/jetty/jettylib/jetty-security.jar |
---|
94 | ln -sf /usr/share/java/jetty8-servlet.jar $(CURDIR)/apps/jetty/jettylib/jetty-servlet.jar |
---|
95 | ln -sf /usr/share/java/jetty8-servlets.jar $(CURDIR)/apps/jetty/jettylib/jetty-servlets.jar |
---|
96 | ln -sf /usr/share/java/jetty8-start.jar $(CURDIR)/apps/jetty/jettylib/jetty-start.jar |
---|
97 | ln -sf /usr/share/java/jetty8-util.jar $(CURDIR)/apps/jetty/jettylib/jetty-util.jar |
---|
98 | ln -sf /usr/share/java/jetty8-webapp.jar $(CURDIR)/apps/jetty/jettylib/jetty-webapp.jar |
---|
99 | ln -sf /usr/share/java/jetty8-xml.jar $(CURDIR)/apps/jetty/jettylib/jetty-xml.jar |
---|
100 | ln -sf /usr/share/java/jetty8-server.jar $(CURDIR)/apps/jetty/jettylib/org.mortbay.jetty.jar |
---|
101 | ln -sf /usr/share/java/jetty8-jmx.jar $(CURDIR)/apps/jetty/jettylib/org.mortbay.jmx.jar |
---|
102 | @# following two are from libservlet3.0-java which is a dependency of libjetty8-java |
---|
103 | ln -sf /usr/share/java/servlet-api-3.0.jar $(CURDIR)/apps/jetty/jettylib/javax.servlet.jar |
---|
104 | ln -sf /usr/share/java/jsp-api-2.2.jar $(CURDIR)/apps/jetty/jettylib/jsp-api.jar |
---|
105 | |
---|
106 | @# ubuntu: only in precise trusty vivid |
---|
107 | @# debian: only in wheezy |
---|
108 | @#@/bin/echo -e "with-libtomcat6-java=true" >> $(CURDIR)/override.properties |
---|
109 | @#mkdir -p $(CURDIR)/apps/jetty/jettylib |
---|
110 | @#ln -sf /usr/share/java/jasper.jar $(CURDIR)/apps/jetty/jettylib/jasper-runtime.jar |
---|
111 | @#ln -sf /usr/share/java/tomcat-coyote.jar $(CURDIR)/apps/jetty/jettylib/tomcat-coyote.jar |
---|
112 | @#ln -sf /usr/share/java/tomcat-juli.jar $(CURDIR)/apps/jetty/jettylib/commons-logging.jar |
---|
113 | @#ln -sf /usr/share/java/jasper-el.jar $(CURDIR)/apps/jetty/jettylib/jasper-el.jar |
---|
114 | @# following is from libservlet2.5-java which is a dependency of libtomcat6-java |
---|
115 | @#ln -sf /usr/share/java/el-api-2.1.jar $(CURDIR)/apps/jetty/jettylib/commons-el.jar |
---|
116 | |
---|
117 | @# debian and ubuntu: everywhere |
---|
118 | @#/bin/echo -e "with-libtomcat7-java=true" >> $(CURDIR)/override.properties |
---|
119 | @#mkdir -p $(CURDIR)/apps/jetty/jettylib |
---|
120 | @#ln -sf /usr/share/java/tomcat-jasper.jar $(CURDIR)/apps/jetty/jettylib/jasper-runtime.jar |
---|
121 | @#ln -sf /usr/share/java/tomcat-api.jar $(CURDIR)/apps/jetty/jettylib/tomcat-api.jar |
---|
122 | @#ln -sf /usr/share/java/tomcat-util.jar $(CURDIR)/apps/jetty/jettylib/tomcat-util.jar |
---|
123 | @#ln -sf /usr/share/java/tomcat-coyote.jar $(CURDIR)/apps/jetty/jettylib/tomcat-coyote.jar |
---|
124 | @#ln -sf /usr/share/java/tomcat-juli.jar $(CURDIR)/apps/jetty/jettylib/commons-logging.jar |
---|
125 | @#ln -sf /usr/share/java/tomcat-jasper-el.jar $(CURDIR)/apps/jetty/jettylib/jasper-el.jar |
---|
126 | @# following is from libservlet3.0-java which is a dependency of libtomcat7-java |
---|
127 | @#ln -sf /usr/share/java/el-api-2.2.jar $(CURDIR)/apps/jetty/jettylib/commons-el.jar |
---|
128 | |
---|
129 | @# debian and ubuntu: everywhere |
---|
130 | @/bin/echo -e "with-glassfish-javaee=true" >> $(CURDIR)/override.properties |
---|
131 | ln -sf /usr/share/java/glassfish-javaee.jar $(CURDIR)/apps/susidns/src/lib/jstl.jar |
---|
132 | ln -sf /usr/share/java/glassfish-appserv-jstl.jar $(CURDIR)/apps/susidns/src/lib/standard.jar |
---|
133 | |
---|
134 | @# debian and ubuntu: everywhere |
---|
135 | @#/bin/echo -e "with-libjakarta-taglibs-standard-java=true" >> $(CURDIR)/override.properties |
---|
136 | @#ln -sf /usr/share/java/standard.jar $(CURDIR)/apps/susidns/src/lib/standard.jar |
---|
137 | |
---|
138 | @# debian and ubuntu: everywhere |
---|
139 | @#/bin/echo -e "with-libjstl1.1-java=true" >> $(CURDIR)/override.properties |
---|
140 | @#ln -sf /usr/share/java/jstl1.1.jar $(CURDIR)/apps/susidns/src/lib/jstl.jar |
---|
141 | |
---|
142 | @# debian and ubuntu: everywhere |
---|
143 | @/bin/echo -e "with-gettext-base=true" >> $(CURDIR)/override.properties |
---|
144 | @#mkdir -p $(CURDIR)/core/java/build |
---|
145 | ln -sf /usr/share/java/libintl.jar $(CURDIR)/core/java/build/libintl.jar |
---|
146 | |
---|
147 | @# debian and ubuntu: everywhere |
---|
148 | @/bin/echo -e "with-libgetopt-java=true" >> $(CURDIR)/override.properties |
---|
149 | @#mkdir -p $(CURDIR)/core/java/build |
---|
150 | ln -sf /usr/share/java/gnu-getopt.jar $(CURDIR)/core/java/build/gnu-getopt.jar |
---|
151 | |
---|
152 | TZ=UTC JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 ant preppkg-unix javadoc |
---|
153 | echo router.updateDisabled=true > $(I2P)/router.config |
---|
154 | mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper |
---|
155 | |
---|
156 | binary-arch: build-arch |
---|
157 | build-arch: |
---|
158 | # build jbigi |
---|
159 | cd $(CURDIR)/core/c/jbigi && ./build_jbigi.sh dynamic |
---|
160 | # build jcpuid |
---|
161 | cd $(CURDIR)/core/c/jcpuid && ./build.sh |
---|
162 | |
---|
163 | binary: binary-arch binary-indep |
---|
164 | |
---|
165 | createcopyright: |
---|
166 | @echo " *** Creating debian/copyright*** " |
---|
167 | @rm -f $(CURDIR)/debian/copyright |
---|
168 | @/bin/echo -e "This package was Debianized by kytv <killyourtv@i2pmail.org>" >> $(CURDIR)/debian/copyright |
---|
169 | @/bin/echo -e "Sun, 23 Jan 2011 20:26:51 +0000" >> $(CURDIR)/debian/copyright |
---|
170 | @/bin/echo -e "\nIt was downloaded from https://geti2p.net" >> $(CURDIR)/debian/copyright |
---|
171 | @/bin/echo -e "\nI2P is tracked upstream using the Monotone VCS" >> $(CURDIR)/debian/copyright |
---|
172 | @/bin/echo -e "Complete information on fetching the source with monotone can be found" >> $(CURDIR)/debian/copyright |
---|
173 | @/bin/echo -e "at https://geti2p.net/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright |
---|
174 | @/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright |
---|
175 | @/bin/echo -e "\n\n The debian packaging has been released into the public domain." >> $(CURDIR)/debian/copyright |
---|
176 | |
---|
177 | override_dh_compress: |
---|
178 | dh_compress -X.xsl -X.xml |
---|
179 | |
---|
180 | override_dh_install: |
---|
181 | dh_install --list-missing |
---|
182 | dh_apparmor --profile-name=system_i2p -pi2p |
---|
183 | dh_apparmor --profile-name=usr.bin.i2prouter -pi2p |
---|
184 | |
---|
185 | override_dh_installchangelogs: |
---|
186 | dh_installchangelogs history.txt |
---|
187 | |
---|
188 | override_dh_installdocs: |
---|
189 | dh_installdocs -pi2p -plibjbigi-jni --link-doc=i2p-router |
---|
190 | dh_installdocs --remaining-packages |
---|
191 | |
---|
192 | override_dh_dhlibdeps: |
---|
193 | dh_shlibdeps -llibjbigi-jni debian/libjbigi-jni/usr/lib/jni/*.so |
---|
194 | |
---|
195 | #override_dh_installinit: |
---|
196 | # dh_installinit -r |
---|
197 | |
---|
198 | override_dh_builddeb: |
---|
199 | dh_builddeb -- -Zxz |
---|
200 | |
---|
201 | get-orig-source: |
---|
202 | uscan --verbose --rename --destdir $(CURDIR)/.. --watchfile debian/watch --force-download |
---|