From b87ba4560d51b8c38b7e657578737c64ee99bd1b Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Tue, 20 Mar 2007 21:31:22 +0000 Subject: [PATCH 1/1] [svn-inject] Applying Debian modifications to trunk --- debian/README.Debian | 8 +++ debian/changelog | 6 ++ debian/compat | 1 + debian/config | 26 +++++++ debian/control | 17 +++++ debian/copyright | 28 ++++++++ debian/dirs | 1 + debian/docs | 2 + debian/install | 2 + debian/iodine.iodined.init | 142 +++++++++++++++++++++++++++++++++++++ debian/po/POTFILES.in | 1 + debian/po/templates.pot | 45 ++++++++++++ debian/postinst | 60 ++++++++++++++++ debian/postrm | 41 +++++++++++ debian/rules | 87 +++++++++++++++++++++++ debian/templates | 11 +++ debian/watch | 4 ++ 17 files changed, 482 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/config create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/install create mode 100644 debian/iodine.iodined.init create mode 100644 debian/po/POTFILES.in create mode 100644 debian/po/templates.pot create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100755 debian/rules create mode 100644 debian/templates create mode 100644 debian/watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..5e4f5de --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,8 @@ +iodine for Debian +----------------- + +* Please note that iodine(d) needs the tun kernel module. +* Instruction for setting up the infrastructure (including delegating a new + subdomain) are included in /usr/share/doc/iodine/README. + + -- gregor herrmann Fri, 26 Jan 2007 14:02:26 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..d6c1f9d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +iodine (0.3.4-1) unstable; urgency=low + + * Initial release (closes: #nnnn). + + -- gregor herrmann Fri, 26 Jan 2007 14:03:30 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..df31ec1 --- /dev/null +++ b/debian/config @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +if [ -s /etc/default/iodine ] ; then + . /etc/default/iodine + if [ -n "$START_IODINED" ] ; then + db_set iodine/start_daemon "$START_IODINED" + fi + if [ -n "$IODINED_ARGS" ] ; then + db_set iodine/daemon_options "$DAEMON_IODINED_ARGS" + fi +fi + +db_input medium iodine/start_daemon || true +db_go + +db_get iodine/start_daemon +START_DAEMON=$RET + +if [ "x$START_DAEMON" = "xtrue" ] ; then + db_input medium iodine/daemon_options || true + db_go +fi diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7f1e7ec --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: iodine +Section: net +Priority: extra +Maintainer: gregor herrmann +Build-Depends: debhelper (>= 5), po-debconf, help2man, zlib1g-dev, makedev +Standards-Version: 3.7.2 + +Package: iodine +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: tool for tunneling IPv4 data through a DNS server + This is a piece of software that lets you tunnel IPv4 data through a DNS + server. This can be usable in different situations where internet access is + firewalled, but DNS queries are allowed. + . + Homepage: http://code.kryo.se/iodine + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bdca24f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by gregor herrmann on +Fri, 26 Jan 2007 14:02:26 +0100. + +It was downloaded from http://code.kryo.se/iodine + +Upstream Authors: +Bjorn Andersson , Erik Ekman + +Copyright: +Copyright (c) 2006 Bjorn Andersson , Erik Ekman + + +License: +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + +The Debian packaging is (C) 2007, gregor herrmann and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..236670a --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..724e084 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README +TODO diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..0c21c47 --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +iodine usr/sbin +iodined usr/sbin diff --git a/debian/iodine.iodined.init b/debian/iodine.iodined.init new file mode 100644 index 0000000..d3bc8c8 --- /dev/null +++ b/debian/iodine.iodined.init @@ -0,0 +1,142 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: iodined +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: initscript for iodined +# Description: initscript for iodined +### END INIT INFO + +# Author: gregor herrmann + +# Do NOT "set -e" + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="IP over DNS tunneling server" +NAME=iodined +DAEMON=/usr/sbin/$NAME +DEFAULT=iodine +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file or exit +[ -r /etc/default/$DEFAULT ] || exit 0 +. /etc/default/$DEFAULT + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# Get config +get_config() { + if [ "$START_IODINED" != "true" ] ; then + log_warning_msg "$NAME is not configured to start automatically. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT." + exit 0 + else + if [ -n "$IODINED_ARGS" ] ; then + DAEMON_ARGS=$IODINED_ARGS + else + log_warning_msg "$NAME is not fully configured. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT." + exit 0 + fi + fi +} + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/5/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + get_config + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..cef83a3 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..b2a8212 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,45 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: gregor+debian@comodo.priv.at\n" +"POT-Creation-Date: 2007-01-29 21:08+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../templates:1001 +msgid "Should iodined (server) start on boot?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:1001 +msgid "" +"If you want want iodined to be started at boot time you can set this " +"behaviour here." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Options to iodined (server):" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "" +"You need to give the necessary arguments to iodined; see iodined(8) for " +"help. Example: 10.0.0.1 tunnel.mydomain.example" +msgstr "" diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..eabf817 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,60 @@ +#!/bin/sh +# postinst script for iodine +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + # we need a tun device + if [ ! -e /dev/net/tun ] ; then + echo "Creating device /dev/net/tun ..." + cd /dev && WRITE_ON_UDEV=false ./MAKEDEV tun + fi + # generate /etc/default/iodine + db_get iodine/start_daemon + START_IODINED=$RET + db_get iodine/daemon_options + IODINED_ARGS=$RET + cat < /etc/default/iodine +# Default settings for iodine. This file is sourced from +# /etc/init.d/iodined +START_IODINED="$START_IODINED" +IODINED_ARGS="$IODINED_ARGS" +EOF + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +# tell debconf we are done. otherwise, it hangs waiting for the daemon. +db_stop; + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..b33bb2a --- /dev/null +++ b/debian/postrm @@ -0,0 +1,41 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + purge) + [ -f /etc/default/iodine ] && rm /etc/default/iodine + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..1d8c4d8 --- /dev/null +++ b/debian/rules @@ -0,0 +1,87 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) + help2man ./iodine --name="IP over DNS tunneling client" --section=8 --source=iodine --no-info --help-option=-h --version-option=-v --output=debian/iodine.8 + help2man ./iodined --name="IP over DNS tunneling server" --section=8 --source=iodined --no-info --help-option=-h --version-option=-v --output=debian/iodined.8 + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + dh_clean debian/iodine.8 debian/iodined.8 + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs CHANGELOG + dh_installdocs +# dh_installexamples + dh_install +# dh_installmenu + dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python + dh_installinit --name=iodine + dh_installinit --name=iodined +# dh_installcron +# dh_installinfo + dh_installman debian/iodine.8 debian/iodined.8 + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..c46ffb9 --- /dev/null +++ b/debian/templates @@ -0,0 +1,11 @@ +Template: iodine/start_daemon +Type: boolean +Default: false +_Description: Should iodined (server) start on boot? + If you want want iodined to be started at boot time you can set this behaviour here. + +Template: iodine/daemon_options +Type: string +_Description: Options to iodined (server): + You need to give the necessary arguments to iodined; see iodined(8) for help. + Example: 10.0.0.1 tunnel.mydomain.example diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..896830b --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +# Compulsory line, this is a version 3 file +version=3 + +http://code.kryo.se/iodine iodine-([\d\.]+)\.tar\.gz -- 2.30.2