preliminary debian package support

This sets i2p up as a functional Debian source package. dpkg-buildpackage
will build i2p using ant preppkg (tarball takes too long and not
helpful). It creates a binary .deb archive of the i2p installation,
which when installed goes into /var/lib/i2p as the non-root user i2p,
and adds an /etc/init.d script to start it up.

Some problems not yet solved:
1) under Debian the conf should go into /etc/i2p, but since it doesn't
   things like the eepsite index file get overwritten if you reinstall.
   should check for those somehow and not replace them, or ask the user.
2) under Debian they like it if you split the generated data from the
   static code, so i2p should go into /usr/lib/i2p maybe, but its
   netDB and any other cache files into /var/cache/i2p
   that's important not just for organization, but also /var is often
   on a filesystem optimized for churn. For now just put it in /var/lib
3) i2p is supposedly architecture independant, but it does choose a
   native jbigi library on postinstall, so does that really count
   as architecture independant?
This commit is contained in:
dream
2009-01-30 22:32:52 +00:00
parent 82180592f9
commit 7365ca849f
8 changed files with 123 additions and 0 deletions

54
debian/scripts/init vendored Executable file
View File

@ -0,0 +1,54 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: i2p
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start:
# Default-Stop: 1 2 3 4 5
# Short-Description: I2P anonymizing mixnet
### END INIT INFO
set -e
. /lib/lsb/init-functions
function I2P {
su i2p -c "/var/lib/i2p/i2prouter $1"
}
case "$1" in
start)
log_daemon_msg "Starting I2P" "i2p"
if I2P start; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping I2P" "i2p"
if I2P stop; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
log_daemon_msg "Restarting I2P" "i2p"
if I2P restart; then
log_end_msg 0
else
log_end_msg 1
fi
;;
status)
I2P status
;;
*)
log_action_msg "Usage: /etc/init.d/i2p {start|stop|restart|status}"
exit 1
esac
exit 0