--- bip-0.6.1.orig/debian/control
+++ bip-0.6.1/debian/control
@@ -0,0 +1,16 @@
+Source: bip
+Section: net
+Priority: optional
+Maintainer: Arnaud Cornet <acornet@debian.org>
+Standards-Version: 3.7.2
+Build-Depends: cdbs, debhelper (>= 5.0.37.2), bison, flex, libssl-dev
+
+Package: bip
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6)
+Description: multiuser irc proxy with conversation replay and more
+ Bip is a IRC proxy that supports replaying logged conversation when a client
+ connects, multiple clients on one irc server connection, It has a handy
+ logging directory structure. It is multiuser, and has a flexible
+ configuration. Some of its configuration can be changed at runtime with
+ special irc commands.
--- bip-0.6.1.orig/debian/bip.default
+++ bip-0.6.1/debian/bip.default
@@ -0,0 +1,2 @@
+# Set ENABLED to 1 if you want the init script to start bip.
+ENABLED=0
--- bip-0.6.1.orig/debian/rules
+++ bip-0.6.1/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+
+# We don't want bip to be restarted automatically because it kills active
+# connections on servers.
+DEB_DH_INSTALLINIT_ARGS:=--no-restart-on-upgrade --no-start
+
+DEB_CONFIGURE_EXTRA_FLAGS:=--enable-oidentd
+
+install/bip::
+	mkdir -p debian/bip/etc
+	cp debian/bip.conf debian/bip/etc
+
+clean::
+	rm -f src/conf.c src/conf.h src/lex.c
--- bip-0.6.1.orig/debian/watch
+++ bip-0.6.1/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://bip.berlios.de/download.html .*bip-(.*).tar.gz
--- bip-0.6.1.orig/debian/changelog
+++ bip-0.6.1/debian/changelog
@@ -0,0 +1,98 @@
+bip (0.6.1-1~bpo40+1) etch-backports; urgency=low
+
+  * Backport to etch.
+
+ -- Josselin Mouette <joss@debian.org>  Wed, 12 Sep 2007 14:07:12 +0200
+
+bip (0.6.1-1) unstable; urgency=low
+
+  * New Upstream Version.
+  * Change my mail address.
+
+ -- Arnaud Cornet <acornet@debian.org>  Sun, 19 Aug 2007 18:55:55 +0200
+
+bip (0.6.0-2) unstable; urgency=low
+
+  * Cleanup sample conf file.
+  * Indent init script.
+  * Remove pidfile check from init script because start-stop-daemon does
+    it already.
+  * Add --no-start to dh_installinit, to avoid breaking upgrades
+    (Closes: #427426).
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Mon, 04 Jun 2007 19:51:45 +0200
+
+bip (0.6.0-1) unstable; urgency=low
+
+  * Fix typo (Closes: 416074).
+  * Fix some output of the init script (Closes: 416075).
+  * Remove useless call to update-rc.d (Closes: 416073).
+  * New upstream release (Closes: 412888, 390716).
+  * Remove patches/bip_home_arg.diff and patches/ssl_cert_path.diff gone
+    upstream.
+  * Add a README.Debian (Closes: 418633).
+  * Sanitize clean rule.
+  * Fix watchfile to use .gz files.
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Tue, 01 May 2007 12:40:23 +0200
+
+bip (0.5.3-4) unstable; urgency=high
+
+  * Set proper permissions in postinst (Closes: #415855).
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Fri, 23 Mar 2007 00:53:01 +0100
+
+bip (0.5.3-3) unstable; urgency=low
+
+  * Add --enable-oidentd to configure.
+  * Create /var/run/bip at daemon start time (Closes: #385791).
+  * Update init script and depend on lsb-base (>= 3.0-6).
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Sat,  9 Sep 2006 11:58:19 +0200
+
+bip (0.5.3-2) unstable; urgency=medium
+
+  * Fix extremely lame bug in init script.
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Tue, 25 Jul 2006 21:17:22 +0200
+
+bip (0.5.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Add a watchfile (Closes: #357851).
+  * Add bip_home_arg.diff, allows to specify a home for bip on the
+    command line. Allows much nicer init script.
+  * ssl_cert_path.diff, allows to specify a directory for ssl certificate path
+    Allows much nicer init script too.
+  * Add ${misc:Depends}.
+  * Bump standards version.
+  * Compat is now 5.
+  * Don't start/restart bip on install/upgrade.
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Tue, 11 Jul 2006 00:22:00 +0200
+
+bip (0.5.2-2) unstable; urgency=low
+
+  * Added init.d file (Closes: #357855).
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Sat,  1 Apr 2006 19:13:33 +0200
+
+bip (0.5.2-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Wed, 08 Mar 2006 14:31:13 +0100
+
+bip (0.5.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Sun, 29 Jan 2006 22:25:51 +0100
+
+bip (0.5.0-1) unstable; urgency=low
+
+  * Initial release.
+  * Change to use the bip with GPL + OpenSSL exception licence, and link to
+    OpenSSL
+
+ -- Arnaud Cornet <arnaud.cornet@gmail.com>  Thu, 17 Nov 2005 15:28:19 +0100
--- bip-0.6.1.orig/debian/compat
+++ bip-0.6.1/debian/compat
@@ -0,0 +1 @@
+5
--- bip-0.6.1.orig/debian/bip.postinst
+++ bip-0.6.1/debian/bip.postinst
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+BIPUSER=bip
+BIPGROUP=bip
+BIPHOME=/var/lib/bip
+
+chgrp "$BIPUSER" "$BIPHOME" 2>/dev/null || addgroup --system "$BIPUSER"
+chown "$BIPUSER"."$BIPUSER" "$BIPHOME" 2>/dev/null || \
+	adduser --system --home "$BIPHOME" --disabled-password \
+	--ingroup "$BIPGROUP" "$BIPUSER"
+
+if [ ! -e /var/log/bip ]
+then
+	mkdir /var/log/bip
+	chown bip:bip /var/log/bip
+	chmod 750 /var/log/bip
+fi
+
+if [ "$1" = "configure" -a "$2" = "" ]
+then
+	chown root:"$BIPGROUP" /etc/bip.conf
+	chmod 640 /etc/bip.conf
+fi
+
+#DEBHELPER#
--- bip-0.6.1.orig/debian/bip.manpages
+++ bip-0.6.1/debian/bip.manpages
@@ -0,0 +1,3 @@
+bipmkpw.1
+bip.1
+bip.conf.1
--- bip-0.6.1.orig/debian/README.Debian
+++ bip-0.6.1/debian/README.Debian
@@ -0,0 +1,73 @@
+This README file explains the basics of bip configuration.
+Bip can be used in two different way:
+- Unix service style with and init.d scripts and the logs in /var/log
+- Old school bnc user style: easy and straightforward.
+
+This small README file explains both type of usage.
+
+* With the old school type:
+**************************
+ - you do not need the root privileges.
+ - gives easy access to the logs of the users of this bip to the one owning the
+   shell.
+ - Still the preferred type.
+
+If you are using a distribution package, the bip.conf sample configuration file
+is likely to be shipped in /usr/share/doc/bip/examples/bip.conf.gz or something
+similar.
+
+Create your bip configuration an log directory:
+
+# mkdir -p ~/.bip/logs
+
+Put the uncompressed configuration file in your ~/.bip directory (its path
+should be ~/.bip/bip.conf), and edit it.
+
+When you are done editing the configuration, you can start bip normally:
+
+# bip
+
+Using the default (or sample file) configuration, logs are in ~/.bip/logs/
+
+See "Understand the configuration file" below to configure bip.conf
+
+* With the new Unix type:
+************************
+
+ - bip is started automatically on boot, as a classical service
+ - logs in /var/log/bip, keeps users out.
+
+For this configuration, you need to edit /etc/bip.conf. This particular file
+might contain some user password so check its permissions.
+
+Edit /etc/default/bip and set ENABLED=1.
+
+See "Understand the configuration file" below to configure bip.conf
+
+* Understand the configuration file.
+************************************
+
+Most importantly the "user" section that contains information about you and the
+servers you will want to connect to. The "name" field in the "user" section is
+your login to connect to bip.  The "password" field is a hash of the password
+you will use to connect to bip.  To generate a hash value from a password, use
+bipmkpw, program which comes in the bip package and source.
+The "name" field of the "connection" subsections are the server identifier for
+when you connect to bip.
+
+Once bip starts, it connects to the different servers you defined in
+"connection". Then you want to use your regular irc client and connect to bip.
+Point your client to the machine bip is running and set the proper port number
+(defined in your bip.conf). You should then configure the client to use a
+specific irc server password constructed this way:
+
+user:password:network
+
+The user is the name field of the "user" section, the password is the *hash* of
+the password you entered in the "password" field of the same user section (the
+hash is generated with bipmkpw) and the network is the "name" field of the
+"connection" subsection. This is how bip authenticates you and puts your client
+to the correct network.
+
+Happy ircing!
+
--- bip-0.6.1.orig/debian/copyright
+++ bip-0.6.1/debian/copyright
@@ -0,0 +1,29 @@
+This package was debianized by Arnaud Cornet <arnaud.cornet@gmail.com> on
+Sun, 09 Oct 2005 14:18:48 +0200
+
+It was downloaded from http://bip.berlios.de
+
+Upstream Author: Arnaud Cornet <arnaud.cornet@gmail.com> and loïc Gomez <debian-bip@kyoshiro.org>
+
+Copyright:
+
+   This package 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; version 2 dated June, 1991.
+
+   This package 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 received a copy of the GNU General Public License
+   along with this package; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+Specific permission is granted for the GPLed code in this distribition to
+be linked to OpenSSL without invoking GPL clause 2(b).
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
--- bip-0.6.1.orig/debian/bip.conf
+++ bip-0.6.1/debian/bip.conf
@@ -0,0 +1,144 @@
+# bip default config file.
+# Thou shoult change thy password
+
+ip = "0.0.0.0";
+
+# To connect a client to bip, try the port below, and
+# be sure to set the password to the value
+# specified in the network you want to connect to. 
+port = 7778;
+
+# If you set this to true, you'll only be able to connect to bip
+# with a SSL capable IRC client. Be sure to generate a certificate
+# for bip with 'make cert'
+client_side_ssl = false;
+
+log_level = 3;
+
+pid_file="/var/run/bip/bip.pid";
+
+# This is where logs go. Channel and private messages will use that
+# configuration value as a prefix, and then log_format to determine
+# full log filename.
+log_root = "/var/log/bip/";
+
+# Log format allows you to make log filenames depend on the log line's
+# attributes. Here's a list :
+# %u -> user name
+# %n -> network name
+# %Y -> 4 digit year
+# %m -> 2 digit month
+# %d -> 2 digit day
+# %c -> destination (#chan, privates, ...)
+#log_format = "%n/%Y-%m/%c.%d.log";
+
+# Sets the frequency (in seconds) of log syncing (real write to kernel)
+#log_sync_interval = 5;
+
+# Makes bip send the log of each channel and privates while
+# you were not connected to the proxy upon connection. 
+#backlog = true;		# enable backlog
+backlog_lines = 10;		# number of lines in backlog, 0 means no limit
+backlog_always = true;		# backlog even lines already backlogged
+
+# If blreset_on_talk talking on an irc network has the same effect of issuing
+# /bip blreset, meaning that stuffed logged before the command won't be read
+# back on backlog
+#blreset_on_talk = false;
+
+# Network definition, a name and server info
+network {
+	name = "iiens";
+	server { host = "irc.iiens.net"; port = 6667; };
+};
+
+network {
+	name = "oftc";
+	server { host = "irc.oftc.net"; port = 6667; };
+};
+
+# Configuration example with one user who connects to two irc networks
+# To use the multi-server feature:
+#  - define the connections
+#  - chose and setup a different login for each connection
+# on your irc client:
+#  - Use the multi server feature of your client, the server beeing each time
+#    the server where bip is running. In your client setup server password to:
+#      username:password:connectionname
+#  - do not store the password in clear here, use the bipmkpw util to generate
+# a hash
+
+# User structure is grouping information for a given user
+user {
+	# The name in bip of the user
+	# This is used by bip only
+	name = "bip`debian";
+	# this user's password (md5(md5("tata"))) with seed - generated by bipmkpw
+	password = "3880f2b39b3b9cb507b052b695d2680859bfc327";
+
+	# SSL certificates checking mode for user:
+	# - "none" to accept anything;
+	# - "basic" to accept if the certificate is contained in the store;
+	# In "basic" mode, encountered untrusted certificates can be added to
+	# the store interactively by connecting a client and "trusting" them.
+	# - "ca" to do a complete certificate chain checking with the objects
+	# in the store below (you have to put in it every cert, CRL, up to the
+	# root CA). You have to build your store manually, so you may prefer
+	# using "basic" unless you're a crypto zealot...
+	ssl_check_mode = "none";
+
+	# Location of the user's store for SSL certificate check
+	# In "basic" mode, that must point to a single file with all trusted
+	# certs concatenated together (the interactive "trust" appends to this
+	# file).
+	# In "ca" mode, it's a directory of a standard openssl store; you must
+	# put PEM objects (certificates, CRLs...) with .pem extension and run
+	# `c_rehash .' in it
+	# ssl_check_store = "/home/bip`debian/.bip/trustedcerts.txt";
+
+	# These will be the default for each connections
+	default_nick = "bip`debian";
+	default_user = "bip";
+	default_realname = "bip on debian";
+
+	# A user can have mutiple connections to irc networks.
+	# define a connection:
+#	connection {
+#		name = "iiens";		# used by bip only
+#		network = "iiens";	# which ircnet to connect to
+#
+#		# these will be sent to the real server
+#		#user = "otheruser";
+#		#realname = "otheruser";
+#		#password = "serverpassword";
+#
+#		# Some options:
+#		#away_nick = "bip`away";
+#		#follow_nick = true;
+#		#ignore_first_nick = true;
+#		#on_connect_send = "PRIVMSG NickServ :IDENTIFY nspassword";
+#
+#		# Autojoined channels:
+#		channel { name = "#bip"; };
+#		# Password protected channel
+#		channel {
+#			name = "#elite_UnDeRgR0uNd"; 
+#			key = "sikiour";
+#		};
+#	};
+
+	# another connection (optionnal)
+	connection {
+		name = "oftc";		# used by bip only
+		network = "oftc";	# which ircnet to connect to
+
+		# Some options:
+		#away_nick = "bip`away";
+		#follow_nick = true;
+		#ignore_first_nick = true;
+		#on_connect_send = "PRIVMSG NickServ :IDENTIFY nspassword";
+
+		# Autojoined channels:
+		channel { name = "#bip"; };
+	};
+};
--- bip-0.6.1.orig/debian/bip.init
+++ bip-0.6.1/debian/bip.init
@@ -0,0 +1,104 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          bip
+# Required-Start:    $local_fs $network
+# Required-Stop:     $local_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Bip irc proxy init script
+# Description:       This file should be used to start and stop bip in system
+#                    mode.
+### END INIT INFO
+
+# Author: Arnaud Cornet <arnaud.cornet@gmail.com>
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+BIPHOME=/var/lib/bip
+VRBIP=/var/run/bip
+PIDFILE=$VRBIP/bip.pid
+CONFIG=/etc/bip.conf
+BIP=/usr/bin/bip
+ENABLED=0
+
+test -x $BIP || exit 0
+test -f $CONFIG || exit 0
+
+if [ -e /etc/default/bip ]; then
+	. /etc/default/bip
+fi
+
+test "$ENABLED" != "0" || exit 0
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+. /lib/lsb/init-functions
+
+
+bip_start()
+{
+	if [ ! -e $VRBIP ] ; then
+		# /var/run can be cleaned at reboot
+		mkdir -p $VRBIP
+		chown bip:bip $VRBIP
+	fi
+	start-stop-daemon --start --chuid bip:bip --pidfile "$PIDFILE" --exec /usr/bin/bip -- -f "$CONFIG" -s "$BIPHOME" \
+		|| return 2
+	return 0
+}
+
+bip_stop()
+{
+	start-stop-daemon --stop --user bip --pidfile "$PIDFILE" \
+		|| return 2
+	return 0
+}
+
+bip_reload()
+{
+	start-stop-daemon --stop --user bip --pidfile "$PIDFILE" --signal 1 \
+		|| return 2
+	return 0
+}
+
+case "$1" in
+start)
+	log_daemon_msg "Starting bip" "bip"
+	bip_start
+	case "$?" in
+	0) log_end_msg 0 ;;
+	1) log_end_msg 1 ; echo "pid file '$PIDFILE' found, bip not started." ;;
+	2) log_end_msg 1 ;;
+	esac
+;;
+stop)
+	log_daemon_msg "Stopping bip" "bip"
+	bip_stop
+	case "$?" in
+	0|1) log_end_msg 0 ;;
+	2) log_end_msg 1 ;;
+	esac
+;;
+reload|force-reload)
+	log_daemon_msg "Reloading bip" "bip"
+	bip_reload
+	case "$?" in
+	0|1) log_end_msg 0 ;;
+	2) log_end_msg 1 ;;
+	esac
+;;
+	restart)
+	log_daemon_msg "Restarting bip" "bip"
+	bip_stop
+	bip_start
+	case "$?" in
+	0) log_end_msg 0 ;;
+	1) log_end_msg 1 ;;
+	2) log_end_msg 1 ;;
+	esac
+;;
+*)
+	echo "Usage: /etc/init.d/bip {start|stop|reload|restart}"
+	exit 3
+;;
+esac
+
+:
--- bip-0.6.1.orig/debian/bip.examples
+++ bip-0.6.1/debian/bip.examples
@@ -0,0 +1,2 @@
+samples/bip.conf
+samples/bip.vim
