From 8046d7c25dce7dd6af0642b570944bc165f865fa Mon Sep 17 00:00:00 2001 From: Andreas Messer Date: Sat, 6 Jan 2018 18:59:31 +0100 Subject: [PATCH] Fix several issues found by review --- debian/changelog | 4 +- debian/control | 35 ++++----- debian/copyright | 81 ++++++++++++++++++++ debian/elogind.init | 133 +++++++++++++++------------------ debian/elogind.install | 22 +++--- debian/extra/elogind | 2 +- debian/libelogind-data.install | 1 - debian/libelogind-dev.install | 8 +- debian/libelogind.install | 1 - debian/libelogind0.install | 2 + debian/libpam-elogind.postinst | 2 - debian/libpam-elogind.prerm | 4 +- debian/rules | 25 ++++--- 13 files changed, 188 insertions(+), 132 deletions(-) delete mode 100644 debian/libelogind-data.install delete mode 100644 debian/libelogind.install create mode 100644 debian/libelogind0.install diff --git a/debian/changelog b/debian/changelog index 9b83d23a6..a6e2a20a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -elogind (234.4-devuan1) experimental; urgency=medium +elogind (234.4-1~exp1) experimental; urgency=medium - * Initial release. (Closes: #XXXXXX) + * Initial release. -- Andreas Messer Thu, 04 Jan 2018 19:26:09 +0100 diff --git a/debian/control b/debian/control index 2ab734c4a..98229f51d 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 3.9.8 Vcs-Git: https://git.devuan.org/amesser/elogind.git Vcs-Browser: https://git.devuan.org/amesser/elogind.git Homepage: https://github.com/elogind/elogind -Build-Depends: debhelper, +Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.0), pkg-config, docbook-xsl, @@ -32,19 +32,21 @@ Package: elogind Section: admin Priority: optional Architecture: linux-any -Multi-Arch: same +Multi-Arch: foreign Pre-Depends: debconf, ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, - libelogind (= ${binary:Version}), - libpam-elogind (= ${binary:Version}) -Recommends: dbus (>= 1.4), policykit-1 + libelogind0 (= ${binary:Version}), + libpam-elogind (= ${binary:Version}), + lsb-base (>= 3.1), + dbus (>= 1.4) +Recommends: policykit-1 Conflicts: openrc Description: user, seat and session management daemon elogind is a session management daemon extracted from systmd project's "logind" -Package: libelogind +Package: libelogind0 Section: libs Priority: optional Architecture: linux-any @@ -52,17 +54,8 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, - libelogind (= ${binary:Version}), - libelogind-data (= ${binary:Version}) -Description: libelogind shared library - This library provides access to elongd session management - -Package: libelogind-data -Section: libs -Priority: optional -Architecture: all -Description: elogind common data - This package contains common files of elogind and libelogind +Description: user, seat and session management library + This library provides access to elogind session management Package: libelogind-dev Section: libdevel @@ -72,8 +65,8 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, - libelogind (= ${binary:Version}) -Description: libelogind development files + libelogind0 (= ${binary:Version}) +Description: user, seat and session management library (development files) This package contains the files needed for developing applications that use libelogind @@ -87,4 +80,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime Provides: libpam-systemd -Description: elogind PAM module +Description: elogind PAM module + Plugable Authentication Module to register a session with elogind + diff --git a/debian/copyright b/debian/copyright index e69de29bb..32a58310b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -0,0 +1,81 @@ +Format-Specification: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0 +Upstream-Name: elogind +Source: https://github.com/elogind/elogind + +Files: * +Copyright: 2010-2016 Lennart Poettering + 2008-2013 Kay Sievers + 2013-2017 Zbigniew Jędrzejewski-Szmek + 2014-2015 Tom Gundersen + 2014-2015 Ronny Chevalier + 1994-2014 Free Software Foundation, Inc. + 2005-2014 Rich Felker, et al. + 1999,2000 Tom Tromey + 2000,2005 Red Hat, Inc. + 2010 Harald Hoyer + 2010 Ran Benita + 2012 Josh Triplett + 2013 Intel Corporation + 2013 Daniel Buch + 2013 Dave Reisner + 2013 David Herrmann + 2013 David Strauss + 2013 Holger Hans Peter Freyther + 2013 Jan Janssen + 2013 Shawn Landden + 2013 Thomas H.P. Andersen + 2014 Emil Renner Berthing + 2014 Michael Marineau + 2014 Michal Schmidt + 2015 Daniel Mack + 2016 Julian Orth + 2016 Alexander Shopov + 2017 Sven Eden +License: LGPL-2.1+ + +Files: src/basic/siphash24.c + src/basic/siphash24.h +Copyright: 2012 Jean-Philippe Aumasson + 2012 Daniel J. Bernstein +License: CC0-1.0 + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + . + You should have received a copy of the CC0 Public Domain Dedication along with + this software. If not, see . + +Files: man/glib-event-glue.c: +Copyright: 2014 Tom Gundersen +License: + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + +Files: debian/* +Copyright: 2018 Andreas Messer +License: LGPL-2.1+ + +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library 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 + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU Lesser General Public + License version 2 can be found in the file + `/usr/share/common-licenses/LGPL-2.1'. + diff --git a/debian/elogind.init b/debian/elogind.init index 6c1177e3e..e08335f91 100644 --- a/debian/elogind.init +++ b/debian/elogind.init @@ -1,19 +1,19 @@ #! /bin/sh - ### BEGIN INIT INFO -# Provides: logind -# Required-Start: $dbus $remote_fs $syslog -# Required-Stop: $dbus $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: -# Short-Description: elogind session management daemon +# Provides: elogind +# Required-Start: dbus $remote_fs $syslog +# Required-Stop: dbus $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start elogind at boot tim +# Description: Enable user and session management by elogind ### END INIT INFO set -e # /etc/init.d/elogind: start and stop the elogind session management daemon -ELOGIND=/lib/elogind/elogind +ELOGIND=/usr/sbin/elogind test -x $ELOGIND || exit 0 @@ -22,82 +22,67 @@ umask 022 . /lib/lsb/init-functions ELOGIND_OPTS="-D" - -# Are we running from init? -run_by_init() { - ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ] -} - -check_for_upstart() { - if init_is_upstart; then - exit $1 - fi -} +ELOGIND_PID=/run/elogind.pid export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" case "$1" in start) - check_for_upstart 1 - log_daemon_msg "Starting session management daemon" "elogind" || true - if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogin.pid --exec $ELOGIND -- $ELOGIND_OPTS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; + log_daemon_msg "Starting session management daemon" "elogind" || true + if start-stop-daemon --start --quiet --oknodo --pidfile $ELOGIND_PID --exec $ELOGIND -- $ELOGIND_OPTS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; stop) - check_for_upstart 0 - log_daemon_msg "Stopping session management daemon" "elogind" || true - if start-stop-daemon --stop --quiet --oknodo --pidfile /run/elogind.pid; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; + log_daemon_msg "Stopping session management daemon" "elogind" || true + if start-stop-daemon --stop --quiet --oknodo --pidfile $ELOGIND_PID; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; reload|force-reload|restart) - check_for_upstart 1 - log_daemon_msg "Restarting session management daemon" "elogind" || true - start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /run/elogind.pid - if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogind.pid --exec $ELOGIND -- $ELOGIND_OPTS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; + log_daemon_msg "Restarting session management daemon" "elogind" || true + start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $ELOGIND_PID + if start-stop-daemon --start --quiet --oknodo --pidfile $ELOGIND_PID --exec $ELOGIND -- $ELOGIND_OPTS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; try-restart) - check_for_upstart 1 - log_daemon_msg "Restarting session management daemon" "elogind" || true - RET=0 - start-stop-daemon --stop --quiet --retry 30 --pidfile /run/elogind.pid || RET="$?" - case $RET in - 0) - # old daemon stopped - if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogind.pid --exec $ELOGIND -- $ELOGIND_OPTS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - 1) - # daemon not running - log_progress_msg "(not running)" || true - log_end_msg 0 || true - ;; - *) - # failed to stop - log_progress_msg "(failed to stop)" || true - log_end_msg 1 || true - ;; - esac - ;; + log_daemon_msg "Restarting session management daemon" "elogind" || true + RET=0 + start-stop-daemon --stop --quiet --retry 30 --pidfile $ELOGIND_PID || RET="$?" + case $RET in + 0) + # old daemon stopped + if start-stop-daemon --start --quiet --oknodo --pidfile $ELOGIND_PID --exec $ELOGIND -- $ELOGIND_OPTS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + 1) + # daemon not running + log_progress_msg "(not running)" || true + log_end_msg 0 || true + ;; + *) + # failed to stop + log_progress_msg "(failed to stop)" || true + log_end_msg 1 || true + ;; + esac + ;; status) - check_for_upstart 1 - status_of_proc -p /run/elogind.pid $ELOGIND elogind && exit 0 || exit $? - ;; + status_of_proc -p $ELOGIND_PID $ELOGIND elogind && exit 0 || exit $? + ;; *) - log_action_msg "Usage: /etc/init.d/elogind {start|stop|reload|force-reload|restart|try-restart|status}" || true - exit 1 + log_action_msg "Usage: /etc/init.d/elogind {start|stop|reload|force-reload|restart|try-restart|status}" || true + exit 1 esac exit 0 diff --git a/debian/elogind.install b/debian/elogind.install index 9483f24aa..9b48429ad 100644 --- a/debian/elogind.install +++ b/debian/elogind.install @@ -1,16 +1,16 @@ -bin/loginctl -bin/elogind-inhibit +usr/bin/ etc/elogind/logind.conf -lib/elogind/elogind -lib/elogind/elogind-cgroups-agent -lib/udev/rules.d/*.rules -usr/share/bash-completion/* -usr/share/dbus-1/* -usr/share/doc/elogind/* -usr/share/factory/* +/usr/lib/elogind/elogind /usr/sbin/ +/usr/lib/elogind/elogind-cgroups-agent +lib/udev/rules.d/ +usr/share/bash-completion/ +usr/share/dbus-1/ +# Skip license files in /usr/share/doc/elogind +usr/share/doc/elogind/README +usr/share/doc/elogind/NEWS usr/share/man/man1/loginctl.1 usr/share/man/man5/logind.conf.5 usr/share/man/man7/elogind.*.7 usr/share/man/man8/elogind.8 -usr/share/polkit-1/* -usr/share/zsh/* +usr/share/polkit-1/ +usr/share/zsh/ diff --git a/debian/extra/elogind b/debian/extra/elogind index e66eebb6d..54cdb520b 100644 --- a/debian/extra/elogind +++ b/debian/extra/elogind @@ -1,5 +1,5 @@ Name: elogind Session Management -Default: yes +Default: no Priority: 0 Session-Interactive-Only: yes Session-Type: Additional diff --git a/debian/libelogind-data.install b/debian/libelogind-data.install deleted file mode 100644 index 3270a4849..000000000 --- a/debian/libelogind-data.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/locale/* diff --git a/debian/libelogind-dev.install b/debian/libelogind-dev.install index 70f3e5bf3..e090c36c0 100644 --- a/debian/libelogind-dev.install +++ b/debian/libelogind-dev.install @@ -1,6 +1,4 @@ -usr/lib/*/pkgconfig/libelogind.pc -lib/*/security/pam_elogind.la -lib/*/libelogind.la -usr/include/elogind/* -usr/include/elogind/systemd/* +usr/include/elogind/ +usr/lib/*/libelogind.so +usr/lib/*/pkgconfig/ usr/share/man/man3/* diff --git a/debian/libelogind.install b/debian/libelogind.install deleted file mode 100644 index 964806c1d..000000000 --- a/debian/libelogind.install +++ /dev/null @@ -1 +0,0 @@ -lib/*/libelogind.so.* diff --git a/debian/libelogind0.install b/debian/libelogind0.install new file mode 100644 index 000000000..1a0e7e1d7 --- /dev/null +++ b/debian/libelogind0.install @@ -0,0 +1,2 @@ +usr/lib/*/libelogind.so.* +usr/share/locale diff --git a/debian/libpam-elogind.postinst b/debian/libpam-elogind.postinst index 9310a1408..96c6817ea 100755 --- a/debian/libpam-elogind.postinst +++ b/debian/libpam-elogind.postinst @@ -3,5 +3,3 @@ set -e pam-auth-update --package - - diff --git a/debian/libpam-elogind.prerm b/debian/libpam-elogind.prerm index 11329dd13..3c25c6451 100755 --- a/debian/libpam-elogind.prerm +++ b/debian/libpam-elogind.prerm @@ -3,7 +3,5 @@ set -e if [ "$1" = remove ]; then - pam-auth-update --package --remove consolekit + pam-auth-update --package --remove elogind fi - - diff --git a/debian/rules b/debian/rules index 1207d9174..76f29f0d4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,23 +1,24 @@ #! /usr/bin/make -f -DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +# The options have been chooses as follows: +# - manually set pamlibdir because we'Re installing in /usr by default but +# pam libs must go to /lib/*/security +# - Disable lto because this makes the build fail with static library +# warnings and with linking errors. (It seems taht instead of ar/ld +# gcc-ar and gcc should be used) +# - tests disabled beacuase some of the tests seem to require elogind running. +# Need to sort out which tests could be run -# disable lto because this does not work for me. Building static libraries with i -# libtool/ar failes. I think this a apackage problem, it should use gcc-ar instead -# also some of the tests fail CONFFLAGS = \ - --exec-prefix= \ - --with-rootprefix= \ - --with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \ - --enable-kdbus \ + --with-pamlibdir=/lib/$(DEB_HOST_MULTIARCH)/security \ --disable-lto \ --disable-tests -autoreconf: - ./autogen.sh +#autoreconf: +# ./autogen.sh -override_dh_autoreconf: - dh_autoreconf debian/rules -- autoreconf +#override_dh_autoreconf: +# dh_autoreconf debian/rules -- autoreconf override_dh_auto_configure: dh_auto_configure --builddirectory=build \ -- 2.30.2