diff options
Diffstat (limited to 'debian')
32 files changed, 1257 insertions, 0 deletions
diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..794d96f --- /dev/null +++ b/debian/TODO @@ -0,0 +1,3 @@ +* extend initscript that: + - has an option to join channels (via empty messages) on start + - takes nick and nickpassword from /etc/default/irker diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..740e2cd --- /dev/null +++ b/debian/changelog @@ -0,0 +1,465 @@ +irker (2.19+dfsg-1) unstable; urgency=low + + [ Neil Muller ] + * New upstream release. + * Tweak autopkgtest setup steps to be a bit more robust. + * Update watch file to current gitlab layout. + * Fix watchfile to correctly mangle the version to the correct dfsg format. + * Bump Standards-Version to 4.5.1. + * Add 'Pre-Depends: ${misc:Pre-Depends}' as the generated debhelper scripts + need that. + * Rebase patches against new upstream and drop merged patches. + * Import fixes from upstream so irkerhook works with mercurial and python 3 + (Closes: 981922). + + [ Ondřej Nový ] + * d/control: Update Maintainer field with new Debian Python Team + contact address. + * d/control: Update Vcs-* fields with new Debian Python Team Salsa + layout. + + [ Debian Janitor ] + * Bump debhelper from old 11 to 12. + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. + + -- Neil Muller <drnlmuller+debian@gmail.com> Tue, 16 Feb 2021 07:22:43 +0200 + +irker (2.18+dfsg-4) unstable; urgency=low + + [ Ondřej Nový ] + * Use debhelper-compat instead of debian/compat. + + [ Neil Muller ] + * Rename 0011-Import-upstream-tweaks-to-irkerd.service.patch to + 0014-Import-upstream-tweaks-to-irkerd.service.patch to avoid duplicate + patch numbers. + * Switch to using python3 (Closes: 936746): + - Add 0015-Update-irkerhook-documentation-to-python-3.patch to use python3 + in the manpage example. + - Add 0016-Update-shebangs.patch to use python3 shebangs in the commands. + * Add a simple autopkgtest for irkerd daemon. + * Drop custom compression setting to make lintian happy. + * Add a lintian override because lintian misses our init.d file. + * Update years in copyright file. + * Bump Standards-Version to 4.4.0 (no further changes needed). + + [ Jonathan Carter ] + * Team upload + * Prepare upload to unstable + * Fix email address in debian/copyright: s/debain/debian/g + + -- Jonathan Carter <jcc@debian.org> Wed, 18 Sep 2019 17:40:43 +0200 + +irker (2.18+dfsg-3) unstable; urgency=low + + * Migrate from SVN to git. + * Add patch to fix irkerd under python 3 from upstream issue tracker. + * Add patch to fix FTBFS due to Makefile copy and paste + error (Closes: 864612). + * Add patch so irkerhook.py runs under python 3 from upstream issue tracker. + * Add irkerd.service updates from upstream repository. + - Update Description. + - Add Documentation links to the service file. + * Fix some newer lintian warnings. + - Don't use chown -R on installation. + - Fix some spelling errors. + * Add "Rules-Requires-Root:" field to debian/control. + - Also bump Standards-Version to 4.1.5 (no further changes needed). + * Update years in copyright file. + * Change debhelper compatibility level to 11. + - Bump minimum debhelper version required. + - Remove obsolete dh-systemd dependency. + - Update debian/rules accordingly. + + -- Neil Muller <drnlmuller+debian@gmail.com> Wed, 11 Jul 2018 14:43:05 +0200 + +irker (2.18+dfsg-2) unstable; urgency=low + + * Acknowledge Antoine Beaupré's NMU. + * Add missing dependency on lsb-base (lintian warning). + * Add IOError exception fix from upstream issue tracker. + + -- Neil Muller <drnlmuller+debian@gmail.com> Tue, 01 Nov 2016 13:11:44 +0200 + +irker (2.18+dfsg-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * new patches to the .service file: + * run daemon as the irker used (Closes: #832758) + * properly import environment from /etc/defaults (Closes: #832322) + + -- Antoine Beaupré <anarcat@debian.org> Mon, 12 Sep 2016 11:59:26 -0400 + +irker (2.18+dfsg-1) unstable; urgency=low + + * Update to latest upstream release. + - Adds support for specifying a template for irc + messages (Closes: #824512). + * Extend 0007-irkerhook-git.patch to describe the limitations of + irkerhook-git in more detail. + * Make irkerhook-git complain if no project or template has been + configured. + * Drop obsolete dh_builddeb compression override. + * Bump Standards-Version to 3.9.8 (no changes needed). + + -- Neil Muller <drnlmuller+debian@gmail.com> Fri, 17 Jun 2016 12:53:36 +0200 + +irker (2.17+dfsg-1) unstable; urgency=low + + * Update to latest upstream release. + - Adds a delay to reconnect attempts (Closes: #749650). + - License changed to BSD-2-clause license. + * Add manpage for the irkerhook-debian helper. + * Add 0007-irkerhook-git.patch to describer irkerhook-git in the + irkerhook manpage. + * Drop 0002-abbrev-commit.patch, 0003-abbrev-gitweb.patch and + 0004-webview.patch, as these fixes have been incorporated + upstream. + * Change VCS-Browser field to use https instead of http. + * Bump Standards-Version to 3.9.7 (no changes needed). + + -- Neil Muller <drnlmuller+debian@gmail.com> Tue, 15 Mar 2016 14:55:22 +0200 + +irker (2.13+dfsg-1) unstable; urgency=low + + * Adopt irker under the Python Applications Packaging Team umbrella + (Closes: #756090). + * Update to upstream version 2.13 (Closes: #793031). + * Update years in copyright file. + * Add a watch file. + * Various lintian cleanups. + - Add missing stop levels to irker.init. + - Fix adduser call in postinst. + - Use BSD-3-clause as the copyright short name. + * Don't remove the irker user on package removal, since it may still own + files. + * Add an Alias entry to the systemd unit so it recognises the SysV init + script. + * Add dh_python to Build-Depends. + * Bump Standards-Version to 3.9.6 (no changes needed). + + -- Neil Muller <drnlmuller+debian@gmail.com> Tue, 19 Jan 2016 22:46:39 +0200 + +irker (2.12+dfsg-1) unstable; urgency=medium + + * QA upload. + * Update to upstream version 2.12 (Closes: #775027) + + -- Jonathan Wiltshire <jmw@debian.org> Sat, 17 Jan 2015 14:25:09 +0000 + +irker (2.11+dfsg-2) unstable; urgency=low + + * I don't care anymore, not worth it.. orphaning. + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 25 Jul 2014 20:46:42 +0200 + +irker (2.11+dfsg-1) unstable; urgency=low + + * Merging upstream version 2.11+dfsg: + - irk works with ircs URLs (Closes: #749818). + + -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 24 Jun 2014 16:30:06 +0200 + +irker (2.9+dfsg-1) unstable; urgency=low + + * Merging upstream version 2.9+dfsg. + * Refreshing webview.patch. + + -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 10 Jun 2014 19:56:49 +0200 + +irker (2.8+dfsg-1) unstable; urgency=low + + * Merging upstream version 2.8+dfsg. + * Dripping irk-manpage.patch, included upstream. + * Adding patch to use author_name instead of author in Git + notifications. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 31 May 2014 11:54:17 +0200 + +irker (2.7+dfsg-2) unstable; urgency=low + + * Adding manpage for irk from Antoine Beaupre <anarcat@debian.org> + (Closes: 746535). + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 03 May 2014 12:28:08 +0200 + +irker (2.7+dfsg-1) unstable; urgency=low + + * Dropping debconf handling (Closes: #743472). + * Merging upstream version 2.7+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 05 Apr 2014 11:21:21 +0200 + +irker (2.6+dfsg-2) unstable; urgency=low + + * Building with dh --parallel. + + -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 31 Mar 2014 21:00:17 +0200 + +irker (2.6+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.6+dfgs. + * Updating year in copyright file. + * Dropping daemon user debconf support, there's no practical need to run + irker under a different unprivileged user anyway. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 05 Feb 2014 20:41:13 +0100 + +irker (2.5+dfsg-5) experimental; urgency=low + + * Adding support for multiple channels in irkerhook-debian. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 19 Jan 2014 08:38:40 +0100 + +irker (2.5+dfsg-4) experimental; urgency=low + + * Running git hook with set -e. + * Adding generic irkerhook for random debian purposes (such as lxc). + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 17 Jan 2014 16:17:28 +0100 + +irker (2.5+dfsg-3) experimental; urgency=low + + * Disabling url check in irkerhook. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 16 Jan 2014 14:43:37 +0100 + +irker (2.5+dfsg-2) experimental; urgency=low + + * Updating local git hook for newer irker and git versions. + + -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 13 Jan 2014 13:31:56 +0100 + +irker (2.5+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.5+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 27 Dec 2013 15:51:30 +0100 + +irker (2.4+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.4+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 05 Dec 2013 19:22:40 +0100 + +irker (2.3+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.3+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 01 Dec 2013 09:20:51 +0100 + +irker (2.2+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.2+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 01 Dec 2013 09:19:21 +0100 + +irker (2.1+dfsg-1) experimental; urgency=low + + * Merging upstream version 2.1+dfsg. + * Adding patch to avoid rcopying removed logo file. + * Renumbering patches. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 27 Nov 2013 07:04:08 +0100 + +irker (2.0+dfsg-1) experimental; urgency=low + + * Rewrapping init script. + * Updating to standards version 3.9.5. + * Merging upstream version 2.0+dfsg. + * Dropping python-irc from depends, not required anymore. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 16 Nov 2013 14:29:36 +0100 + +irker (1.20+dfsg-5) experimental; urgency=low + + * Adding explicit depends to adduser (Closes: #722466). + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 11 Sep 2013 15:45:58 +0200 + +irker (1.20+dfsg-4) experimental; urgency=low + + * Updating vcs fields. + * Adding initscript. + * Updating todo file. + + -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 09 Sep 2013 11:30:26 +0200 + +irker (1.20+dfsg-3) experimental; urgency=low + + * Adding vcs fields. + * Wrapping control fields. + * Adding manpage symlinks. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 17 Jul 2013 13:17:05 +0200 + +irker (1.20+dfsg-2) experimental; urgency=low + + [ Michael Stapelberg ] + * Using dh-systemd for proper systemd-related maintscripts (Closes: #715252). + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 12 Jul 2013 15:30:26 +0200 + +irker (1.20+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.20+dfsg. + * Rediffing abbrev-commit.patch. + * Rediffing abbrev-gitweb.patch. + + -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 28 May 2013 15:07:01 +0200 + +irker (1.19+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.19+dfsg. + * Sorting targets in rules. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 16 May 2013 10:46:00 +0200 + +irker (1.18+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.18+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 18 Apr 2013 06:16:13 +0200 + +irker (1.17+dfsg-3) unstable; urgency=low + + * Removing all references to my old email address. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 10 Mar 2013 20:52:36 +0100 + +irker (1.17+dfsg-2) unstable; urgency=low + + * Make irkerhook-git more usable by checking for irker.project value in + repository config. + * Renumbering patches with four leading digits. + * Trimming diff headers in patches. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 10 Mar 2013 20:51:10 +0100 + +irker (1.17+dfsg-1) unstable; urgency=low + + * Merging upstream version 1.17+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 07 Feb 2013 12:26:45 +0100 + +irker (1.16+dfsg-1) unstable; urgency=low + + * Merging upstream version 1.16+dfsg. + * Updating year in copyright file. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 26 Jan 2013 20:54:31 +0100 + +irker (1.15+dfsg-2) unstable; urgency=low + + * Updating year in copyright file. + * Adding dpkg-source local-options. + * Dropping dpkg-source compression levels. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 24 Jan 2013 16:10:06 +0100 + +irker (1.15+dfsg-1) unstable; urgency=low + + * Merging upstream version 1.15+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 10 Dec 2012 11:54:36 +0100 + +irker (1.14+dfsg-1) unstable; urgency=low + + * Merging upstream version 1.14+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 28 Nov 2012 14:08:48 +0100 + +irker (1.13+dfsg-2) unstable; urgency=low + + * Dropping alternate depends on python-irclib. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 11 Nov 2012 19:54:16 +0100 + +irker (1.13+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.13+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 08 Nov 2012 11:51:26 +0100 + +irker (1.12+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.12+dfsg. + * Bumping versioned build-depends on python-irclib. + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 12 Oct 2012 07:00:04 +0200 + +irker (1.11+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.11+dfsg. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 11 Oct 2012 07:22:58 +0200 + +irker (1.10+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.10+dfsg. + * Removing python-eventlet recommends, upstream dropped support for + it. + * Updating python irc depends. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 10 Oct 2012 09:51:02 +0200 + +irker (1.9+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.9+dfsg. + * Adding systemd and pkg-config to build-depends to automatically + guess systemd unit directory. + * Adding todo file. + + -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 09 Oct 2012 07:44:39 +0200 + +irker (1.8+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.8+dfsg. + * Removing tinyifier-config.patch, included upstream. + * Removing irk-netcat.patch, not applicable anymore. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 07 Oct 2012 09:58:51 +0200 + +irker (1.7+dfsg-3) experimental; urgency=low + + * Adding patch for irk test tool to let netcat terminate in order to + send the request. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 06 Oct 2012 15:21:02 +0200 + +irker (1.7+dfsg-2) experimental; urgency=low + + * Adding patch to show commit IDs shortened by default to 7 characters + (in line with default git --abbrev-commit) rather than the unusual + 12. + * Adding patch to show commit IDs shortened by default to 7 characters + (in line with default git --abbrev-commit) rather than the unusual + 12 also in gitweb. + * Adding patch from upstream to get tinyfier from the config. + + -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 06 Oct 2012 14:08:38 +0200 + +irker (1.7+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.7+dfsg. + * Adding irkerhook-git to be symlinked in git repositories. + * Adding debhelper install file to install irk. + * Adding debhelper examples file to install filter examples. + + -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 05 Oct 2012 20:39:46 +0200 + +irker (1.6+dfsg-1) experimental; urgency=low + + * Merging upstream version 1.6+dfsg. + * Removing vanished bugs file from debhelper docs. + * Making comment about removing irker-logo.png in source more precise. + + -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 04 Oct 2012 20:59:35 +0200 + +irker (1.5+dfsg-1) experimental; urgency=low + + * Initial release (Closes: #689011). + * Rebuild upstream tarball without sourceless irker logo. + + -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 03 Oct 2012 12:35:32 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..bfaa8d1 --- /dev/null +++ b/debian/control @@ -0,0 +1,30 @@ +Source: irker +Section: utils +Priority: optional +Maintainer: Debian Python Team <team+python@tracker.debian.org> +Uploaders: Neil Muller <drnlmuller+debian@gmail.com> +Build-Depends: + debhelper-compat (= 12), + pkg-config, + python3, + systemd, + xmlto, + dh-python +Standards-Version: 4.5.1 +Rules-Requires-Root: binary-targets +Homepage: http://www.catb.org/esr/irker/ +Vcs-Browser: https://salsa.debian.org/python-team/packages/irker +Vcs-Git: https://salsa.debian.org/python-team/packages/irker.git + +Package: irker +Architecture: all +Depends: + ${misc:Depends}, + ${python3:Depends}, + lsb-base, + adduser, +Pre-Depends: ${misc:Pre-Depends} +Description: submission tools for IRC notifications + irkerd is a specialized IRC client that runs as a daemon, allowing other + programs to ship IRC notifications by sending JSON objects to a listening + socket. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ac3577b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,44 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: irker +Upstream-Contact: Eric S. Raymond <esr@thyrsus.com> +Files-Excluded: irker-logo.png +Source: http://www.catb.org/esr/irker/ + The irker-log.png file is removed because it has no known origin and + no source is available for it. + +Files: * +Copyright: 2012-2016 Eric S. Raymond <esr@thyrsus.com> +License: BSD-2-clause + +Files: debian/* +Copyright: 2012-2014 Daniel Baumann <mail@daniel-baumann.ch> + 2016-2019 Neil Muller <drnlmuller+debian@gmail.com> +License: BSD-2-clause +Comment: + Daniel Baumann relicensed his contribution from BSD-3-clause + to BSD-2-clause on 15th January, 2016 to match upstream's + license change. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..3879982 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +debian-branch=debian/master diff --git a/debian/irker.docs b/debian/irker.docs new file mode 100644 index 0000000..3b2cfe7 --- /dev/null +++ b/debian/irker.docs @@ -0,0 +1,2 @@ +README +*.txt diff --git a/debian/irker.examples b/debian/irker.examples new file mode 100644 index 0000000..369085b --- /dev/null +++ b/debian/irker.examples @@ -0,0 +1 @@ +filter*.py diff --git a/debian/irker.init b/debian/irker.init new file mode 100644 index 0000000..27ff9cc --- /dev/null +++ b/debian/irker.init @@ -0,0 +1,84 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: irker +# Required-Start: $local_fs $remote_fs $syslog $network +# Required-Stop: $local_fs $remote_fs $syslog $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: submission tools for IRC notifications +# Description: irkerd is a specialized IRC client that runs as a +# daemon, allowing other programs to ship IRC +# notifications by sending JSON objects to a listening +# socket. +### END INIT INFO + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +DAEMON="/usr/bin/irkerd" + +test -x "${DAEMON}" || exit 0 + +NAME="irkerd" +DESC="IRC notifications" +PIDFILE="/var/run/irker.pid" +DEFAULTS="/etc/default/irker" + +for _FILE in "${DEFAULTS}" "${DEFAULTS}".d/* +do + if [ -e "${_FILE}" ] + then + . "${_FILE}" + fi +done + +set -e + +. /lib/lsb/init-functions + +do_start() +{ + start-stop-daemon --start --background --quiet --oknodo --exec ${DAEMON} --chuid irker -- -l /var/log/irker/irker.log ${IRKER_OPTIONS} +} + +do_stop () +{ + start-stop-daemon --stop --quiet --oknodo --name ${NAME} +} + +do_reload () +{ + start-stop-daemon --stop --quiet --oknodo --name ${NAME} --signal 1 +} + +case "${1}" in + start) + log_daemon_msg "Starting ${DESC}" "${NAME}" + do_start + log_end_msg ${?} + ;; + + stop) + log_daemon_msg "Stopping ${DESC}" "${NAME}" + do_stop + log_end_msg ${?} + ;; + + restart|force-reload) + log_daemon_msg "Restarting ${DESC}" "${NAME}" + do_stop + sleep 1 + do_start + log_end_msg ${?} + ;; + + status) + status_of_proc ${DAEMON} ${NAME} + ;; + + *) + echo "Usage: ${0} {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/irker.install b/debian/irker.install new file mode 100644 index 0000000..d3649a4 --- /dev/null +++ b/debian/irker.install @@ -0,0 +1,3 @@ +irk /usr/bin + +debian/local/* /usr/bin diff --git a/debian/irker.links b/debian/irker.links new file mode 100644 index 0000000..bf03253 --- /dev/null +++ b/debian/irker.links @@ -0,0 +1,2 @@ +/usr/share/man/man8/irkerd.8.gz /usr/share/man/man8/irk.8.gz +/usr/share/man/man1/irkerhook.1.gz /usr/share/man/man1/irkerhook-git.1.gz diff --git a/debian/irker.lintian-overrides b/debian/irker.lintian-overrides new file mode 100644 index 0000000..f79ebce --- /dev/null +++ b/debian/irker.lintian-overrides @@ -0,0 +1,3 @@ +# We use the upstream name for the systemd unit, which is different from the init script +# we provide, which uses the old name, which means lintian doesn't detect the init.d script +irker binary: package-supports-alternative-init-but-no-init.d-script diff --git a/debian/irker.postinst b/debian/irker.postinst new file mode 100644 index 0000000..ce4f7a5 --- /dev/null +++ b/debian/irker.postinst @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +case "${1}" in + configure) + if ! getent passwd irker > /dev/null 2>&1 + then + adduser --system --no-create-home --home /nonexistent --quiet --gecos 'irker daemon' --group irker + else + echo "irker user already exists, doing nothing." + fi + + mkdir -p /var/log/irker + chown irker:irker /var/log/irker + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/irker.postrm b/debian/irker.postrm new file mode 100644 index 0000000..4dcfac0 --- /dev/null +++ b/debian/irker.postrm @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "${1}" in + remove) + rmdir /var/log/irker > /dev/null 2>&1 || true + ;; + + purge) + rm -f /etc/default/irker + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/irkerhook-debian.1 b/debian/irkerhook-debian.1 new file mode 100644 index 0000000..80b902a --- /dev/null +++ b/debian/irkerhook-debian.1 @@ -0,0 +1,54 @@ +'\" t +.\" Title: irkerhook-debian +.\" Language: English +.\" +.TH "IRKERHOOK\-DEBIAN" "1" "14/03/2016" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +irkerhook-debian \- A simple wrapper for generating irker notifications +.SH "SYNOPSIS" +.sp +\fBirkerhook\-debian\fR \fImessage\fR +.SH "DESCRIPTION" +.sp +Irkerhook\-debian is a simple wrapper around irk for providing notifications +from service startup or monitoring scripts\&. +.PP +A symlink to the irkerhook\-debian script should be added to the service\&. +.PP +The behaviour of the script can be configured for each service via a /etc/default/<symlink name> file\&. +.PP +The script recognises 2 configuration options: +.PP +\fBIRC_CHANNELS\fR +.RS 4 +A list of channels to post the notification to. +.PP +.RE +\fBIRK_ENABLED\fR +.RS 4 +Set IRK_ENABLED to "true" to enable notifications. For other values, +notifications will be disabled. +.RE +.SH "SEE ALSO" +.sp +\&\fIirk\fR\|(1), \fIirkerhook\fR\|(1) +.SH "AUTHORS" +.sp +.nf +This manual page was written by Neil Muller <drnlmuller+debian@gmail\&.com>\&. +.SH "LICENSE" +.sp +.nf +This package is licensed under the BSD 2 clause license. +You can find the full text of the license in +/usr/share/doc/irker/copyright\&. diff --git a/debian/local/irkerhook-debian b/debian/local/irkerhook-debian new file mode 100755 index 0000000..1f05304 --- /dev/null +++ b/debian/local/irkerhook-debian @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +_MESSAGE="${@}" + +_PROGRAM="$(basename ${0})" + +for _FILE in "/etc/default/${_PROGRAM}" "/etc/default/${_PROGRAM}.d"/* +do + if [ -e "${_FILE}" ] + then + . "${_FILE}" || true + fi +done + +if [ "${IRK_ENABLED}" != "true" ] +then + exit 0 +fi + +echo "sending IRC notification" + +for IRC_CHANNEL in ${IRC_CHANNELS} +do + irk ${IRC_CHANNEL} "${_MESSAGE}" +done diff --git a/debian/local/irkerhook-git b/debian/local/irkerhook-git new file mode 100755 index 0000000..1f746e8 --- /dev/null +++ b/debian/local/irkerhook-git @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +if [ -z "$(git config --get irker.project)" -a -z "$(git config --get irker.template)" ] +then + echo "CONFIGURATION ERROR: Neither irker.project nor irker.template defined" + echo "NOT sending IRC notification" + exit 0 +fi + +echo "sending IRC notification" + +while read old new refname +do + irkerhook --refname=${refname} $(git rev-list --reverse ${old}..${new}) +done diff --git a/debian/manpages b/debian/manpages new file mode 100644 index 0000000..eb19f7c --- /dev/null +++ b/debian/manpages @@ -0,0 +1 @@ +debian/irkerhook-debian.1 diff --git a/debian/patches/0001-dfsg.patch b/debian/patches/0001-dfsg.patch new file mode 100644 index 0000000..891eaeb --- /dev/null +++ b/debian/patches/0001-dfsg.patch @@ -0,0 +1,22 @@ +From: Daniel Baumann <mail@daniel-baumann.ch> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Removing logo (no origin known and no source available) + +--- + Makefile | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 50da117..681a5d1 100644 +--- a/Makefile ++++ b/Makefile +@@ -92,8 +92,7 @@ SOURCES = \ + + EXTRA_DIST = \ + org.catb.irkerd.plist \ +- irkerd.service \ +- irker-logo.png ++ irkerd.service + + version: + @echo $(VERS) diff --git a/debian/patches/0005-author-name.patch b/debian/patches/0005-author-name.patch new file mode 100644 index 0000000..864e497 --- /dev/null +++ b/debian/patches/0005-author-name.patch @@ -0,0 +1,21 @@ +From: Daniel Baumann <mail@daniel-baumann.ch> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Use author_name instead of author in Git notifications. + +--- + irkerhook.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/irkerhook.py b/irkerhook.py +index 7dcd6b2..661071b 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -325,7 +325,7 @@ class GitExtractor(GenericExtractor): + # Might be be nice to ship the full email address, if not + # for spammers' address harvesters - getting this wrong + # would make the freenode #commits channel into harvester heaven. +- commit.author = commit.mail.split("@")[0] ++ commit.author = commit.author_name + commit.author_date, commit.commit_date = \ + do("git log -1 '--pretty=format:%ai|%ci' " + shellquote(commit.commit)).split("|") + return commit diff --git a/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch b/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch new file mode 100644 index 0000000..b341444 --- /dev/null +++ b/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch @@ -0,0 +1,92 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Mon, 8 Feb 2021 17:05:21 +0200 +Subject: Update HgExtractor to work with mercurial using python 3 + +From upstream commit: 6e9372a2e297b0925d951d178ce39840d99277c6 + +Forwarded: not-needed +--- + irkerhook.py | 45 +++++++++++++++++++++++++-------------------- + 1 file changed, 25 insertions(+), 20 deletions(-) + +diff --git a/irkerhook.py b/irkerhook.py +index bf697ab..e6b8f04 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -369,6 +369,7 @@ class HgExtractor(GenericExtractor): + def is_repository(directory): + return has(directory, [".hg"]) + def __init__(self, arguments): ++ from mercurial.encoding import unifromlocal + # This fiddling with arguments is necessary since the Mercurial hook can + # be run in two different ways: either directly via Python (in which + # case hg should be pointed to the hg_hook function below) or as a +@@ -395,24 +396,27 @@ class HgExtractor(GenericExtractor): + + GenericExtractor.__init__(self, arguments) + # Extract global values from the hg configuration file(s) +- self.project = ui.config('irker', 'project') +- self.repo = ui.config('irker', 'repo') +- self.server = ui.config('irker', 'server') +- self.channels = ui.config('irker', 'channels') +- self.email = ui.config('irker', 'email') +- self.tcp = str(ui.configbool('irker', 'tcp')) # converted to bool again in do_overrides +- self.template = ui.config('irker', 'template') or '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s' +- self.tinyifier = ui.config('irker', 'tinyifier') or default_tinyifier +- self.color = ui.config('irker', 'color') +- self.urlprefix = (ui.config('irker', 'urlprefix') or +- ui.config('web', 'baseurl') or '') ++ self.project = unifromlocal(ui.config(b'irker', b'project') or b'') ++ self.repo = unifromlocal(ui.config(b'irker', b'repo') or b'') ++ self.server = unifromlocal(ui.config(b'irker', b'server') or b'') ++ self.channels = unifromlocal(ui.config(b'irker', b'channels') or b'') ++ self.email = unifromlocal(ui.config(b'irker', b'email') or b'') ++ self.tcp = str(ui.configbool(b'irker', b'tcp')) # converted to bool again in do_overrides ++ self.template = unifromlocal(ui.config(b'irker', b'template') or b'') ++ if not self.template: ++ self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s' ++ self.tinyifier = unifromlocal(ui.config(b'irker', b'tinyifier') ++ or default_tinyifier.encode('utf-8')) ++ self.color = unifromlocal(ui.config(b'irker', b'color') or b'') ++ self.urlprefix = unifromlocal((ui.config(b'irker', b'urlprefix') or ++ ui.config(b'web', b'baseurl') or b'')) + if self.urlprefix: + # self.commit is appended to this by do_overrides + self.urlprefix = self.urlprefix.rstrip('/') + '/rev/' +- self.cialike = ui.config('irker', 'cialike') +- self.filtercmd = ui.config('irker', 'filtercmd') ++ self.cialike = unifromlocal(ui.config(b'irker', b'cialike') or b'') ++ self.filtercmd = unifromlocal(ui.config(b'irker', b'filtercmd') or b'') + if not self.project: +- self.project = os.path.basename(self.repository.root.rstrip('/')) ++ self.project = os.path.basename(unifromlocal(self.repository.root).rstrip('/')) + self.do_overrides() + def head(self): + "Return a symbolic reference to the tip commit of the current branch." +@@ -421,19 +425,20 @@ class HgExtractor(GenericExtractor): + "Make a Commit object holding data for a specified commit ID." + from mercurial.node import short + from mercurial.templatefilters import person +- node = self.repository.lookup(commit_id) +- commit = Commit(self, short(node)) ++ from mercurial.encoding import unifromlocal ++ ctx = self.repository[commit_id] ++ commit = Commit(self, unifromlocal(short(ctx.hex()))) + # Extract commit-specific values from a "context" object + ctx = self.repository.changectx(node) + commit.rev = '%d:%s' % (ctx.rev(), commit.commit) +- commit.branch = ctx.branch() +- commit.author = person(ctx.user()) ++ commit.branch = unifromlocal(ctx.branch()) ++ commit.author = unifromlocal(person(ctx.user())) + commit.author_date = \ + datetime.datetime.fromtimestamp(ctx.date()[0]).strftime('%Y-%m-%d %H:%M:%S') +- commit.logmsg = ctx.description() ++ commit.logmsg = unifromlocal(ctx.description()) + # Extract changed files from status against first parent + st = self.repository.status(ctx.p1().node(), ctx.node()) +- commit.files = ' '.join(st.modified + st.added + st.removed) ++ commit.files = unifromlocal(b' '.join(st.modified + st.added + st.removed)) + return commit + + def hg_hook(ui, repo, **kwds): diff --git a/debian/patches/0007-irkerhook-git.patch b/debian/patches/0007-irkerhook-git.patch new file mode 100644 index 0000000..1daf868 --- /dev/null +++ b/debian/patches/0007-irkerhook-git.patch @@ -0,0 +1,28 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Add description for the irkerhook-git helper script. + +The debian packages add a irkerhook-git helper script, which simplifies +the most common use case for irkerhook with git. This patch mentions the +helper script in the irkerhook manpage. +Last-Update: 2016-03-15 +--- + irkerhook.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/irkerhook.xml b/irkerhook.xml +index d6f7b51..2160166 100644 +--- a/irkerhook.xml ++++ b/irkerhook.xml +@@ -220,6 +220,11 @@ while read old new refname; do + done + </programlisting> + ++<para>For convenience, this is implemented by the irkerhook-git ++helper script. This script will complain about some common configuration ++isssues. For simplicity, irkerhook-git does not support all the ++options of irkerhook.py, and is thus not suitable for all applications.</para> ++ + <para>Preferences may be set in the repo <filename>config</filename> + file in an [irker] section. Here is an example of what that can look + like:</para> diff --git a/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch b/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch new file mode 100644 index 0000000..884e915 --- /dev/null +++ b/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch @@ -0,0 +1,25 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Mon, 8 Feb 2021 17:06:55 +0200 +Subject: Update irkerhook to recent mercurial changes + +Drop call to deprecated / removed mercurial internal method. + +From upstream commits: ad8f8552bc8bb7ff31848ccdc729f79aa63e88aa + +Forwarded: not-needed +--- + irkerhook.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/irkerhook.py b/irkerhook.py +index e6b8f04..0f66a64 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -429,7 +429,6 @@ class HgExtractor(GenericExtractor): + ctx = self.repository[commit_id] + commit = Commit(self, unifromlocal(short(ctx.hex()))) + # Extract commit-specific values from a "context" object +- ctx = self.repository.changectx(node) + commit.rev = '%d:%s' % (ctx.rev(), commit.commit) + commit.branch = unifromlocal(ctx.branch()) + commit.author = unifromlocal(person(ctx.user())) diff --git a/debian/patches/0009-env-service.patch b/debian/patches/0009-env-service.patch new file mode 100644 index 0000000..08abe7f --- /dev/null +++ b/debian/patches/0009-env-service.patch @@ -0,0 +1,29 @@ +From: Python Applications Packaging Team + <python-apps-team@lists.alioth.debian.org> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: env-service + + Properly import environment from /etc/defaults (Closes: #832322) + + This fixes a regression in the systemd unit, which doesn't support + the equivalent /etc/default/irker configuration supported by the + sysvinit startup scripts. +--- + irkerd.service | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/irkerd.service b/irkerd.service +index 4e75ae2..70b67d5 100644 +--- a/irkerd.service ++++ b/irkerd.service +@@ -8,8 +8,8 @@ Documentation=man:irkerd(8) man:irkerhook(1) man:irk(1) + + [Service] + User=irker +-ExecStart=/usr/bin/irkerd +-User=irker ++EnvironmentFile=-/etc/default/irker ++ExecStart=/usr/bin/irkerd $IRKER_OPTIONS + + [Install] + WantedBy=multi-user.target diff --git a/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch b/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch new file mode 100644 index 0000000..0b1b1a8 --- /dev/null +++ b/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch @@ -0,0 +1,32 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Thu, 5 Sep 2019 18:08:11 +0200 +Subject: Update irkerhook documentation to python 3 + +Change the example program to use python3 in the irkerhook +documentation. +--- + irkerhook.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/irkerhook.xml b/irkerhook.xml +index 2160166..77b5d9f 100644 +--- a/irkerhook.xml ++++ b/irkerhook.xml +@@ -365,7 +365,7 @@ representation of (possibly altered) metadata.</para> + <para>Below is an example filter:</para> + + <programlisting> +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This is a trivial example of a metadata filter. + # All it does is change the name of the commit's author. + # +@@ -374,7 +374,7 @@ metadata = json.loads(sys.argv[1]) + + metadata['author'] = "The Great and Powerful Oz" + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end + </programlisting> + diff --git a/debian/patches/0016-Update-shebangs.patch b/debian/patches/0016-Update-shebangs.patch new file mode 100644 index 0000000..b7ed871 --- /dev/null +++ b/debian/patches/0016-Update-shebangs.patch @@ -0,0 +1,78 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Thu, 5 Sep 2019 18:08:51 +0200 +Subject: Update shebangs + +Change the shebangs to use python3 so we get the correct result +when we build the package. +--- + filter-example.py | 4 ++-- + filter-test.py | 4 ++-- + irk | 2 +- + irkerd | 2 +- + irkerhook.py | 2 +- + 5 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/filter-example.py b/filter-example.py +index 12908b4..094d0b7 100755 +--- a/filter-example.py ++++ b/filter-example.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This is a trivial example of a metadata filter. + # All it does is change the name of the commit's author. + # It could do other things, including modifying the +@@ -9,5 +9,5 @@ metadata = json.loads(sys.argv[1]) + + metadata['author'] = "The Great and Powerful Oz" + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end +diff --git a/filter-test.py b/filter-test.py +index 030d3d4..82c0660 100755 +--- a/filter-test.py ++++ b/filter-test.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Test hook to launch an irker instance (if it doesn't already exist) + # just before shipping the notification. We start it in in another terminal +@@ -31,5 +31,5 @@ else: + + time.sleep(1.5) # Avoid a race condition + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end +diff --git a/irk b/irk +index fc9e153..22918d6 100755 +--- a/irk ++++ b/irk +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Illustrates how to test irkerd. + # + # First argument must be a channel URL. If it does not begin with "irc", +diff --git a/irkerd b/irkerd +index d42f56e..92ff8b1 100755 +--- a/irkerd ++++ b/irkerd +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + """ + irkerd - a simple IRC multiplexer daemon + +diff --git a/irkerhook.py b/irkerhook.py +index 661071b..bf697ab 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Copyright (c) 2012 Eric S. Raymond <esr@thyrsus.com> + # SPDX-License-Identifier: BSD-2-Clause + # diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..9dca8d6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,8 @@ +0001-dfsg.patch +0005-author-name.patch +0007-irkerhook-git.patch +0009-env-service.patch +0015-Update-irkerhook-documentation-to-python-3.patch +0016-Update-shebangs.patch +0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch +0008-Update-irkerhook-to-recent-mercurial-changes.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4533d35 --- /dev/null +++ b/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f + +dfsg: + # no origin known and no source available + rm -f irker-logo.png + +%: + dh ${@} --with python3 + +override_dh_auto_build: + DESTDIR="$(CURDIR)/debian/irker" dh_auto_build + +override_dh_auto_install: + DESTDIR="$(CURDIR)/debian/irker" dh_auto_install + + cp irkerhook.py debian/irker/usr/bin/irkerhook + +override_dh_installchangelogs: + dh_installchangelogs NEWS diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..e17af04 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Tests: test-simple +Depends: irker, python3-irc +Restrictions: isolation-container diff --git a/debian/tests/test-simple b/debian/tests/test-simple new file mode 100644 index 0000000..5502e55 --- /dev/null +++ b/debian/tests/test-simple @@ -0,0 +1,97 @@ +#!/bin/sh + +# Simple test that we can connect to a test server, and send a message with irk +# We use irclib to provide the test server and watch a test client to ensure that +# the correct message is broadcast to the correct channels + +set -e + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR + +# setup test client +cat << EOF > testclient.py +# Simple test case for irker +# Based on irccat.py in the irclib package by Joel Rosdahl <joel@rosdahl.net> + +import sys + +import irc.client + +logfile = None + +def on_connect(connection, event): + connection.join("#testchan") + +def on_pubmsg(connection, event): + logfile.write(event.arguments[0]) + logfile.write("\n") + logfile.write(event.source) + logfile.write("\n") + logfile.flush() + +def on_disconnect(connection, event): + raise SystemExit() + +def main(): + global logfile + client = irc.client.IRC() + try: + c = client.server().connect("localhost", 6667, "testclient") + except irc.client.ServerConnectionError: + print(sys.exc_info()[1]) + raise SystemExit(1) + + logfile = open(sys.argv[1], 'w') + + c.add_global_handler("welcome", on_connect) + c.add_global_handler("pubmsg", on_pubmsg) + + client.process_forever() + +if __name__ == '__main__': + main() +EOF + +# This is needed to make irkerd start on some lxc containers, otherwise +# the irker user can't execute anything, but it will fail in other +# cases, so we make it non-fatal +chmod 755 / || echo "chmod failed - assuming everything is fine" + +# Ensure irkerd is running +systemctl restart irkerd + +python3 -m irc.server 2>server.log & +sleep 3 +python3 ./testclient.py client.log & +# Give time for everything to start up and connect +sleep 3 + +# Send a message that the client should see +irk 'irc://localhost:6667/testchan' 'Test message 1' +sleep 1 +# This should not show up in the client log +irk 'irc://localhost:6667/differentchan' 'Test message 2' +sleep 1 +# this should also be seen +irk 'irc://localhost:6667/testchan' 'Test message 3' +sleep 1 + +# kill background tasks +pkill -f testclient.py +pkill -f irc.server + +# Inspect client log +# check that we saw irker connect +grep -q 'irker[0-9]' client.log + +grep -q 'Test message 1' client.log +grep -q 'Test message 3' client.log + +if grep -q 'Test message 2' client.log; then + echo "Found unexpected 'Test message 2' in client.log" + exit 1 +fi + +echo "Simple irker daemon test succeeded" diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000..248fd2f --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,5 @@ +--- +Bug-Database: https://gitlab.com/esr/irker/issues +Bug-Submit: https://gitlab.com/esr/irker/issues/new +Repository: https://gitlab.com/esr/irker.git +Repository-Browse: https://gitlab.com/esr/irker diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..79fdbc3 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts=repacksuffix=+dfsg,dversionmangle=s/\+dfsg\d*$// \ + https://gitlab.com/esr/irker/tags?sort=updated_desc .*/archive/(\d\S+)/.*\.tar\.gz.* |