diff --git a/build.xml b/build.xml
index f107f89d34..73e0dd64e8 100644
--- a/build.xml
+++ b/build.xml
@@ -933,6 +933,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/debian/control b/debian/control
index 7e7f8a31ff..5dec48ea31 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Homepage: http://www.i2p2.de/
Build-Depends: sun-java6-jdk | openjdk-6-jdk | default-jdk | java-sdk, ant, fakeroot, gettext
Package: i2p
-Architecture: all
+Architecture: i386 amd64
Section: net
Priority: optional
Depends: libc6, sun-java6-jre | default-jre | java-runtime
diff --git a/debian/makerepo.sh b/debian/makerepo.sh
index 8363abf978..64d6969660 100755
--- a/debian/makerepo.sh
+++ b/debian/makerepo.sh
@@ -28,8 +28,8 @@ echo "SignWith: ${SIGNER}" >> ${CONFFILE}
# create the repository
echo Building the repository...
-reprepro --ask-passphrase --outdir ${DIR} includedeb all ../../i2p_*.deb
-reprepro --ask-passphrase --outdir ${DIR} include all ../../i2p_*.changes
+find ../.. -name i2p_*.deb -maxdepth 1 -exec reprepro --ask-passphrase --outdir ${DIR} includedeb all {} \;
+find ../.. -name i2p_*.changes -maxdepth 1 -exec reprepro --ask-passphrase --outdir ${DIR} include all {} \;
# export the public key
gpg --armor --export ${SIGNER} > ${DIR}/0x${KEYID}.asc
diff --git a/debian/rules b/debian/rules
index e380e2ed1e..c027f3fec1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,30 +3,50 @@
VERSION=`grep String\ VERSION core/java/src/net/i2p/CoreVersion.java | cut -d\" -f2`
SOURCEURL=http://mirror.i2p2.de/i2psource_${VERSION}.tar.bz2
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+ifeq ($(DEB_HOST_ARCH),i386)
+wrapperpath = installer/lib/wrapper/linux
+else ifeq ($(DEB_HOST_ARCH),amd64)
+wrapperpath = installer/lib/wrapper/linux64
+# other architectures could be supported by using runplain.sh
+endif
+
build:
+ echo Target Architecture is $(DEB_HOST_ARCH)
+ifndef wrapperpath
+ @echo "Architecture not supported: $(DEB_HOST_ARCH)"
+ exit 1
+endif
ant preppkg-linux-only
mkdir -p debian/tmp/usr/lib
mkdir -p debian/tmp/etc/init.d
cp -a debian/scripts/init debian/tmp/etc/init.d/i2p
cp -a pkg-temp debian/tmp/usr/lib/i2p
- chmod +x debian/tmp/usr/lib/i2p/postinstall.sh
sed 's|$$INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/wrapper.config > debian/tmp/usr/lib/i2p/a
sed 's|$$SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/wrapper.config
mkdir -p debian/tmp/usr/bin
sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/eepget > debian/tmp/usr/lib/i2p/a
mv debian/tmp/usr/lib/i2p/a debian/tmp/usr/lib/i2p/eepget
ln -s /usr/lib/i2p/eepget debian/tmp/usr/bin/eepget
+ chmod +x debian/tmp/usr/lib/i2p/eepget
sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/runplain.sh > debian/tmp/usr/lib/i2p/a
sed 's|%SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/runplain.sh
sed 's|%INSTALL_PATH|/usr/lib/i2p|g' debian/tmp/usr/lib/i2p/i2prouter > debian/tmp/usr/lib/i2p/a
sed 's|%SYSTEM_java_io_tmpdir|/tmp|g' debian/tmp/usr/lib/i2p/a > debian/tmp/usr/lib/i2p/i2prouter
ln -s /usr/lib/i2p/i2prouter debian/tmp/usr/bin/i2prouter
+ chmod +x debian/tmp/usr/lib/i2p/i2prouter
rm debian/tmp/usr/lib/i2p/a
touch debian/build
mkdir -p debian/tmp/usr/share/doc/i2p
+
+ @# copy wrapper files
+ cp ${wrapperpath}/libwrapper.so debian/tmp/usr/lib/i2p/lib/
+ cp ${wrapperpath}/wrapper.jar debian/tmp/usr/lib/i2p/lib/
+ cp ${wrapperpath}/i2psvc debian/tmp/usr/lib/i2p/
+ chmod +x debian/tmp/usr/lib/i2p/i2psvc
- # Create the Debian copyright file, move the licenses dir,
- # and delete all license files that are already in /usr/share/common-licenses/
+ @# Create the Debian copyright file, move the licenses dir,
+ @# and delete all license files that are already in /usr/share/common-licenses/
cat debian/copyright.part1 LICENSE.txt > debian/tmp/usr/share/doc/i2p/copyright
mv debian/tmp/usr/lib/i2p/licenses debian/tmp/usr/share/doc/i2p
rm debian/tmp/usr/lib/i2p/LICENSE.txt
@@ -34,7 +54,7 @@ build:
rm debian/tmp/usr/share/doc/i2p/licenses/LICENSE-GPLv2.txt
rm debian/tmp/usr/share/doc/i2p/licenses/LICENSE-LGPLv2.1.txt
- # changelog
+ @# changelog
gzip -9c history.txt > debian/tmp/usr/share/doc/i2p/changelog.gz
gzip -9c debian/changelog > debian/tmp/usr/share/doc/i2p/changelog.Debian.gz
diff --git a/debian/scripts/postinst b/debian/scripts/postinst
index 6d76f2f0cf..75c8550889 100755
--- a/debian/scripts/postinst
+++ b/debian/scripts/postinst
@@ -10,11 +10,4 @@ chown $I2PUSER:$I2PUSER $SVCHOME
update-rc.d i2p defaults
-cd $I2P
-su $I2PUSER ./postinstall.sh
-
-chmod 755 /usr/lib/i2p/eepget
-chmod 755 /usr/lib/i2p/i2prouter
-chmod 755 /usr/lib/i2p/i2psvc
-
invoke-rc.d i2p start
diff --git a/debian/scripts/prerm b/debian/scripts/prerm
index 7fe9471218..647f3ef353 100755
--- a/debian/scripts/prerm
+++ b/debian/scripts/prerm
@@ -7,10 +7,7 @@ rm -f /tmp/wrapper.log /tmp/wrapper.log.1 /tmp/wrapper.log.2 /tmp/i2p.pid /tmp/r
# /etc/rc*.d/*i2p files
update-rc.d -f i2p remove
-# dpkg doesn't know about these files, created by postinstall.sh
-I2P=/usr/lib/i2p
-rm -f $I2P/i2psvc $I2P/lib/libwrapper.so $I2P/lib/wrapper.jar
-# copied out of jbigi.jar by the router
+# dpkg doesn't know about these files, they were copied out of jbigi.jar by the router
rm -f $I2P/libjbigi.so $I2P/libjcpuid.so
# the home directory for the i2p daemon