Debian: Add runtime dependency on libhttpclient-java,

link to /usr/share/java/httpclient.jar and httpcore.jar.
This is 2 MB of dependencies to replace 20 KB of copied code,
so may not be worth it, esp. for Tails.
This commit is contained in:
zzz
2016-04-30 18:08:50 +00:00
parent 30ecdedf1f
commit 2fe1f97ee0
7 changed files with 33 additions and 3 deletions

View File

@ -131,5 +131,7 @@ javac.version=1.6
#with-libjstl1.1-java=true
# Don't compile GettextResource.java, we will use libintl.jar from the gettext-base package
#with-gettext-base=true
# Don't compile gnu/getopt classes, we will use libgetopt-java package
# Don't compile gnu.getopt classes, we will use libgetopt-java package
#with-libgetopt-java=true
# Don't compile org.apache.http classes, we will use libhttpclient-java and libhttpcore-java packages
#with-libhttpclient-java=true

View File

@ -2031,6 +2031,8 @@
<fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
<!-- libgetopt-java -->
<fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
<!-- libhttpclient-java and libhttpcore-java -->
<fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
<!-- systray4j -->
<fileset dir="../i2p-${Extended.Version}/apps/systray/java/lib" />
<file name="../i2p-${Extended.Version}/apps/systray/java/src/net/i2p/apps/systray/SysTrayImpl.java" />
@ -2101,6 +2103,7 @@
<fileset dir="../i2p-${Extended.Version}/_MTN" />
<fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
<fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
<fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
<fileset dir="../i2p-${Extended.Version}/apps/systray/java/lib" />
<file name="../i2p-${Extended.Version}/apps/systray/java/src/net/i2p/apps/systray/SysTrayImpl.java" />
<file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />

View File

@ -38,7 +38,14 @@
<condition property="translation.includes" value="NOTHING" else="gnu/getopt/*.properties" >
<istrue value="${with-libgetopt-java}" />
</condition>
<property name="javac.classpath.mod" value="${javac.classpath.mod1}${javac.classpath.mod2}${javac.classpath}" />
<!-- fixups if we're using httpclient.jar and httpcore.jar for org.apache.http classes -->
<condition property="source.exclude3" value="org/apache/http/**" else="NOTHING" >
<istrue value="${with-libhttpclient-java}" />
</condition>
<condition property="javac.classpath.mod3" value="build/httpclient.jar:build/httpcore.jar:" else="" >
<istrue value="${with-libhttpclient-java}" />
</condition>
<property name="javac.classpath.mod" value="${javac.classpath.mod1}${javac.classpath.mod2}${javac.classpath.mod3}${javac.classpath}" />
<target name="compile" depends="depend">
<mkdir dir="./build" />
@ -52,6 +59,7 @@
<include name="**/*.java" />
<exclude name="${source.exclude1}" />
<exclude name="${source.exclude2}" />
<exclude name="${source.exclude3}" />
</javac>
</target>

2
debian/control vendored
View File

@ -15,6 +15,7 @@ Build-Depends: debhelper (>= 7.0.50~)
,dh-apparmor
,gettext
,libgetopt-java
,libhttpclient-java, libhttpcore-java
,libgmp-dev (>= 2:5.0.5)
,libservice-wrapper-java
,hardening-wrapper
@ -78,6 +79,7 @@ Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends},
geoip-database,
gettext-base,
libgetopt-java,
libhttpclient-java, libhttpcore-java,
libjetty8-java, libservlet3.0-java,
glassfish-javaee
Replaces: i2p ( << 0.8.6-5)

View File

@ -89,3 +89,9 @@ usr/share/java/libintl.jar usr/share/i2p/lib/libintl.jar
# comment out if not building with libgetopt-java
# ubuntu and debian: everywhere
usr/share/java/gnu-getopt.jar usr/share/i2p/lib/gnu-getopt.jar
# comment out if not building with libhttpclient-java and libhttpcore-java
# ubuntu and debian: everywhere
usr/share/java/httpclient.jar usr/share/i2p/lib/httpclient.jar
usr/share/java/httpcore.jar usr/share/i2p/lib/httpcore.jar

6
debian/rules vendored
View File

@ -149,6 +149,12 @@ endif
@mkdir -p $(CURDIR)/core/java/build
ln -sf /usr/share/java/gnu-getopt.jar $(CURDIR)/core/java/build/gnu-getopt.jar
@# debian and ubuntu: everywhere
@/bin/echo -e "with-libhttpclient-java=true" >> $(CURDIR)/override.properties
@mkdir -p $(CURDIR)/core/java/build
ln -sf /usr/share/java/httpclient.jar $(CURDIR)/core/java/build/httpclient.jar
ln -sf /usr/share/java/httpcore.jar $(CURDIR)/core/java/build/httpcore.jar
TZ=UTC JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 ant preppkg-unix javadoc
echo router.updateDisabled=true > $(I2P)/router.config
mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper

View File

@ -16,6 +16,9 @@
<!-- Depend on classes instead of jars where available -->
<classpath>
<pathelement location="../../core/java/build/obj" />
<pathelement location="../../core/java/build/gnu-getopt.jar" />
<pathelement location="../../core/java/build/httpclient.jar" />
<pathelement location="../../core/java/build/httpcore.jar" />
</classpath>
</depend>
</target>
@ -38,7 +41,7 @@
<javac srcdir="./src" debug="true" source="${javac.version}" target="${javac.version}" deprecation="on"
debuglevel="lines,vars,source"
includeAntRuntime="false"
destdir="./build/obj" classpath="../../core/java/build/obj:../../core/java/build/i2p.jar:../../core/java/build/gnu-getopt.jar" >
destdir="./build/obj" classpath="../../core/java/build/obj:../../core/java/build/i2p.jar:../../core/java/build/gnu-getopt.jar:../../core/java/build/httpclient.jar:../../core/java/build/httpcore.jar" >
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>