From 164f060a40d424da96af92ec5c5c2b7ccee92db1 Mon Sep 17 00:00:00 2001
From: kytv <kytv@mail.i2p>
Date: Fri, 27 May 2011 09:33:20 +0000
Subject: [PATCH] Debian: Creating a new fourth package by splitting the i2p
 package in two

 This commit splits the i2p package into a second package, i2p-router.
   * The new 'i2p-router' package does not depend on the java-wrapper nor jbigi.
     Jbigi is recommended. This package can be installed on the ports or
     distributions that the java-wrapper is not available for.
   * The new 'i2p' package depends on i2p-router, libjbigi-jni, and the java-wrapper.
     This package will add the i2psvc system user and the initscript. Existing
     users of the i2p package will have the i2p-router package pulled in
     automatically and for them there will be no usability changes.

 Executive summary: No functionality changes will take place for either those
		    that installed the i2p package in the past or those that
		    install the newly split i2p package. For them, "The Song
                    Remains the Same."
---
 debian/NEWS                                  |  9 ++--
 debian/changelog                             | 17 +++++---
 debian/control                               | 45 +++++++++++++++-----
 debian/i2p-doc.preinst                       | 11 +++++
 debian/{i2p.docs => i2p-router.docs}         |  0
 debian/{i2p.examples => i2p-router.examples} |  0
 debian/i2p-router.install                    | 16 +++++++
 debian/i2p-router.links                      |  4 ++
 debian/i2p-router.manpages                   |  1 +
 debian/i2p.install                           | 17 +-------
 debian/i2p.links                             |  9 ++--
 debian/i2p.manpages                          |  2 +-
 debian/i2p.preinst                           | 10 +++++
 debian/libjbigi-jni.preinst                  |  2 +-
 debian/rules                                 |  2 +-
 15 files changed, 101 insertions(+), 44 deletions(-)
 create mode 100644 debian/i2p-doc.preinst
 rename debian/{i2p.docs => i2p-router.docs} (100%)
 rename debian/{i2p.examples => i2p-router.examples} (100%)
 create mode 100644 debian/i2p-router.install
 create mode 100644 debian/i2p-router.links
 create mode 100644 debian/i2p-router.manpages
 create mode 100644 debian/i2p.preinst

diff --git a/debian/NEWS b/debian/NEWS
index c738572d52..38e309017a 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,9 +1,12 @@
-i2p (0.8.6-5) UNRELEASED; urgency=low
+i2p (0.8.6-5) stable; urgency=low
 
   The file /etc/i2p/wrapper.service is no longer shipped in this package.
   Instead the file /etc/i2p/wrapper.config is used with the changes that used to
   be in wrapper.service have been moved to the initscript. If you have changed
   the amount of memory set aside for I2P, you'll need to make that change to
-  /etc/i2p/wrapper.config.
+  /etc/i2p/wrapper.config. 
+ 
+  The I2P router is now split into four different packages: i2p, i2p-doc,
+  i2p-router, and libjbigi.
 
- -- Kill Your TV <killyourtv@i2pmail.org>  Wed, 25 May 2011 22:17:05 +0000
+ -- Kill Your TV <killyourtv@i2pmail.org>  Wed, 25 May 2011 20:46:49 +0000
diff --git a/debian/changelog b/debian/changelog
index 5b776bdeed..e9fa8e1a5b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,15 @@
-i2p (0.8.6-5) UNRELEASED; urgency=low
+i2p (0.8.6-5) stable; urgency=low
 
-  * Remove /etc/i2p/wrapper.service and add the changed configs to the
+  * Remove /etc/i2p/wrapper.service. Changes have been moved to the
     initscript.
-  * Create debian/copyright at build time.
-  * Don't ship the standalone jetty-i2psnark.
-
- -- Kill Your TV <killyourtv@i2pmail.org>  Wed, 25 May 2011 21:11:40 +0000
-
+  * Don't disable browser launch. This is handled automatically for the i2psvc
+    user.
+  * Create debian/copyright dynamically at build time
+  * Don't ship the standalone jetty-i2psnark
+  * Create split package so that the wrapper isn't required
+  * Install missing certificates directory
+
+ -- Kill Your TV <killyourtv@i2pmail.org>  Fri, 27 May 2011 03:48:56 +0000
 
 i2p (0.8.6-4) stable; urgency=low
 
diff --git a/debian/control b/debian/control
index 2c3ea6a2eb..c5399dd2c6 100644
--- a/debian/control
+++ b/debian/control
@@ -1,6 +1,5 @@
 Source: i2p
 Maintainer: Kill Your TV <killyourtv@i2pmail.org>
-Uploaders: zzz <zzz@i2pmail.org>
 Section: net
 Standards-Version: 3.9.2
 Priority: optional
@@ -20,25 +19,19 @@ Section: net
 Priority: optional
 Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends}, default-jre | java5-runtime | java6-runtime,
  adduser, 
+ i2p-router (>= 0.8.6-5),
  libjbigi-jni (>= ${source:Version}),
  libjbigi-jni (<< ${source:Version}.1~),
  lsb-base (>= 3.2-14), 
  service-wrapper 
-Suggests: tor, 
- i2pfox, 
- mail-client, 
- mail-reader, 
- news-reader, 
- polipo, 
- privoxy, 
- syndie,
- www-browser, 
- xul-ext-torbutton 
 Description: Load-balanced unspoofable packet switching network
  I2P is an anonymizing network, offering a simple layer that identity-sensitive
  applications can use to securely communicate. All data is wrapped with several
  layers of encryption, and the network is both distributed and dynamic, with no
  trusted parties.
+ .
+ This package depends on the router, jbigi, the java service wrapper, and
+ includes support to run I2P as a daemon.
 
 Package: libjbigi-jni
 Architecture: any
@@ -66,3 +59,33 @@ Description: Documentation for I2P
  trusted parties. 
  .
  This package contains the Javadoc files.
+
+Package: i2p-router
+Architecture: all
+Section: net
+Priority: optional
+Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends}, default-jre | java5-runtime | java6-runtime
+Replaces: i2p ( << 0.8.6-5)
+Breaks: i2p (<< 0.8.6-5)
+Recommends: libjbigi-jni (>= ${source:Version}), libjbigi-jni (<< ${source:Version}.1~)
+Suggests: tor,
+ i2p-messenger,
+ i2p-tahoe-lafs,
+ imule,
+ i2pfox,
+ irc-client,
+ jircii,
+ mail-client,
+ mail-reader,
+ news-reader,
+ polipo,
+ privoxy,
+ robert,
+ syndie,
+ www-browser,
+ xul-ext-torbutton
+Description: Load-balanced unspoofable packet switching network
+ I2P is an anonymizing network, offering a simple layer that identity-sensitive
+ applications can use to securely communicate. All data is wrapped with several
+ layers of encryption, and the network is both distributed and dynamic, with no
+ trusted parties.
diff --git a/debian/i2p-doc.preinst b/debian/i2p-doc.preinst
new file mode 100644
index 0000000000..8ab8fef765
--- /dev/null
+++ b/debian/i2p-doc.preinst
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+exit 0
+
+if [ ! -z $2 ]; then
+        if dpkg --compare-versions $2 lt 0.8.6-5; then
+                test -d /usr/share/doc/i2p-doc \
+                        && rm -rf /usr/share/doc/i2p-doc
+        fi
+fi
+
+#DEBHELPER# 
diff --git a/debian/i2p.docs b/debian/i2p-router.docs
similarity index 100%
rename from debian/i2p.docs
rename to debian/i2p-router.docs
diff --git a/debian/i2p.examples b/debian/i2p-router.examples
similarity index 100%
rename from debian/i2p.examples
rename to debian/i2p-router.examples
diff --git a/debian/i2p-router.install b/debian/i2p-router.install
new file mode 100644
index 0000000000..9d2f2fb142
--- /dev/null
+++ b/debian/i2p-router.install
@@ -0,0 +1,16 @@
+history.txt usr/share/i2p
+pkg-temp/blocklist.txt usr/share/i2p
+pkg-temp/certificates usr/share/i2p
+pkg-temp/clients.config usr/share/i2p
+pkg-temp/docs usr/share/i2p/
+pkg-temp/eepget usr/bin
+pkg-temp/eepsite usr/share/i2p
+pkg-temp/geoip usr/share/i2p
+pkg-temp/hosts.txt usr/share/i2p
+pkg-temp/i2prouter-nowrapper usr/bin
+pkg-temp/i2psnark.config usr/share/i2p
+pkg-temp/i2ptunnel.config usr/share/i2p
+pkg-temp/lib/*.jar usr/share/i2p/lib
+pkg-temp/systray.config usr/share/i2p
+pkg-temp/webapps usr/share/i2p
+pkg-temp/*.xml usr/share/i2p
diff --git a/debian/i2p-router.links b/debian/i2p-router.links
new file mode 100644
index 0000000000..9c79676e9b
--- /dev/null
+++ b/debian/i2p-router.links
@@ -0,0 +1,4 @@
+usr/share/common-licenses/GPL-2 usr/share/doc/i2p-router/licenses/LICENSE-GPLv2.txt
+usr/share/common-licenses/LGPL-2.1 usr/share/doc/i2p-router/licenses/LICENSE-LGPLv2.1.txt
+usr/share/common-licenses/Apache-2.0 usr/share/doc/i2p-router/licenses/LICENSE-Apache2.0.txt
+usr/share/common-licenses/BSD usr/share/doc/i2p-router/licenses/LICENSE-BSD.txt
diff --git a/debian/i2p-router.manpages b/debian/i2p-router.manpages
new file mode 100644
index 0000000000..bae35bfd8e
--- /dev/null
+++ b/debian/i2p-router.manpages
@@ -0,0 +1 @@
+installer/resources/man/eepget.1
diff --git a/debian/i2p.install b/debian/i2p.install
index ac077e0370..c87e3e1f01 100644
--- a/debian/i2p.install
+++ b/debian/i2p.install
@@ -1,17 +1,2 @@
-history.txt usr/share/i2p
-pkg-temp/blocklist.txt usr/share/i2p
-pkg-temp/certificates usr/share/i2p
-pkg-temp/clients.config usr/share/i2p
-pkg-temp/docs usr/share/i2p/
-pkg-temp/eepget usr/bin
-pkg-temp/eepsite usr/share/i2p
-pkg-temp/geoip usr/share/i2p
-pkg-temp/hosts.txt usr/share/i2p
-pkg-temp/i2prouter* usr/bin
-pkg-temp/i2psnark.config usr/share/i2p
-pkg-temp/i2ptunnel.config usr/share/i2p
-pkg-temp/lib/*.jar usr/share/i2p/lib
-pkg-temp/systray.config usr/share/i2p
-pkg-temp/webapps usr/share/i2p
+pkg-temp/i2prouter usr/bin
 pkg-temp/wrapper.config etc/i2p
-pkg-temp/*.xml usr/share/i2p
diff --git a/debian/i2p.links b/debian/i2p.links
index bc5032c7dc..cc79aa1bd7 100644
--- a/debian/i2p.links
+++ b/debian/i2p.links
@@ -1,10 +1,11 @@
-usr/share/common-licenses/GPL-2 usr/share/doc/i2p/licenses/LICENSE-GPLv2.txt
-usr/share/common-licenses/LGPL-2.1 usr/share/doc/i2p/licenses/LICENSE-LGPLv2.1.txt
-usr/share/common-licenses/Apache-2.0 usr/share/doc/i2p/licenses/LICENSE-Apache2.0.txt
-usr/share/common-licenses/BSD usr/share/doc/i2p/licenses/LICENSE-BSD.txt
 var/lib/i2p/i2p-config/blocklist.txt etc/i2p/blocklist.txt
+var/lib/i2p/i2p-config/bob.config etc/i2p/bob.config
 var/lib/i2p/i2p-config/clients.config etc/i2p/clients.config
 var/lib/i2p/i2p-config/hosts.txt etc/i2p/hosts.txt
 var/lib/i2p/i2p-config/i2psnark.config etc/i2p/i2psnark.config
 var/lib/i2p/i2p-config/i2ptunnel.config etc/i2p/i2ptunnel.config
+var/lib/i2p/i2p-config/eepsite/jetty.xml etc/i2p/jetty.xml
+var/lib/i2p/i2p-config/plugins.config etc/i2p/plugins.config
+var/lib/i2p/i2p-config/router.config etc/i2p/router.config
 var/lib/i2p/i2p-config/systray.config etc/i2p/systray.config
+var/lib/i2p/i2p-config/webapps.config etc/i2p/webapps.config
diff --git a/debian/i2p.manpages b/debian/i2p.manpages
index f2cce18012..923744b892 100644
--- a/debian/i2p.manpages
+++ b/debian/i2p.manpages
@@ -1 +1 @@
-installer/resources/man/*.1
+installer/resources/man/i2prouter.1
diff --git a/debian/i2p.preinst b/debian/i2p.preinst
new file mode 100644
index 0000000000..5a31f41950
--- /dev/null
+++ b/debian/i2p.preinst
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+if [ ! -z $2 ]; then
+	if dpkg --compare-versions $2 lt 0.8.6-5; then
+		test -d /usr/share/doc/i2p  \
+			&& rm -rf /usr/share/doc/i2p
+	fi
+fi
+
+#DEBHELPER# 
diff --git a/debian/libjbigi-jni.preinst b/debian/libjbigi-jni.preinst
index 464371ac87..ea267357d1 100644
--- a/debian/libjbigi-jni.preinst
+++ b/debian/libjbigi-jni.preinst
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 if [ ! -z $2 ]; then
-	if dpkg --compare-versions $2 lt 0.8.6-4; then
+	if dpkg --compare-versions $2 lt 0.8.6-5; then
 		test -d /usr/share/doc/libjbigi-jni  \
 			&& rm -rf /usr/share/doc/libjbigi-jni
 	fi
diff --git a/debian/rules b/debian/rules
index 7d81011448..4f454698d2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,7 +85,7 @@ override_dh_installchangelogs:
 	dh_installchangelogs history.txt
 
 override_dh_installdocs:
-	dh_installdocs -plibjbigi-jni --link-doc=i2p
+	dh_installdocs -pi2p -plibjbigi-jni --link-doc=i2p-router
 	dh_installdocs --remaining-packages
 
 override_dh_dhlibdeps:
-- 
GitLab