From 2db6f712ce5a22def07709a2686ea4bc1617ffc5 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 21 Feb 2021 15:53:38 +0100 Subject: [PATCH] debian: initial syslogd/logger/libsyslog0/libsylog-dev packaging Signed-off-by: Joachim Wiberg --- Makefile.am | 8 ++- debian/.gitignore | 15 +++++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 61 +++++++++++++++++++++ debian/copyright | 37 +++++++++++++ debian/docs | 1 + debian/init.d | 103 +++++++++++++++++++++++++++++++++++ debian/libsyslog-dev.install | 6 ++ debian/libsyslog0.install | 1 + debian/libsyslog0.symbols | 22 ++++++++ debian/logger.install | 2 + debian/rules | 19 +++++++ debian/source/format | 1 + debian/syslogd.default | 7 +++ debian/syslogd.install | 5 ++ 16 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/init.d create mode 100644 debian/libsyslog-dev.install create mode 100644 debian/libsyslog0.install create mode 100644 debian/libsyslog0.symbols create mode 100644 debian/logger.install create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/syslogd.default create mode 100644 debian/syslogd.install diff --git a/Makefile.am b/Makefile.am index d86b078..0df82e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,10 +53,16 @@ release-hook: echo; \ fi +# +# Generate .deb package(s) +# +package: + @debuild -uc -us -B --lintian-opts --profile debian -i -I --show-overrides + # # Target to run when building a release # -release: release-hook distcheck +release: release-hook distcheck package @for file in $(DIST_ARCHIVES); do \ md5sum $$file > ../$$file.md5; \ sha256sum $$file > ../$$file.sha256; \ diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..31780f7 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,15 @@ +*.log +*.substvars +.debhelper/ +autoreconf.* +debhelper-build-stamp +files +libsyslog0/ +libsyslog-dev/ +libsyslog/ +logger/ +syslogd.debhelper.log +syslogd.post* +syslogd.pre* +syslogd/ +tmp/ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8e75314 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +sysklogd (2.2.2) stable; urgency=low + + * Initial release. + + -- Joachim Wiberg Sun, 21 Feb 2021 13:43:49 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..aff48da --- /dev/null +++ b/debian/control @@ -0,0 +1,61 @@ +Source: sysklogd +Priority: important +Section: admin +Maintainer: Joachim Wiberg +Build-Depends: debhelper (>= 10), pkg-config +Standards-Version: 4.3.0 +Homepage: https://troglobit.com/sysklogd.html +Vcs-Browser: https://github.com/troglobit/sysklogd +Vcs-Git: https://github.com/troglobit/sysklogd.git + +Package: syslogd +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6) +Provides: syslogd, linux-kernel-log-daemon, system-log-daemon +Conflicts: syslogd, linux-kernel-log-daemon, system-log-daemon +Recommends: logrotate +Description: system logging daemon + Continuation of the original syslog daemon for Linux, based on the *BSD + syslog daemon. Now with kernel logging and log rotation built-in. It + can both receive from and send to remote syslog servers. Since v2.0 it + also includes support for RFC5424 with the new syslogp() API extension + from NetBSD for clients. + +Package: libsyslog-dev +Priority: optional +Section: libdevel +Architecture: any +Depends: ${misc:Depends}, libsyslog0 (= ${binary:Version}) +Description: new syslogp() API from NetBSD, development files + Development files for building applications that use the syslogp() + API from NetBSD. + . + This package includes the static library, header files, and docs. + +Package: libsyslog0 +Priority: optional +Section: libs +Provides: libsyslog +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: new syslogp() API from NetBSD for use with sysklogd + This library provides the new syslogp() API from NetBSD. It provides + applications with the full RFC5424 logging API. The intended use is + with the sysklogd package. + +Package: logger +Priority: optional +Section: admin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libsyslog0 (= ${binary:Version}) +Conflicts: bsdutils +Description: enter messages into the system log + This version of logger is receommended for use with sysklogd. + It makes use of the new syslogp() API for RFC5424 style logs, + e.g. MSGID, strucutred data (SD), etc. + . + The BusyBox, or util-linux, logger tools can also be used, but + are limited to RFC3164 style messages. + . + Note: on Debian this conflicts with bsdutils, which is the + main package for providing logger. Use that. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ebbb17d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,37 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: sysklogd +Upstream-Contact: troglobit@gmail.com +Source: https://github.com/troglobit/sysklogd + +Files: debian/* +Copyright: 2021 Joachim Wiberg +License: BSD-3-clause + +Files: * +Copyright: 1983, 1988, 1993 The Regents of the University of California. All rights reserved. +License: BSD-3-clause + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. 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. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS 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/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/init.d b/debian/init.d new file mode 100755 index 0000000..691d123 --- /dev/null +++ b/debian/init.d @@ -0,0 +1,103 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: syslogd +# Required-Start: $network $remote_fs $time +# Required-Stop: $network $remote_fs $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: System logging daemon +# Description: The original Linux syslog daemon +### END INIT INFO +. /lib/lsb/init-functions + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="System logging daemon" +NAME=syslogd + +DAEMON=/usr/sbin/syslogd +PIDFILE=/var/run/syslogd.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Define LSB log_* functions. +. /lib/lsb/init-functions + +do_start() +{ + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $SYSLOGD_OPTS +} + +do_signal() +{ + start-stop-daemon --stop --quiet --signal $1 $2 --pidfile $PIDFILE --exec $DAEMON +} + +do_stop() +{ + do_signal TERM --oknodo +} + +do_reload() +{ + do_signal HUP +} + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_progress_msg "already started" + log_end_msg 0 ;; + *) log_end_msg 1 ;; + esac + ;; + + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0) log_end_msg 0 ;; + 1) log_progress_msg "already stopped" + log_end_msg 0 ;; + *) log_end_msg 1 ;; + esac + ;; + + reload) + log_daemon_msg "Reloading $DESC" "$NAME" + do_reload + case "$?" in + 0) log_end_msg 0 ;; + 1) log_progress_msg "not running" + log_end_msg 1 ;; + *) log_end_msg 1 ;; + esac + ;; + + restart|force-reload) + $0 stop + $0 start + ;; + + try-restart) + $0 status >/dev/null 2>&1 && $0 restart + ;; + + status) + status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + ;; + + *) + echo "Usage: $SCRIPTNAME {start|stop|reload|restart|force-reload|try-restart|status}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/libsyslog-dev.install b/debian/libsyslog-dev.install new file mode 100644 index 0000000..d57c0a9 --- /dev/null +++ b/debian/libsyslog-dev.install @@ -0,0 +1,6 @@ +usr/include/syslog/*.h +usr/lib/*/libsyslog.a +usr/lib/*/libsyslog.so +usr/lib/*/pkgconfig/lib*.pc +usr/share/doc/sysklogd/example/* +usr/share/man/man3/* diff --git a/debian/libsyslog0.install b/debian/libsyslog0.install new file mode 100644 index 0000000..3ddde58 --- /dev/null +++ b/debian/libsyslog0.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* diff --git a/debian/libsyslog0.symbols b/debian/libsyslog0.symbols new file mode 100644 index 0000000..7ef1b67 --- /dev/null +++ b/debian/libsyslog0.symbols @@ -0,0 +1,22 @@ +libsyslog.so.0 libsyslog0 #MINVER# +* Build-Depends-Package: libsyslog-dev + __pidfile@Base 2.0 + __pidfile_name@Base 2.0 + __pidfile_path@Base 2.0 + __strlcat@Base 2.0 + __strlcpy@Base 2.0 + __syslog_chk@Base 2.0 + closelog@Base 2.0 + closelog_r@Base 2.0 + openlog@Base 2.0 + openlog_r@Base 2.0 + setlogmask@Base 2.0 + setlogmask_r@Base 2.0 + syslog@Base 2.0 + syslog_r@Base 2.0 + syslogp@Base 2.0 + syslogp_r@Base 2.0 + vsyslog@Base 2.0 + vsyslog_r@Base 2.0 + vsyslogp@Base 2.0 + vsyslogp_r@Base 2.0 diff --git a/debian/logger.install b/debian/logger.install new file mode 100644 index 0000000..f3331b3 --- /dev/null +++ b/debian/logger.install @@ -0,0 +1,2 @@ +usr/bin/logger +usr/share/man/man1/logger.1 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..5609457 --- /dev/null +++ b/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +# export DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_CFLAGS_MAINT_APPEND = -g -Og -rdynamic + +%: + dh $@ --with autoreconf,systemd + +override_dh_installchangelogs: + dh_installchangelogs ChangeLog.md + +# Remove LICENSE and ChangeLog.md per Debian Policy +override_dh_auto_install: + dh_auto_install + rm -v debian/tmp/usr/share/doc/sysklogd/LICENSE + rm -v debian/tmp/usr/share/doc/sysklogd/ChangeLog.md + +override_dh_auto_test: + $(MAKE) check diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/debian/syslogd.default b/debian/syslogd.default new file mode 100644 index 0000000..ed51ae0 --- /dev/null +++ b/debian/syslogd.default @@ -0,0 +1,7 @@ +# +# syslogd defaults +# + +# Secure mode enabled, forwarding to remote servers allowed, disable +# with another '-s', logging from remote servers disallowed. +SYSLOGD_OPTS="-s" diff --git a/debian/syslogd.install b/debian/syslogd.install new file mode 100644 index 0000000..aef0b91 --- /dev/null +++ b/debian/syslogd.install @@ -0,0 +1,5 @@ +syslog.conf etc +lib/systemd/system/syslogd.service +usr/sbin/syslogd +usr/share/man/man5/syslog.conf.5 +usr/share/man/man8/syslogd.8