Debian packaging. 1.0.0
authorMark Wooding <mdw@distorted.org.uk>
Sun, 21 Oct 2012 15:25:53 +0000 (16:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 26 Oct 2012 23:16:38 +0000 (00:16 +0100)
Makefile.am
debian/.gitignore [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/yaid.init [new file with mode: 0644]
debian/yaid.install [new file with mode: 0644]
debian/yaid.policy [new file with mode: 0644]

index df95ec2..732aaea 100644 (file)
@@ -81,9 +81,9 @@ EXTRA_DIST            += config/auto-version
 ### Debian.
 
 ## General stuff.
-##EXTRA_DIST           += debian/rules
-##EXTRA_DIST           += debian/control
-##EXTRA_DIST           += debian/changelog
-##EXTRA_DIST           += debian/copyright
+EXTRA_DIST             += debian/control debian/copyright debian/changelog
+EXTRA_DIST             += debian/rules debian/compat
+EXTRA_DIST             += debian/yaid.install debian/yaid.init
+EXTRA_DIST             += debian/yaid.policy
 
 ###----- That's all, folks --------------------------------------------------
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644 (file)
index 0000000..a5c60b6
--- /dev/null
@@ -0,0 +1,5 @@
+yaid/
+files
+*.debhelper
+*.log
+*.substvars
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..689edb8
--- /dev/null
@@ -0,0 +1,6 @@
+yaid (1.0.0) experimental; urgency=low
+
+  * Initial version.
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Sun, 21 Oct 2012 15:23:43 +0100
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..9a87bb0
--- /dev/null
@@ -0,0 +1,25 @@
+Source: yaid
+Section: net
+Priority: extra
+Maintainer: Mark Wooding <mdw@distorted.org.uk>
+Build-Depends: mlib-dev (>= 2.0.4), debhelper (>= 8),
+Standards-Version: 3.1.1
+
+Package: yaid
+Architecture: any
+Depends: ${shlibs:Depends}
+Provides: ident-server
+Conflicts: ident-server
+Description: Yet Another Ident Daemon: with NAT traversal and policy controls
+ The world doesn't need or want another ident server.  But it did want one
+ with the right combination of features, so here it is.
+ .
+ YAID handles NAT usefully.  On a NAT gateway, it will forward requests to
+ client hosts as necessary.  On a client host, it will respond to forwarded
+ requests.
+ .
+ YAID has policy controls.  A global file can decide how to reply to
+ particular kinds of query based on source and destination addresses and port
+ numbers, or on the user identified.  It can delegate the decision to the
+ user in question, in a controlled way.  It can anonymize the response in
+ various ways, keeping track of the real answer in its log.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..d3529f8
--- /dev/null
@@ -0,0 +1,16 @@
+YAID is copyright (c) 2012 Straylight/Edgeware.
+
+YAID is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+YAID is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have a copy of the GNU General Public License in
+/usr/share/common-licenses/GPL; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..fba2378
--- /dev/null
@@ -0,0 +1,3 @@
+#! /usr/bin/make -f
+
+%:; dh $@ -Bdebian/build --parallel
diff --git a/debian/yaid.init b/debian/yaid.init
new file mode 100644 (file)
index 0000000..e04cc70
--- /dev/null
@@ -0,0 +1,91 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          yaid ident-server
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Yet another ident daemon
+# Description:       This file starts and stops YAID
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Yet another ident daemon"
+NAME=yaid
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+DAEMON_ARGS="-Dl -P$PIDFILE -Unobody -Gnogroup"
+SCRIPTNAME=/etc/init.d/$NAME
+
+[ -x "$DAEMON" ] || exit 0
+
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+
+do_start()
+{
+       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
+}
+
+do_stop()
+{
+       start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+       RETVAL="$?"
+       [ "$RETVAL" = 2 ] && return 2
+       start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+       [ "$?" = 2 ] && return 2
+       rm -f $PIDFILE
+       return "$RETVAL"
+}
+
+case "$1" in
+  start)
+       [ "$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
+       ;;
+  status)
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+       ;;
+  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|status|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/debian/yaid.install b/debian/yaid.install
new file mode 100644 (file)
index 0000000..a5d8b19
--- /dev/null
@@ -0,0 +1 @@
+debian/yaid.policy                             etc
diff --git a/debian/yaid.policy b/debian/yaid.policy
new file mode 100644 (file)
index 0000000..311c107
--- /dev/null
@@ -0,0 +1,18 @@
+### -*-conf-*-
+###
+### Example policy file for YAID.
+
+## LOCAL-ADDR  LPORT   REMOTE-ADDR     RPORT   USER    ACTION
+
+## Astonishingly, ident can actually provide useful authentication on
+## loopback connections, so provide honest information.
+127.0.0.0/8    *       127.0.0.0/8     *       *       name
+::             *       ::              *       *       name
+
+## Reveal users' identity to queries from the local network.
+*              *       172.16.0.0/12   *       *       name
+
+## Provide privacy for users by default, but allow them to override if they
+## want.
+*              *       *               *       *       user name token
+*              *       *               *       *       token