Add debconf to inform the user of the necessity of port forwarding.
authorCameron Dale <camrdale@gmail.com>
Thu, 24 Apr 2008 19:05:03 +0000 (12:05 -0700)
committerCameron Dale <camrdale@gmail.com>
Thu, 24 Apr 2008 19:05:03 +0000 (12:05 -0700)
debian/apt-p2p.config [new file with mode: 0644]
debian/apt-p2p.templates [new file with mode: 0644]
debian/control
debian/po/POTFILES.in [new file with mode: 0644]
debian/po/templates.pot [new file with mode: 0644]
debian/postinst
debian/rules

diff --git a/debian/apt-p2p.config b/debian/apt-p2p.config
new file mode 100644 (file)
index 0000000..e6cf838
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+#set -x
+
+# source debconf stuff
+if [ -f /usr/share/debconf/confmodule ]; then
+        . /usr/share/debconf/confmodule
+fi
+
+if [ "$1" = "configure" ]
+then 
+        db_input high apt-p2p/port_forward || true
+        db_go
+fi
diff --git a/debian/apt-p2p.templates b/debian/apt-p2p.templates
new file mode 100644 (file)
index 0000000..db492c9
--- /dev/null
@@ -0,0 +1,17 @@
+Template: apt-p2p/port_forward
+Type: note
+_Description: Port forwarding
+ It is VERY important that Apt-P2P's ports be reachable by other peers.
+ This is needed both to share files with others, and to connect to
+ others through the DHT to find peers for files. If you aren't
+ accessible by others, you will not only not share anything, but your
+ performance during downloading will be affected.
+ .
+ Apt-P2P uses a default port of 9977, over both TCP and UDP, for it's
+ communication. You can change this port in the
+ /etc/apt-p2p/apt-p2p.conf file, and use different ports for TCP and
+ UDP, if desired. Whatever port you use, make sure to forward it
+ through your NAT or firewall to improve your performance and share
+ with others. Information on port forwarding can be found here:
+ .
+ http://portforward.com/
\ No newline at end of file
index 928e9a16230f8ad463984c09d67186554c83376c..c16ad7553f1d8edb2b6be0b109413e708841cb0d 100644 (file)
@@ -5,14 +5,14 @@ Maintainer: Cameron Dale <camrdale@gmail.com>
 Homepage: http://www.camrdale.org/apt-p2p.html
 Standards-Version: 3.7.3
 Build-Depends: debhelper (>= 5.0.37.2)
-Build-Depends-Indep: python-dev, python-support (>= 0.5.4), docbook-to-man, python-debian (>= 0.1.4)
+Build-Depends-Indep: python-dev, python-support (>= 0.5.4), po-debconf, docbook-to-man, python-debian (>= 0.1.4)
 Vcs-Git: git://git.camrdale.org/git/apt-p2p.git
 Vcs-Browser: http://git.camrdale.org/?p=apt-p2p.git;a=summary
 XS-Dm-Upload-Allowed: yes
 
 Package: apt-p2p
 Architecture: all
-Depends: ${python:Depends}, python-twisted-web2 (>= 0.2), adduser, python-debian (>= 0.1.4), python-apt (>= 0.6.20), python-pysqlite2 (>= 2.1)
+Depends: ${python:Depends}, ${misc:Depends}, python-twisted-web2 (>= 0.2), adduser, python-debian (>= 0.1.4), python-apt (>= 0.6.20), python-pysqlite2 (>= 2.1)
 Provides: python-apt-p2p, python-apt-p2p-khashmir
 Description: apt helper for peer-to-peer downloads of Debian packages
  Apt-P2P is a helper for downloading Debian packages files with APT.
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644 (file)
index 0000000..f6b2fa8
--- /dev/null
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] apt-p2p.templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644 (file)
index 0000000..9a0e088
--- /dev/null
@@ -0,0 +1,52 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: apt-p2p@packages.debian.org\n"
+"POT-Creation-Date: 2008-04-24 11:52-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: note
+#. Description
+#: ../apt-p2p.templates:1001
+msgid "Port forwarding"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../apt-p2p.templates:1001
+msgid ""
+"It is VERY important that Apt-P2P's ports be reachable by other peers. This "
+"is needed both to share files with others, and to connect to others through "
+"the DHT to find peers for files. If you aren't accessible by others, you "
+"will not only not share anything, but your performance during downloading "
+"will be affected."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../apt-p2p.templates:1001
+msgid ""
+"Apt-P2P uses a default port of 9977, over both TCP and UDP, for it's "
+"communication. You can change this port in the /etc/apt-p2p/apt-p2p.conf "
+"file, and use different ports for TCP and UDP, if desired. Whatever port you "
+"use, make sure to forward it through your NAT or firewall to improve your "
+"performance and share with others. Information on port forwarding can be "
+"found here:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../apt-p2p.templates:1001
+msgid "http://portforward.com/"
+msgstr ""
index 24147f26f0839f87f74aa23642a9b5ec002c2033..e167c41fc90bbe7b6473d83e6a94d64890f38366 100644 (file)
@@ -5,6 +5,8 @@
 
 set -e
 
+. /usr/share/debconf/confmodule
+
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
 #        * <old-postinst> `abort-upgrade' <new version>
@@ -47,6 +49,9 @@ case "$1" in
     ;;
 esac
 
+# Tell debconf to stop so it doesn't get confused
+db_stop
+
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
 
index 456af9b6c86470caa4541f26cc0dd5d3c7ee1b4e..3adae641452ff9c3adf12f65d20270d772ab9c4a 100755 (executable)
@@ -45,6 +45,7 @@ install: build-stamp
 binary-indep: install
        dh_testdir
        dh_testroot
+       dh_installdebconf
        dh_installdocs
        dh_installman