summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2020-06-08 21:30:18 +0200
committer Eric Hameleers <alien@slackware.com>2020-06-08 21:30:18 +0200
commite41c0c99c8d498cc2f3761eb35d4f5389a6d1798 (patch)
tree3b0294e2874f1a34943eeb9a19682313ba43e6c2
parentf6a28c20081bd24619074c99ddfeb1932b09df2f (diff)
downloadktown-e41c0c99c8d498cc2f3761eb35d4f5389a6d1798.tar.gz
ktown-e41c0c99c8d498cc2f3761eb35d4f5389a6d1798.tar.xz
Proposed changes for a migration from ConsoleKit2 to elogind
Using elogind will enable a fully working Wayland session for KDE Plasma5.
-rw-r--r--README.elogind24
-rwxr-xr-xdeps/accountsservice/accountsservice.SlackBuild14
-rwxr-xr-xdeps/autoconf-archive/autoconf-archive.SlackBuild70
-rw-r--r--deps/autoconf-archive/autoconf-archive.info10
-rw-r--r--deps/autoconf-archive/slack-desc19
-rw-r--r--deps/dbus/dbus-1.12.x-allow_root_globally.diff18
-rw-r--r--deps/dbus/dbus-enable-elogind.patch73
-rwxr-xr-xdeps/dbus/dbus.SlackBuild166
-rw-r--r--deps/dbus/dbus.url1
-rw-r--r--deps/dbus/doinst.sh.gzbin0 -> 394 bytes
-rw-r--r--deps/dbus/rc.messagebus.gzbin0 -> 816 bytes
-rw-r--r--deps/dbus/slack-desc18
-rw-r--r--deps/elogind/.url3
-rwxr-xr-xdeps/elogind/doinst.sh6
-rwxr-xr-xdeps/elogind/elogind.SlackBuild180
-rw-r--r--deps/elogind/rc.elogind59
-rw-r--r--deps/polkit/0001-configure-fix-elogind-support.patch.gzbin0 -> 610 bytes
-rw-r--r--deps/polkit/10-org.freedesktop.NetworkManager.rules7
-rw-r--r--deps/polkit/20-plugdev-group-mount-override.rules16
-rw-r--r--deps/polkit/doinst.sh.gzbin0 -> 547 bytes
-rw-r--r--deps/polkit/dont-set-wheel-group-as-admin.diff.gzbin0 -> 292 bytes
-rwxr-xr-xdeps/polkit/polkit.SlackBuild190
-rw-r--r--deps/polkit/slack-desc19
-rw-r--r--deps/util-linux/adjtimex_1.29-2.2.diff.gzbin0 -> 53236 bytes
-rw-r--r--deps/util-linux/bsdstrings-util-linux_overflow.diff.gzbin0 -> 434 bytes
-rw-r--r--deps/util-linux/ddate.1115
-rw-r--r--deps/util-linux/ddate.c399
-rw-r--r--deps/util-linux/doinst.sh.gzbin0 -> 427 bytes
-rw-r--r--deps/util-linux/pam.d-su/su11
-rw-r--r--deps/util-linux/pam.d-su/su-l6
-rw-r--r--deps/util-linux/pam.d/chfn6
-rw-r--r--deps/util-linux/pam.d/chsh6
-rw-r--r--deps/util-linux/pam.d/login15
-rw-r--r--deps/util-linux/pam.d/runuser5
-rw-r--r--deps/util-linux/pam.d/runuser-l4
-rw-r--r--deps/util-linux/rc.setterm13
-rw-r--r--deps/util-linux/scsi_ioctl.h48
-rw-r--r--deps/util-linux/setserial-rc.serial.diff.gzbin0 -> 729 bytes
-rw-r--r--deps/util-linux/setserial-undef_TIOCGHAYESESP.diff.gzbin0 -> 376 bytes
-rw-r--r--deps/util-linux/slack-desc19
-rw-r--r--deps/util-linux/su.default3
-rwxr-xr-xdeps/util-linux/util-linux.SlackBuild381
-rw-r--r--deps/util-linux/util-linux.do.not.list.ram.devices.diff.gzbin0 -> 275 bytes
-rw-r--r--deps/util-linux/util-linux.fdisk-no-solaris.diff.gzbin0 -> 335 bytes
-rw-r--r--deps/util-linux/ziptool-fix_build.patch.gzbin0 -> 386 bytes
-rw-r--r--kde/build/kjots2
-rw-r--r--kde/build/plasma-workspace1
-rw-r--r--kde/build/polkit-kde-framework1
-rw-r--r--kde/build/powerdevil1
-rw-r--r--kde/build/sddm-qt52
-rw-r--r--kde/cmake/sddm-qt516
-rw-r--r--kde/doinst.sh/powerdevil7
-rw-r--r--kde/kde.options6
-rw-r--r--kde/modules/plasma1
-rw-r--r--kde/patch/sddm-qt5.patch27
-rw-r--r--kde/patch/sddm-qt5/sddm_honor-PAM-supplemental-groups-v2.patch183
-rw-r--r--kde/patch/sddm-qt5/sddm_revert-honor-PAM-supplemental-groups.patch88
-rw-r--r--kde/post-install/plasma-workspace/pam.d/kde3
-rw-r--r--kde/post-install/plasma-workspace/scripts/startkwayland7
-rw-r--r--kde/post-install/powerdevil.post-install37
-rw-r--r--kde/post-install/powerdevil/10-enable-ck2-poweroff.rules12
-rw-r--r--kde/post-install/powerdevil/10-enable-elogind-poweroff.rules12
-rw-r--r--kde/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules9
-rw-r--r--kde/post-install/powerdevil/10-enable-suspend.rules10
-rw-r--r--kde/post-install/powerdevil/10-enable-upower-suspend.rules9
-rw-r--r--kde/post-install/powerdevil/30-org.freedesktop.upower.pkla9
-rw-r--r--kde/post-install/powerdevil/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla8
-rw-r--r--kde/post-install/powerdevil/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla7
-rw-r--r--kde/post-install/sddm-qt5.post-install13
-rw-r--r--kde/post-install/sddm-qt5/pam.d/sddm3
-rw-r--r--kde/post-install/sddm-qt5/pam.d/sddm-autologin3
-rw-r--r--kde/post-install/sddm-qt5/pam.d/sddm-greeter1
72 files changed, 2227 insertions, 175 deletions
diff --git a/README.elogind b/README.elogind
new file mode 100644
index 0000000..6baf135
--- /dev/null
+++ b/README.elogind
@@ -0,0 +1,24 @@
+Replacing ConsoleKit2 with elogind
+----------------------------------
+
+# Sources are updates to check for existence of libelogind. If this is not
+# present, the scripts assume ConsoleKit2 is used instead.
+
+# Remove:
+ConsoleKit2
+
+# Compile:
+deps:elogind
+
+# Recompile Slackware packages:
+util-linux (with PAM files that mention elogind instead of pam_ck_connector)
+dbus (enable elogind support). Depends on autoconf-archive to compile!
+polkit (enable elogind support)
+
+# Recompile:
+deps:accountsservice
+plasma:plasma-workspace,powerdevil
+plasma-extra:sddm-qt5
+
+
+
diff --git a/deps/accountsservice/accountsservice.SlackBuild b/deps/accountsservice/accountsservice.SlackBuild
index e5d65ca..8ad729a 100755
--- a/deps/accountsservice/accountsservice.SlackBuild
+++ b/deps/accountsservice/accountsservice.SlackBuild
@@ -26,7 +26,7 @@
PKGNAM=accountsservice
VERSION=${VERSION:-0.6.55}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
CWD=$(pwd)
TMP=${TMP:-/tmp}
@@ -80,6 +80,13 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Choose correct options depending on whether elogind is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libelogind.so.? ]; then
+ DO_ELOGIND=true
+else
+ DO_ELOGIND=false
+fi
+
export LDFLAGS="$SLKLDFLAGS"
export CXXFLAGS="$SLKCFLAGS"
export CFLAGS="$SLKCFLAGS"
@@ -89,9 +96,10 @@ meson build \
--mandir=/usr/man \
--localstatedir=/var \
--sysconfdir=/etc \
- -D admin-group=wheel \
+ -D admin_group=wheel \
-D docbook=false \
- -D gtk-doc=true \
+ -D gtk_doc=true \
+ -D elogind=${DO_ELOGIND} \
-D systemd=false \
-D systemdsystemunitdir=no \
-D user_heuristics=false \
diff --git a/deps/autoconf-archive/autoconf-archive.SlackBuild b/deps/autoconf-archive/autoconf-archive.SlackBuild
new file mode 100755
index 0000000..2a93c07
--- /dev/null
+++ b/deps/autoconf-archive/autoconf-archive.SlackBuild
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# Slackware build script for autoconf-archive
+
+# Copyright 2018-2019 Hunter Sezen California, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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.
+
+PKGNAM=autoconf-archive
+VERSION=${VERSION:-2019.01.06}
+BUILD=${BUILD:-1}
+
+ARCH=noarch
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz
+cd $PKGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+[ ! -x configure ] && autoreconf -vif
+
+./configure \
+ --prefix=/usr \
+ --infodir=/usr/info \
+ --docdir=/usr/doc/$PKGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+rm -f $PKG/usr/info/dir
+gzip -9 $PKG/usr/info/*.info*
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a ChangeLog INSTALL NEWS TODO $PKG/usr/doc/$PKGNAM-$VERSION
+cat $CWD/$PKGNAM.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/deps/autoconf-archive/autoconf-archive.info b/deps/autoconf-archive/autoconf-archive.info
new file mode 100644
index 0000000..cfda18c
--- /dev/null
+++ b/deps/autoconf-archive/autoconf-archive.info
@@ -0,0 +1,10 @@
+PRGNAM="autoconf-archive"
+VERSION="2019.01.06"
+HOMEPAGE="https://www.gnu.org/software/autoconf-archive/"
+DOWNLOAD="https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2019.01.06.tar.xz"
+MD5SUM="d46413c8b00a125b1529bae385bbec55"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Hunter Sezen"
+EMAIL="orbea@riseup.net"
diff --git a/deps/autoconf-archive/slack-desc b/deps/autoconf-archive/slack-desc
new file mode 100644
index 0000000..5264c36
--- /dev/null
+++ b/deps/autoconf-archive/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+autoconf-archive: autoconf-archive (GNU Autoconf macros)
+autoconf-archive:
+autoconf-archive: The GNU Autoconf Archive is a collection of more than 500 macros for
+autoconf-archive: GNU Autoconf that have been contributed as free software by friendly
+autoconf-archive: supporters of the cause from all over the Internet.
+autoconf-archive:
+autoconf-archive: Homepage: https://www.gnu.org/software/autoconf-archive/
+autoconf-archive:
+autoconf-archive:
+autoconf-archive:
+autoconf-archive:
diff --git a/deps/dbus/dbus-1.12.x-allow_root_globally.diff b/deps/dbus/dbus-1.12.x-allow_root_globally.diff
new file mode 100644
index 0000000..2ff5a53
--- /dev/null
+++ b/deps/dbus/dbus-1.12.x-allow_root_globally.diff
@@ -0,0 +1,18 @@
+diff -Nur dbus-1.12.0.orig/bus/system.conf.in dbus-1.12.0/bus/system.conf.in
+--- dbus-1.12.0.orig/bus/system.conf.in 2017-10-30 07:26:18.000000000 -0500
++++ dbus-1.12.0/bus/system.conf.in 2017-10-31 00:17:34.989634085 -0500
+@@ -125,6 +125,14 @@
+ <!-- <limit name="max_match_rules_per_connection">512</limit> -->
+ <!-- <limit name="max_replies_per_connection">128</limit> -->
+
++ <!-- Allow root to do anything over the messagebus.
++ Don't whine about "security" - anyone with root privileges
++ can edit this file anyway, so -ENOHOLE here. -->
++ <policy user="root">
++ <allow send_destination="*"/>
++ <allow send_interface="*"/>
++ </policy>
++
+ <!-- Config files are placed here that among other things, punch
+ holes in the above policy for specific services. -->
+ <includedir>system.d</includedir>
diff --git a/deps/dbus/dbus-enable-elogind.patch b/deps/dbus/dbus-enable-elogind.patch
new file mode 100644
index 0000000..5cb5d64
--- /dev/null
+++ b/deps/dbus/dbus-enable-elogind.patch
@@ -0,0 +1,73 @@
+--- a/dbus/dbus-userdb-util.c 2015-09-30 16:48:40.000000000 +0200
++++ b/dbus/dbus-userdb-util.c 2016-11-03 11:09:42.550520587 +0100
+@@ -32,6 +32,9 @@
+ #if HAVE_SYSTEMD
+ #include <systemd/sd-login.h>
+ #endif
++#if HAVE_ELOGIND
++#include <elogind/sd-login.h>
++#endif
+
+ /**
+ * @addtogroup DBusInternalsUtils
+@@ -54,7 +57,7 @@
+ const DBusUserInfo *info;
+ dbus_bool_t result = FALSE;
+
+-#ifdef HAVE_SYSTEMD
++#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
+ /* check if we have logind */
+ if (access ("/run/systemd/seats/", F_OK) >= 0)
+ {
+--- a/configure.ac 2016-11-03 11:13:58.286528265 +0100
++++ b/configure.ac 2016-11-03 11:22:11.210543063 +0100
+@@ -185,6 +185,7 @@
+ AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
+ AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
+ AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
++AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind],[build with elogind user seat support]),enable_elogind=$enableval,enable_elogind=auto)
+ AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
+
+ AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
+@@ -1184,6 +1185,24 @@
+
+ AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
+
++dnl elogind detection
++if test x$enable_elogind = xno ; then
++ have_elogind=no;
++else
++ PKG_CHECK_MODULES([ELOGIND],
++ [libelogind >= 209],
++ [have_elogind=yes],
++ [have_elogind=no])
++fi
++
++if test x$have_elogind = xyes; then
++ AC_DEFINE(HAVE_ELOGIND,1,[Have elogind])
++fi
++
++if test x$enable_elogind = xyes -a x$have_elogind != xyes ; then
++ AC_MSG_ERROR([Explicitly requested elogind support, but libelogind not found])
++fi
++
+ dnl systemd detection
+ if test x$enable_systemd = xno ; then
+ have_systemd=no;
+@@ -1290,7 +1309,7 @@
+ fi
+
+ #### Set up final flags
+-LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS"
++LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $ELOGIND_LIBS"
+ AC_SUBST([LIBDBUS_LIBS])
+
+ ### X11 detection
+@@ -1949,6 +1968,7 @@
+ Building AppArmor support: ${have_apparmor}
+ Building inotify support: ${have_inotify}
+ Building kqueue support: ${have_kqueue}
++ Building elogind support: ${have_elogind}
+ Building systemd support: ${have_systemd}
+ Building X11 code: ${have_x11}
+ Building Doxygen docs: ${enable_doxygen_docs}
diff --git a/deps/dbus/dbus.SlackBuild b/deps/dbus/dbus.SlackBuild
new file mode 100755
index 0000000..56c33c6
--- /dev/null
+++ b/deps/dbus/dbus.SlackBuild
@@ -0,0 +1,166 @@
+#!/bin/bash
+
+# Copyright 2007-2010 Robby Workman, Northport, Alabama, USA
+# Copyright 2007-2018 Patrick Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+
+# Modified 2020 by Eric Hameleers to add support for elogind.
+
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=dbus
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-2}
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+cat $CWD/dbus-1.12.x-allow_root_globally.diff | patch -p1 --verbose || exit 1
+cat $CWD/dbus-enable-elogind.patch | patch -p1 --verbose || exit 1
+
+NOCONFIGURE=1 ./autogen.sh || exit 1
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --docdir=/usr/doc/$PKGNAM-$VERSION \
+ --disable-doxygen-docs \
+ --disable-apparmor \
+ --disable-selinux \
+ --enable-shared=yes \
+ --enable-static=no \
+ --enable-inotify \
+ --enable-user-session \
+ --enable-x11-autolaunch \
+ --enable-elogind \
+ --disable-systemd \
+ --without-systemdsystemunitdir \
+ --with-system-pid-file=/var/run/dbus/dbus.pid \
+ --with-system-socket=/var/run/dbus/system_bus_socket \
+ --with-console-auth-dir=/var/run/console \
+ --build=$ARCH-slackware-linux || exit 1
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" \
+ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Install a custom init script for dbus - the included one is not good for us
+mkdir -p $PKG/etc/rc.d
+zcat $CWD/rc.messagebus.gz > $PKG/etc/rc.d/rc.messagebus.new
+chmod 0755 $PKG/etc/rc.d/rc.messagebus.new
+
+# Fix some directory ownership
+chown messagebus $PKG/var/lib/dbus
+
+# Add documentation
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ AUTHORS COPYING* HACKING INSTALL NEWS README* doc/*.{txt,html,dtd} \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+find $PKG/usr/doc/$PKGNAM-$VERSION -type f -exec chmod 0644 {} \+
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/deps/dbus/dbus.url b/deps/dbus/dbus.url
new file mode 100644
index 0000000..ab5a193
--- /dev/null
+++ b/deps/dbus/dbus.url
@@ -0,0 +1 @@
+http://dbus.freedesktop.org/releases/dbus/
diff --git a/deps/dbus/doinst.sh.gz b/deps/dbus/doinst.sh.gz
new file mode 100644
index 0000000..c116f02
--- /dev/null
+++ b/deps/dbus/doinst.sh.gz
Binary files differ
diff --git a/deps/dbus/rc.messagebus.gz b/deps/dbus/rc.messagebus.gz
new file mode 100644
index 0000000..6c002bb
--- /dev/null
+++ b/deps/dbus/rc.messagebus.gz
Binary files differ
diff --git a/deps/dbus/slack-desc b/deps/dbus/slack-desc
new file mode 100644
index 0000000..524723d
--- /dev/null
+++ b/deps/dbus/slack-desc
@@ -0,0 +1,18 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+ |-----handy-ruler------------------------------------------------------|
+dbus: dbus (D-Bus message bus system)
+dbus:
+dbus: D-Bus supplies both a system daemon (for events such as "new hardware
+dbus: device added" or "printer queue changed") and a per user login
+dbus: session daemon (for general IPC needs among user applications).
+dbus: Also, the message bus is built on top of a general one-to-one message
+dbus: passing framework, which can be used by any two apps to communicate
+dbus: directly (without going through the message bus daemon).
+dbus:
+dbus: Homepage: https://dbus.freedesktop.org/
+dbus:
diff --git a/deps/elogind/.url b/deps/elogind/.url
index 444f958..2fd0c45 100644
--- a/deps/elogind/.url
+++ b/deps/elogind/.url
@@ -1,2 +1 @@
-https://github.com/wingo/elogind/archive/v219.12.tar.gz
-https://github.com/wingo/elogind/archive/master.zip
+https://github.com/elogind/elogind/archive/v243.7.tar.gz
diff --git a/deps/elogind/doinst.sh b/deps/elogind/doinst.sh
index 75adb23..5fd6b44 100755
--- a/deps/elogind/doinst.sh
+++ b/deps/elogind/doinst.sh
@@ -26,8 +26,14 @@ preserve_perms() {
#
# Preserve permissions while moving into place:
+config etc/elogind/logind.conf.new
preserve_perms etc/rc.d/rc.elogind.new
+if pgrep -f elogind-daemon | grep -q 'elogind-daemon'; then
+ echo "Reloading elogind-daemon..."
+ pkill -HUP -f elogind-daemon
+fi
+
#
# Update rc.local so that elogind will be functional after boot:
if ! grep "rc.elogind" etc/rc.d/rc.local 1>/dev/null 2>/dev/null ; then
diff --git a/deps/elogind/elogind.SlackBuild b/deps/elogind/elogind.SlackBuild
index b9d2d70..66e65a0 100755
--- a/deps/elogind/elogind.SlackBuild
+++ b/deps/elogind/elogind.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright 2016 Patrick J. Volkerding, Sebeka, MN, USA
-# Copyright 2016, 2017 Eric Hameleers, Eindhoven, NL
+# Copyright 2016, 2017, 2020 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -22,54 +22,52 @@
# SUCH DAMAGE.
# -----------------------------------------------------------------------------
+# Thanks to Widya Walesa for script improvements.
-PKGNAM=elogind
-VERSION=${VERSION:-219.14}
-BUILD=${BUILD:-2}
+cd $(dirname $0) ; CWD=$(pwd)
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PKGNAM
+PKGNAM=elogind
+VERSION=${VERSION:-243.7}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+MARCH=$( uname -m )
+if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+fi
-# We do not use PAM by default:
-USE_PAM=${USE_PAM:-"NO"}
-[ "$USE_PAM" = "NO" -o "$USE_PAM" = "no" ] && DO_PAM="dis" || DO_PAM="en"
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
-if [ -e $CWD/machine.conf ]; then
- . $CWD/machine.conf ]
-elif [ -e /etc/slackbuild/machine.conf ]; then
- . /etc/slackbuild/machine.conf ]
+# Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-O2 -march=armv5te"
+ LIBDIRSUFFIX=""
else
- # Automatically determine the architecture we're building on:
- MARCH=$( uname -m )
- if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i486 ;;
- arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
- esac
- fi
- # Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
- if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
- LIBDIRSUFFIX=""
- elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
- elif [ "$ARCH" = "armv7hl" ]; then
- SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
- LIBDIRSUFFIX=""
- elif [ "$ARCH" = "arm" ]; then
- SLKCFLAGS="-O2 -march=armv5te"
- LIBDIRSUFFIX=""
- else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- fi
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
case "$ARCH" in
@@ -77,6 +75,9 @@ case "$ARCH" in
*) TARGET=$ARCH-slackware-linux ;;
esac
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
@@ -84,16 +85,14 @@ rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.gz || exit 1
cd $PKGNAM-$VERSION || exit 1
+# Our nobody user has UIDNumber 99, not 65534:
+sed -e "s/65534/99/g" -i $(grep -lr 65534 .)
+
# Launch elogind when called via DBus and make sure its rundir exists
# (in Slackware, /run is mounted as a tmpfs):
-sed -i src/login/org.freedesktop.login1.service \
- -e "s,/bin/false,/bin/bash -c \"[[ ! -d /run/systemd ]] \&\& mkdir /run/systemd;/usr/libexec/elogind/elogind\","
-
-# Apply Gentoo patches:
-#cat $CWD/patches/elogind-219.12-session.patch | patch -p1 --verbose || exit 1
-cat $CWD/patches/elogind-219.12-runtime.patch | patch -p1 --verbose || exit 1
-cat $CWD/patches/elogind-lrt.patch | patch -p1 --verbose || exit 1
-cat $CWD/patches/elogind-docs.patch | patch -p1 --verbose || exit 1
+sed -i src/login/org.freedesktop.login1.service.in \
+ -e "s,/bin/false,/lib${LIBDIRSUFFIX}/elogind,"
+
# Merge a pull request for an upstream fix:
cat $CWD/patches/elogind-polkit.patch | patch -p1 --verbose || exit 1
@@ -105,31 +104,54 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Thanks to Widya Walesa:
+# Slackware still using cgroup v1 or legacy mode. Check the outcome of:
+# [ $(stat -fc %T /sys/fs/cgroup/) = "cgroup2fs" ] && echo "unified" \
+# || ( [ -e /sys/fs/cgroup/unified/ ] && echo "hybrid" || echo "legacy")
+
# Configure:
-autoreconf -vif
-intltoolize
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --libexecdir=/usr/libexec \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --docdir=/usr/doc/$PKGNAM-$VERSION \
- --disable-seccomp \
- --disable-selinux \
- --disable-apparmor \
- --${DO_PAM}able-pam \
- --disable-smack \
- --disable-tests \
- --enable-split-usr \
- --build=$TARGET
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+meson \
+ --buildtype release \
+ --prefix /usr \
+ --libdir /usr/lib${LIBDIRSUFFIX} \
+ -Drootlibdir="/lib${LIBDIRSUFFIX}" \
+ -Drootlibexecdir="/lib${LIBDIRSUFFIX}/elogind" \
+ -Dudevrulesdir="/etc/udev/rules.d" \
+ -Ddocdir="/usr/doc/$PKGNAM-$VERSION" \
+ -Dhtmldir="/usr/doc/$PKGNAM-$VERSION/html" \
+ -Dmandir="/usr/man" \
+ -Dman=false \
+ -Dhtml=false \
+ -Dbashcompletiondir="/usr/share/bash-completion/completions" \
+ -Dnobody-group=nogroup \
+ -Dpam=true \
+ -Dpamlibdir="/lib${LIBDIRSUFFIX}/security" \
+ -Dpamconfdir="/etc/pam.d" \
+ -Dacl=true \
+ -Dsmack=false \
+ -Dutmp=true \
+ -Ddefault-hierarchy=legacy \
+ -Dcgroup-controller=elogind \
+ -Dhalt-path=/sbin/halt \
+ -Dpoweroff-path=/sbin/poweroff \
+ -Dreboot-path=/sbin/reboot \
+ -Ddefault-kill-user-processes=false \
+ build_elogind \
+ || exit 1
# Build and install:
-make || exit 1
-make install DESTDIR=$PKG || exit 1
+ninja -C build_elogind || exit 1
+DESTDIR=$PKG ninja install -C build_elogind || exit 1
+
+# Create symlinks for elogind binaries to /usr/bin/:
+mkdir -p $PKG/usr/bin
+ln -sf /bin/elogind-inhibit $PKG/usr/bin/elogind-inhibit
+ln -sf /bin/loginctl $PKG/usr/bin/loginctl
+
+# Make sure we do not overwrite the user's customizations:
+mv -i $PKG/etc/elogind/logind.conf{,.new}
# Strip binaries:
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
@@ -150,14 +172,18 @@ if [ -d $PKG/usr/man ]; then
)
fi
-# Add a rc script; Slackware does not support this out of the box:
+# Add a rc script; Slackware does not yet support this out of the box.
+# Preferably the rc code will get added right before starting rc.messagebus:
mkdir -p $PKG/etc/rc.d
-install -m 0755 $CWD/rc.elogind $PKG/etc/rc.d/rc.elogind.new
+cat $CWD/rc.elogind \
+ | sed -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \
+ > $PKG/etc/rc.d/rc.elogind.new
+chmod 755 $PKG/etc/rc.d/rc.elogind.new
# Add documentation:
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
- CODING_STYLE LICENSE* NEWS README TODO \
+ LICENSE* README* TODO \
$PKG/usr/doc/$PKGNAM-$VERSION
# Add a description and post-install script:
diff --git a/deps/elogind/rc.elogind b/deps/elogind/rc.elogind
index b1adcaa..e5e7324 100644
--- a/deps/elogind/rc.elogind
+++ b/deps/elogind/rc.elogind
@@ -1,9 +1,12 @@
#
# /etc/rc.d/rc.elogind
# Initializes the elogind service on Slackware.
+# There is no need to explicitly start a daemon; this will be taken
+# care of automatically by dbus when that starts.
#
# Author:
# Eric Hameleers <alien@slackware.com> 2016
+# Widya Walesa 2020
#
# Description:
# We use elogind (standalone subset extracted from systemd) instead of
@@ -13,17 +16,51 @@
# Slackware has a tmpfs mounted on /run (see rc.S).
#
-# The systemd/elogind state directory:
-mkdir -p /run/systemd
-chmod 0755 /run/systemd
+start_elogind() {
+ if [ -x /lib@LIBDIRSUFFIX@/elogind/elogind ]; then
+ if [ ! -d /run/user ]; then
+ mkdir -p /run/user
+ fi
+ if [ ! -d /run/systemd ]; then
+ mkdir -p /run/elogind /sys/fs/cgroup/elogind
+ ( cd /run; rm -rf systemd; ln -sf elogind systemd; )
+ ( cd /sys/fs/cgroup; rm -rf systemd; ln -sf elogind systemd; )
+ fi
+ if pgrep -l -F /run/elogind.pid 2>/dev/null | grep -q elogind; then
+ echo "Elogind is already running"
+ else
+ echo -n "Starting elogind: "
+ rm -f /run/elogind.pid
+ /lib@LIBDIRSUFFIX@/elogind/elogind --daemon
+ echo "/lib@LIBDIRSUFFIX@/elogind/elogind --daemon"
+ fi
+ fi
+}
-# Toplevel directory for runtime user session data:
-mkdir -p /run/user
-chmod 1777 /run/user
+stop_elogind() {
+ if pgrep -l -F /run/elogind.pid 2>/dev/null | grep -q elogind; then
+ echo -n "Stopping elogind: "
+ pkill -F /run/elogind.pid 2>/dev/null
+ echo "DONE"
+ else
+ echo "Elogind is not running"
+ fi
+}
+
+case "$1" in
+ start)
+ start_elogind
+ ;;
+ stop)
+ stop_elogind
+ ;;
+ restart)
+ stop_elogind
+ sleep 1
+ start_elogind
+ ;;
+ *)
+ echo "Usage: $0 start|stop|restart"
+esac
-# Elogind uses cgroups to organize processes like mapping PIDs to sessions.
-# Elogind's cgroup hierarchy isn't associated with any resource controller
-# ("subsystem") so we must create it manually:
-mkdir -p /sys/fs/cgroup/elogind
-mount -t cgroup -o none,name=elogind elogind /sys/fs/cgroup/elogind
diff --git a/deps/polkit/0001-configure-fix-elogind-support.patch.gz b/deps/polkit/0001-configure-fix-elogind-support.patch.gz
new file mode 100644
index 0000000..79547c3
--- /dev/null
+++ b/deps/polkit/0001-configure-fix-elogind-support.patch.gz
Binary files differ
diff --git a/deps/polkit/10-org.freedesktop.NetworkManager.rules b/deps/polkit/10-org.freedesktop.NetworkManager.rules
new file mode 100644
index 0000000..9d6557b
--- /dev/null
+++ b/deps/polkit/10-org.freedesktop.NetworkManager.rules
@@ -0,0 +1,7 @@
+polkit.addRule(function(action, subject) {
+ if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &&
+ subject.isInGroup("netdev")) {
+ return polkit.Result.YES;
+ }
+});
+
diff --git a/deps/polkit/20-plugdev-group-mount-override.rules b/deps/polkit/20-plugdev-group-mount-override.rules
new file mode 100644
index 0000000..c47a66c
--- /dev/null
+++ b/deps/polkit/20-plugdev-group-mount-override.rules
@@ -0,0 +1,16 @@
+/* http://udisks.freedesktop.org/docs/latest/udisks-polkit-actions.html */
+
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.udisks2.filesystem-mount" &&
+ subject.isInGroup("plugdev")) {
+ return polkit.Result.YES;
+ }
+});
+
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.udisks2.eject-media" &&
+ subject.isInGroup("plugdev")) {
+ return polkit.Result.YES;
+ }
+});
+
diff --git a/deps/polkit/doinst.sh.gz b/deps/polkit/doinst.sh.gz
new file mode 100644
index 0000000..f43cdf8
--- /dev/null
+++ b/deps/polkit/doinst.sh.gz
Binary files differ
diff --git a/deps/polkit/dont-set-wheel-group-as-admin.diff.gz b/deps/polkit/dont-set-wheel-group-as-admin.diff.gz
new file mode 100644
index 0000000..3b17f45
--- /dev/null
+++ b/deps/polkit/dont-set-wheel-group-as-admin.diff.gz
Binary files differ
diff --git a/deps/polkit/polkit.SlackBuild b/deps/polkit/polkit.SlackBuild
new file mode 100755
index 0000000..15a0a0f
--- /dev/null
+++ b/deps/polkit/polkit.SlackBuild
@@ -0,0 +1,190 @@
+#!/bin/bash
+
+# Copyright 2009, 2011, 2015 Robby Workman, Northport, Alabama, USA
+# Copyright 2010 Eric Hameleers, Eindhoven, NL
+# Copyright 2009, 2010, 2011, 2012, 2013, 2018 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''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 AUTHOR 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.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=polkit
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-4}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+zcat $CWD/dont-set-wheel-group-as-admin.diff.gz | patch -p1 || exit 1
+
+# https://gitlab.freedesktop.org/polkit/polkit/-/issues/29
+zcat $CWD/0001-configure-fix-elogind-support.patch.gz | patch -p1 || exit 1
+
+# If we get here and don't have a polkitd user/group, add one.
+# Otherwise a few directories in the package will have wrong permissions.
+if ! grep -q "^polkitd:" /etc/passwd ; then
+ groupadd -fg 87 polkitd
+ useradd -c "PolicyKit daemon owner" -d /var/lib/polkit -u 87 -g polkitd -s /bin/false polkitd
+fi
+
+# Choose correct options depending on whether PAM is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
+ PAM_OPTIONS="--with-authfw=pam --with-pam-module-dir=/lib${LIBDIRSUFFIX}/security"
+ unset SHADOW_OPTIONS
+else
+ unset PAM_OPTIONS
+ SHADOW_OPTIONS="--with-authfw=shadow"
+fi
+
+autoreconf -vif || exit 1
+
+LIBELOGIND_CFLAGS="$(pkg-config --cflags libelogind)" \
+LIBELOGIND_LIBS="$(pkg-config --libs libelogind)" \
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --docdir=/usr/doc/$PKGNAM-$VERSION \
+ --enable-man-pages \
+ --enable-gtk-doc \
+ --mandir=/usr/man \
+ --disable-static \
+ --disable-examples \
+ --enable-introspection \
+ --enable-libsystemd-login=no \
+ --enable-libelogind=yes \
+ $PAM_OPTIONS \
+ $SHADOW_OPTIONS \
+ --enable-verbose-mode \
+ --with-os-type=Slackware \
+ --build=$ARCH-slackware-linux || exit 1
+
+# Build and install:
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+# Create homedir for polkit. This is mentioned in /etc/passwd, but isn't
+# actually used for anything later. Perms don't matter.
+mkdir -p $PKG/var/lib/polkit
+
+# Add default policy files for udisks2 and NetworkManager events:
+cat $CWD/10-org.freedesktop.NetworkManager.rules > $PKG/etc/polkit-1/rules.d/10-org.freedesktop.NetworkManager.rules.new
+cat $CWD/20-plugdev-group-mount-override.rules > $PKG/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules.new
+
+if [ ! -z "$PAM_OPTIONS" ]; then
+ # Make the PAM file .new:
+ mv $PKG/etc/pam.d/polkit-1 $PKG/etc/pam.d/polkit-1.new
+fi
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" \
+ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.*
+ )
+ done
+ )
+fi
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ AUTHORS COPYING HACKING INSTALL NEWS README \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+( cd $PKG/usr/doc/$PKGNAM-$VERSION; ln -s ../../share/gtk-doc/html/polkit-1 html )
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/deps/polkit/slack-desc b/deps/polkit/slack-desc
new file mode 100644
index 0000000..5eb518d
--- /dev/null
+++ b/deps/polkit/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler-----------------------------------------------------|
+polkit: polkit (authentication framework)
+polkit:
+polkit: PolicyKit is an application-level toolkit for defining and handling
+polkit: the policy that allows unprivileged processes to speak to privileged
+polkit: processes. PolicyKit is specifically targeting applications in rich
+polkit: desktop environments on multi-user UNIX-like operating systems.
+polkit:
+polkit: Homepage: http://www.freedesktop.org/wiki/Software/polkit
+polkit:
+polkit:
+polkit:
diff --git a/deps/util-linux/adjtimex_1.29-2.2.diff.gz b/deps/util-linux/adjtimex_1.29-2.2.diff.gz
new file mode 100644
index 0000000..832e728
--- /dev/null
+++ b/deps/util-linux/adjtimex_1.29-2.2.diff.gz
Binary files differ
diff --git a/deps/util-linux/bsdstrings-util-linux_overflow.diff.gz b/deps/util-linux/bsdstrings-util-linux_overflow.diff.gz
new file mode 100644
index 0000000..0aa3f6b
--- /dev/null
+++ b/deps/util-linux/bsdstrings-util-linux_overflow.diff.gz
Binary files differ
diff --git a/deps/util-linux/ddate.1 b/deps/util-linux/ddate.1
new file mode 100644
index 0000000..ec4ee81
--- /dev/null
+++ b/deps/util-linux/ddate.1
@@ -0,0 +1,115 @@
+.\" All Rites Reversed. This file is in the PUBLIC DOMAIN.
+.\" Kallisti.
+.TH DDATE 1 "Bureaucracy 3161" "ddate" "Emperor Norton User Command"
+.SH NAME
+ddate \- convert Gregorian dates to Discordian dates
+.SH SYNOPSIS
+.B ddate
+.RI [ \fB+\fPformat]
+.RI [ date ]
+.SH DESCRIPTION
+.B ddate
+prints the date in Discordian date format.
+.PP
+If called with no arguments,
+.B ddate
+will get the current system date, convert this to the Discordian
+date format and print this on the standard output. Alternatively, a
+Gregorian date may be specified on the command line, in the form of a numerical
+day, month and year.
+.PP
+If a format string is specified, the Discordian date will be printed in
+a format specified by the string. This mechanism works similarly to the
+format string mechanism of
+.B date(1),
+only almost completely differently. The fields are:
+.IP %A
+Full name of the day of the week (i.e., Sweetmorn)
+.IP %a
+Abbreviated name of the day of the week (i.e., SM)
+.IP %B
+Full name of the season (i.e., Chaos)
+.IP %b
+Abbreviated name of the season (i.e., Chs)
+.IP %d
+Cardinal number of day in season (i.e., 23)
+.IP %e
+Ordinal number of day in season (i.e., 23rd)
+.IP %H
+Name of current Holyday, if any
+.IP %N
+Magic code to prevent rest of format from being printed unless today is
+a Holyday.
+.IP %n
+Newline
+.IP %t
+Tab
+.IP %X
+Number of days remaining until X-Day. (Not valid if the SubGenius options
+are not compiled in.)
+.IP %{
+.IP %}
+Used to enclose the part of the string which is to be replaced with the
+words "St. Tib's Day" if the current day is St. Tib's Day.
+.IP %\.
+Try it and see.
+.bp
+.SH EXAMPLES
+.nf
+% ddate
+.br
+Sweetmorn, Bureaucracy 42, 3161 YOLD
+.PP
+% ddate +'Today is %{%A, the %e of %B%}, %Y. %N%nCelebrate %H'
+.br
+Today is Sweetmorn, the 42nd of Bureaucracy, 3161.
+.PP
+% ddate +"It's %{%A, the %e of %B%}, %Y. %N%nCelebrate %H" 26 9 1995
+.br
+It's Prickle-Prickle, the 50th of Bureaucracy, 3161.
+.br
+Celebrate Bureflux
+.PP
+% ddate +"Today's %{%A, the %e of %B%}, %Y. %N%nCelebrate %H" 29 2 1996
+.br
+Today's St. Tib's Day, 3162.
+.br
+
+.SH BUGS
+
+.B ddate(1)
+will produce undefined behavior if asked to produce the date for St. Tib's
+day and its format string does not contain the St. Tib's Day delimiters
+%{ and %}.
+
+.SH NOTE
+
+After `X-Day' passed without incident, the Church of the SubGenius
+declared that it had got the year upside down - X-Day is actually in 8661 AD
+rather than 1998 AD. Thus, the True X-Day is Cfn 40, 9827.
+
+.SH AUTHOR
+.nh
+Original program by Druel the Chaotic aka Jeremy Johnson (mpython@gnu.ai.mit.edu)
+.br
+Major rewrite by Lee H:. O:. Smith, KYTP, aka Andrew Bulhak (acb@dev.null.org)
+.br
+Gregorian B.C.E. dates fixed by Chaplain Nyan the Wiser, aka Dan Dart (ntw@dandart.co.uk)
+.br
+Five tons of flax.
+
+.SH DISTRIBUTION POLICY
+
+Public domain. All rites reversed.
+
+.SH SEE ALSO
+
+date(1),
+.br
+http://www.subgenius.com/
+.br
+Malaclypse the Younger,
+.I "Principia Discordia, Or How I Found Goddess And What I Did To Her When I Found Her"
+
+.SH AVAILABILITY
+The ddate command is available from https://github.com/bo0ts/ddate.
diff --git a/deps/util-linux/ddate.c b/deps/util-linux/ddate.c
new file mode 100644
index 0000000..4c2a0f8
--- /dev/null
+++ b/deps/util-linux/ddate.c
@@ -0,0 +1,399 @@
+/* $ DVCS ID: $jer|,523/lhos,KYTP!41023161\b"?" <<= DO NOT DELETE! */
+
+/* ddate.c .. converts boring normal dates to fun Discordian Date -><-
+ written the 65th day of The Aftermath in the Year of Our Lady of
+ Discord 3157 by Druel the Chaotic aka Jeremy Johnson aka
+ mpython@gnu.ai.mit.edu
+ 28 Sever St Apt #3
+ Worcester MA 01609
+
+ and I'm not responsible if this program messes anything up (except your
+ mind, I'm responsible for that)
+
+ (k) YOLD 3161 and all time before and after.
+ Reprint, reuse, and recycle what you wish.
+ This program is in the public domain. Distribute freely. Or not.
+
+ Majorly hacked, extended and bogotified/debogotified on
+ Sweetmorn, Bureaucracy 42, 3161 YOLD, by Lee H:. O:. Smith, KYTP,
+ aka Andrew Bulhak, aka acb@dev.null.org
+
+ Slightly hackled and crackled by a sweet firey stove on
+ Boomtime, the 53rd day of Bureaucracy in the YOLD 3179,
+ by Chaplain Nyan the Wiser, aka Dan Dart, aka ntw@dandart.co.uk
+
+ and I'm not responsible if this program messes anything up (except your
+ mind, I'm responsible for that) (and that goes for me as well --lhos)
+
+ Version history:
+ Bureflux 3161: First release of enhanced ddate with format strings
+ 59 Bcy, 3161: PRAISE_BOB and KILL_BOB options split, other minor
+ changes.
+ 53 Bcy, 3179: Fixed gregorian date conversions less than YOLD 1167
+
+ 1999-02-22 Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
+ - added Native Language Support
+
+ 2000-03-17 Burt Holzman <holzman+ddate@gmail.com>
+ - added range checks for dates
+
+ 2014-06-07 William Woodruff <william@tuffbizz.com>
+ - removed gettext dependent locale code
+
+ 15th of Confusion, 3180:
+ - call out adherents of the wrong fruit
+
+ FIVE TONS OF FLAX
+*/
+
+/* configuration options VVVVV READ THIS!!! */
+
+/* If you wish ddate(1) to print the date in the same format as Druel's
+ * original ddate when called in immediate mode, define OLD_IMMEDIATE_FMT
+ */
+
+#define OLD_IMMEDIATE_FMT
+
+/* If you wish to use the US format for aneristic dates (m-d-y), as opposed to
+ * the Commonwealth format, define US_FORMAT.
+ */
+
+/* #define US_FORMAT */
+
+/* If you are ideologically, theologically or otherwise opposed to the
+ * Church of the SubGenius and do not wish your copy of ddate(1) to contain
+ * code for counting down to X-Day, undefine KILL_BOB */
+
+#define KILL_BOB 13013
+
+/* If you wish ddate(1) to contain SubGenius slogans, define PRAISE_BOB */
+
+/*#define PRAISE_BOB 13013*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <stdio.h>
+
+
+// work around includes and defines from formerly c.h
+#ifndef ARRAY_SIZE
+# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#endif
+
+/* &a[0] degrades to a pointer: a different type from an array */
+# define __must_be_array(a) \
+ BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(__typeof__(a), __typeof__(&a[0])))
+
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+
+/* work around hacks for standalone package */
+#define PACKAGE "ddate"
+#define PACKAGE_STRING "Stand Alone"
+
+#ifndef __GNUC__
+#define inline /* foo */
+#endif
+
+#ifdef KILL_BOB
+int xday_countdown(int yday, int year);
+#endif
+
+
+/* string constants */
+
+char *day_long[5] = {
+ "Sweetmorn", "Boomtime", "Pungenday", "Prickle-Prickle", "Setting Orange"
+};
+
+char *day_short[5] = {"SM","BT","PD","PP","SO"};
+
+char *season_long[5] = {
+ "Chaos", "Discord", "Confusion", "Bureaucracy", "The Aftermath"
+};
+
+char *season_short[5] = {"Chs", "Dsc", "Cfn", "Bcy", "Afm"};
+
+char *holyday[5][2] = {
+ { "Mungday", "Chaoflux" },
+ { "Mojoday", "Discoflux" },
+ { "Syaday", "Confuflux" },
+ { "Zaraday", "Bureflux" },
+ { "Maladay", "Afflux" }
+};
+
+struct disc_time {
+ int season; /* 0-4 */
+ int day; /* 0-72 */
+ int yday; /* 0-365 */
+ int year; /* 3066- */
+};
+
+char *excl[] = {
+ "Hail Eris!", "All Hail Discordia!", "Kallisti!", "Fnord.", "Or not.",
+ "Wibble.", "Pzat!", "P'tang!", "Frink!",
+#ifdef PRAISE_BOB
+ "Slack!", "Praise \"Bob\"!", "Or kill me.",
+#endif /* PRAISE_BOB */
+ /* randomness, from the Net and other places. Feel free to add (after
+ checking with the relevant authorities, of course). */
+ "Grudnuk demand sustenance!", "Keep the Lasagna flying!",
+ "You are what you see.",
+ "Or is it?", "This statement is false.",
+ "Lies and slander, sire!", "Hee hee hee!",
+#if defined(linux) || defined (__linux__) || defined (__linux)
+ "Hail Eris, Hack Linux!",
+#elif defined(__APPLE__)
+ "This Fruit is not the True Fruit of Discord.",
+#endif
+ ""
+};
+
+char default_fmt[] = "%{%A, %B %d%}, %Y YOLD";
+char *default_immediate_fmt=
+#ifdef OLD_IMMEDIATE_FMT
+"Today is %{%A, the %e day of %B%} in the YOLD %Y%N%nCelebrate %H"
+#else
+default_fmt
+#endif
+;
+
+#define DY(y) (y+1166)
+
+static inline char *ending(int i) {
+ return i/10==1?"th":(i%10==1?"st":(i%10==2?"nd":(i%10==3?"rd":"th")));
+}
+
+static inline int leapp(int i) {
+ return (!(DY(i)%4))&&((DY(i)%100)||(!(DY(i)%400)));
+}
+
+/* select a random string */
+static inline char *sel(char **strings, int num) {
+ return(strings[random()%num]);
+}
+
+void print(struct disc_time,char **); /* old */
+void format(char *buf, const char* fmt, struct disc_time dt);
+/* read a fortune file */
+int load_fortunes(char *fn, char *delim, char** result);
+
+struct disc_time convert(int,int);
+struct disc_time makeday(int,int,int);
+
+int
+main (int argc, char *argv[]) {
+ long t;
+ struct tm *eris;
+ int bob,raw;
+ struct disc_time hastur;
+ char schwa[23*17], *fnord=0;
+ int pi;
+ char *progname, *p;
+
+ progname = argv[0];
+ if ((p = strrchr(progname, '/')) != NULL)
+ progname = p+1;
+
+ srandom(time(NULL));
+ /* do args here */
+ for(pi=1; pi<argc; pi++) {
+ switch(argv[pi][0]) {
+ case '+': fnord=argv[pi]+1; break;
+ case '-':
+ switch(argv[pi][1]) {
+ case 'V':
+ printf(("%s (%s)\n"), progname, PACKAGE_STRING);
+ default: goto usage;
+ }
+ default: goto thud;
+ }
+ }
+
+ thud:
+ if (argc-pi==3){
+ int moe=atoi(argv[pi]), larry=atoi(argv[pi+1]), curly=atoi(argv[pi+2]);
+ hastur=makeday(
+#ifdef US_FORMAT
+ moe,larry,
+#else
+ larry,moe,
+#endif
+ curly);
+ if (hastur.season == -1) {
+ printf("Invalid date -- out of range\n");
+ return -1;
+ }
+ fnord=fnord?fnord:default_fmt;
+ } else if (argc!=pi) {
+ usage:
+ fprintf(stderr,("usage: %s [+format] [day month year]\n"), argv[0]);
+ exit(1);
+ } else {
+ t= time(NULL);
+ eris=localtime(&t);
+ bob=eris->tm_yday; /* days since Jan 1. */
+ raw=eris->tm_year; /* years since 1980 */
+ hastur=convert(bob,raw);
+ fnord=fnord?fnord:default_immediate_fmt;
+ }
+ format(schwa, fnord, hastur);
+ printf("%s\n", schwa);
+
+ return 0;
+}
+
+void format(char *buf, const char* fmt, struct disc_time dt)
+{
+ int tib_start=-1, tib_end=0;
+ int i, fmtlen=strlen(fmt);
+ char *bufptr=buf;
+
+/* fprintf(stderr, "format(%p, \"%s\", dt)\n", buf, fmt);*/
+
+ /* first, find extents of St. Tib's Day area, if defined */
+ for(i=0; i<fmtlen; i++) {
+ if(fmt[i]=='%') {
+ switch(fmt[i+1]) {
+ case 'A':
+ case 'a':
+ case 'd':
+ case 'e':
+ if(tib_start>0) tib_end=i+1;
+ else tib_start=i;
+ break;
+ case '{': tib_start=i; break;
+ case '}': tib_end=i+1; break;
+ }
+ }
+ }
+
+ /* now do the formatting */
+ buf[0]=0;
+
+ for(i=0; i<fmtlen; i++) {
+ if((i==tib_start) && (dt.day==-1)) {
+ /* handle St. Tib's Day */
+ strcpy(bufptr, ("St. Tib's Day"));
+ bufptr += strlen(bufptr);
+ i=tib_end;
+ } else {
+ if(fmt[i]=='%') {
+ char *wibble=0, snarf[23];
+ switch(fmt[++i]) {
+ case 'A': wibble=day_long[dt.yday%5]; break;
+ case 'a': wibble=day_short[dt.yday%5]; break;
+ case 'B': wibble=season_long[dt.season]; break;
+ case 'b': wibble=season_short[dt.season]; break;
+ case 'd': sprintf(snarf, "%d", dt.day+1); wibble=snarf; break;
+ case 'e': sprintf(snarf, "%d%s", dt.day+1, ending(dt.day+1));
+ wibble=snarf; break;
+ case 'H': if(dt.day==4||dt.day==49)
+ wibble=holyday[dt.season][dt.day==49]; break;
+ case 'N': if(dt.day!=4&&dt.day!=49) goto eschaton; break;
+ case 'n': *(bufptr++)='\n'; break;
+ case 't': *(bufptr++)='\t'; break;
+
+ case 'Y': sprintf(snarf, "%d", dt.year); wibble=snarf; break;
+ case '.': wibble=sel(excl, ARRAY_SIZE(excl));
+ break;
+#ifdef KILL_BOB
+ case 'X': sprintf(snarf, "%d",
+ xday_countdown(dt.yday, dt.year));
+ wibble = snarf; break;
+#endif /* KILL_BOB */
+ }
+ if(wibble) {
+/* fprintf(stderr, "wibble = (%s)\n", wibble);*/
+ strcpy(bufptr, wibble); bufptr+=strlen(wibble);
+ }
+ } else {
+ *(bufptr++) = fmt[i];
+ }
+ }
+ }
+ eschaton:
+ *(bufptr)=0;
+}
+
+struct disc_time makeday(int imonth,int iday,int iyear) /*i for input */
+{
+ struct disc_time funkychickens;
+
+ int cal[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
+ int dayspast=0;
+
+ memset(&funkychickens,0,sizeof(funkychickens));
+ /* basic range checks */
+ if (imonth < 1 || imonth > 12 || iyear == 0) {
+ funkychickens.season = -1;
+ return funkychickens;
+ }
+ if (iday < 1 || iday > cal[imonth-1]) {
+ if (!(imonth == 2 && iday == 29 && iyear%4 == 0 &&
+ (iyear%100 != 0 || iyear%400 == 0))) {
+ funkychickens.season = -1;
+ return funkychickens;
+ }
+ }
+
+ imonth--;
+ /* note: gregorian year 0 doesn't exist so
+ * add one if user specifies a year less than 0 */
+ funkychickens.year= iyear+1166 + ((0 > iyear)?1:0);
+ while(imonth>0) { dayspast+=cal[--imonth]; }
+ funkychickens.day=dayspast+iday-1;
+ funkychickens.season=0;
+ if((funkychickens.year%4)==2) {
+ if (funkychickens.day==59 && iday==29) funkychickens.day=-1;
+ }
+ funkychickens.yday=funkychickens.day;
+/* note: EQUAL SIGN...hopefully that fixes it */
+ while(funkychickens.day>=73) {
+ funkychickens.season++;
+ funkychickens.day-=73;
+ }
+ return funkychickens;
+}
+
+struct disc_time convert(int nday, int nyear)
+{ struct disc_time funkychickens;
+
+ funkychickens.year = nyear+3066;
+ funkychickens.day=nday;
+ funkychickens.season=0;
+ if ((funkychickens.year%4)==2)
+ {if (funkychickens.day==59)
+ funkychickens.day=-1;
+ else if (funkychickens.day >59)
+ funkychickens.day-=1;
+ }
+ funkychickens.yday=funkychickens.day;
+ while (funkychickens.day>=73)
+ { funkychickens.season++;
+ funkychickens.day-=73;
+ }
+ return funkychickens;
+
+ }
+
+#ifdef KILL_BOB
+
+/* Code for counting down to X-Day, X-Day being Cfn 40, 3164
+ *
+ * After `X-Day' passed without incident, the CoSG declared that it had
+ * got the year upside down --- X-Day is actually in 8661 AD rather than
+ * 1998 AD.
+ *
+ * Thus, the True X-Day is Cfn 40, 9827.
+ *
+ */
+
+int xday_countdown(int yday, int year) {
+ int r=(185-yday)+(((yday<59)&&(leapp(year)))?1:0);
+ while(year<9827) r+=(leapp(++year)?366:365);
+ while(year>9827) r-=(leapp(year--)?366:365);
+ return r;
+}
+
+#endif
diff --git a/deps/util-linux/doinst.sh.gz b/deps/util-linux/doinst.sh.gz
new file mode 100644
index 0000000..80b759d
--- /dev/null
+++ b/deps/util-linux/doinst.sh.gz
Binary files differ
diff --git a/deps/util-linux/pam.d-su/su b/deps/util-linux/pam.d-su/su
new file mode 100644
index 0000000..c28a252
--- /dev/null
+++ b/deps/util-linux/pam.d-su/su
@@ -0,0 +1,11 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+# Uncomment the following line to implicitly trust users in the "wheel" group.
+#auth sufficient pam_wheel.so trust use_uid
+# Uncomment the following line to require a user to be in the "wheel" group.
+#auth required pam_wheel.so use_uid
+auth include system-auth
+account include system-auth
+password include system-auth
+session include system-auth
+session optional pam_xauth.so
diff --git a/deps/util-linux/pam.d-su/su-l b/deps/util-linux/pam.d-su/su-l
new file mode 100644
index 0000000..654dc24
--- /dev/null
+++ b/deps/util-linux/pam.d-su/su-l
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth include su
+account include su
+password include su
+session optional pam_keyinit.so force revoke
+session include su
diff --git a/deps/util-linux/pam.d/chfn b/deps/util-linux/pam.d/chfn
new file mode 100644
index 0000000..2dbc0aa
--- /dev/null
+++ b/deps/util-linux/pam.d/chfn
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth include system-auth
+account include system-auth
+password include system-auth
+session include system-auth
diff --git a/deps/util-linux/pam.d/chsh b/deps/util-linux/pam.d/chsh
new file mode 100644
index 0000000..2dbc0aa
--- /dev/null
+++ b/deps/util-linux/pam.d/chsh
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth include system-auth
+account include system-auth
+password include system-auth
+session include system-auth
diff --git a/deps/util-linux/pam.d/login b/deps/util-linux/pam.d/login
new file mode 100644
index 0000000..93923f9
--- /dev/null
+++ b/deps/util-linux/pam.d/login
@@ -0,0 +1,15 @@
+#%PAM-1.0
+auth required pam_securetty.so
+# To set a limit on failed authentications, the pam_tally2 module
+# can be enabled. See pam_tally2(8) for options.
+#auth required pam_tally2.so deny=4 unlock_time=1200
+auth include system-auth
+auth include postlogin
+account required pam_nologin.so
+account include system-auth
+password include system-auth
+session include system-auth
+session include postlogin
+session required pam_loginuid.so
+-session optional pam_ck_connector.so nox11
+-session optional pam_elogind.so
diff --git a/deps/util-linux/pam.d/runuser b/deps/util-linux/pam.d/runuser
new file mode 100644
index 0000000..5344abf
--- /dev/null
+++ b/deps/util-linux/pam.d/runuser
@@ -0,0 +1,5 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+session optional pam_keyinit.so revoke
+session required pam_limits.so
+session required pam_unix.so
diff --git a/deps/util-linux/pam.d/runuser-l b/deps/util-linux/pam.d/runuser-l
new file mode 100644
index 0000000..5ba318a
--- /dev/null
+++ b/deps/util-linux/pam.d/runuser-l
@@ -0,0 +1,4 @@
+#%PAM-1.0
+auth include runuser
+session optional pam_keyinit.so force revoke
+session include runuser
diff --git a/deps/util-linux/rc.setterm b/deps/util-linux/rc.setterm
new file mode 100644
index 0000000..b98b102
--- /dev/null
+++ b/deps/util-linux/rc.setterm
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# This file provides the command line for the setterm utility to set the
+# terminal attributes (primarily used for screen blanking and power
+# management).
+
+# Screen blanks after 15 minutes idle time, and powers down in one hour
+# if the kernel supports APM or ACPI power management (default setting):
+/bin/setterm -blank 15 -powersave powerdown -powerdown 60
+
+# Screen does not blank or use power management features:
+#/bin/setterm -blank 0 -powersave off -powerdown 0
+
diff --git a/deps/util-linux/scsi_ioctl.h b/deps/util-linux/scsi_ioctl.h
new file mode 100644
index 0000000..edb9525
--- /dev/null
+++ b/deps/util-linux/scsi_ioctl.h
@@ -0,0 +1,48 @@
+#ifndef _SCSI_IOCTL_H
+#define _SCSI_IOCTL_H
+
+#define SCSI_IOCTL_SEND_COMMAND 1
+#define SCSI_IOCTL_TEST_UNIT_READY 2
+#define SCSI_IOCTL_BENCHMARK_COMMAND 3
+#define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters */
+#define SCSI_IOCTL_START_UNIT 5
+#define SCSI_IOCTL_STOP_UNIT 6
+/* The door lock/unlock constants are compatible with Sun constants for
+ the cdrom */
+#define SCSI_IOCTL_DOORLOCK 0x5380 /* lock the eject mechanism */
+#define SCSI_IOCTL_DOORUNLOCK 0x5381 /* unlock the mechanism */
+
+#define SCSI_REMOVAL_PREVENT 1
+#define SCSI_REMOVAL_ALLOW 0
+
+#ifdef __KERNEL__
+
+struct scsi_device;
+
+/*
+ * Structures used for scsi_ioctl et al.
+ */
+
+typedef struct scsi_ioctl_command {
+ unsigned int inlen;
+ unsigned int outlen;
+ unsigned char data[0];
+} Scsi_Ioctl_Command;
+
+typedef struct scsi_idlun {
+ __u32 dev_id;
+ __u32 host_unique_id;
+} Scsi_Idlun;
+
+/* Fibre Channel WWN, port_id struct */
+typedef struct scsi_fctargaddress {
+ __u32 host_port_id;
+ unsigned char host_wwn[8]; // include NULL term.
+} Scsi_FCTargAddress;
+
+extern int scsi_ioctl(struct scsi_device *, int, void __user *);
+extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,
+ void __user *arg, struct file *filp);
+
+#endif /* __KERNEL__ */
+#endif /* _SCSI_IOCTL_H */
diff --git a/deps/util-linux/setserial-rc.serial.diff.gz b/deps/util-linux/setserial-rc.serial.diff.gz
new file mode 100644
index 0000000..d64124c
--- /dev/null
+++ b/deps/util-linux/setserial-rc.serial.diff.gz
Binary files differ
diff --git a/deps/util-linux/setserial-undef_TIOCGHAYESESP.diff.gz b/deps/util-linux/setserial-undef_TIOCGHAYESESP.diff.gz
new file mode 100644
index 0000000..2ea4d08
--- /dev/null
+++ b/deps/util-linux/setserial-undef_TIOCGHAYESESP.diff.gz
Binary files differ
diff --git a/deps/util-linux/slack-desc b/deps/util-linux/slack-desc
new file mode 100644
index 0000000..2ddf351
--- /dev/null
+++ b/deps/util-linux/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------|
+util-linux: util-linux (a huge collection of essential utilities)
+util-linux:
+util-linux: The util-linux package is a huge collection of random utilities
+util-linux: that are essential to run a Linux system.
+util-linux:
+util-linux: Homepage: https://www.kernel.org/pub/linux/utils/util-linux/
+util-linux:
+util-linux:
+util-linux:
+util-linux:
+util-linux:
diff --git a/deps/util-linux/su.default b/deps/util-linux/su.default
new file mode 100644
index 0000000..73fb50a
--- /dev/null
+++ b/deps/util-linux/su.default
@@ -0,0 +1,3 @@
+# Ensure that ENV_SUPATH from /etc/login.defs is used for the $PATH when
+# 'su' is used. Otherwise /sbin paths will be missing unless 'su -' is used.
+ALWAYS_SET_PATH yes
diff --git a/deps/util-linux/util-linux.SlackBuild b/deps/util-linux/util-linux.SlackBuild
new file mode 100755
index 0000000..3c33fe5
--- /dev/null
+++ b/deps/util-linux/util-linux.SlackBuild
@@ -0,0 +1,381 @@
+#!/bin/bash
+
+# Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2017, 2018, 2020 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+
+# Slackware build script for util-linux
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=util-linux
+VERSION=${VERSION:-$(echo util-linux*.tar.xz | cut -d - -f 3 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-2}
+
+ADJTIMEXVERS=1.29
+SETSERIALVERS=2.17
+ZIPTOOLVERS=1.4.0
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-util-linux
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP || exit 1
+rm -rf util-linux-$VERSION
+tar xvf $CWD/util-linux-$VERSION.tar.xz || exit 1
+cd util-linux-$VERSION || exit 1
+chown -R root.root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+# Choose correct options depending on whether PAM is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
+ LOGIN_OPTIONS=""
+ # By default, don't use the util-linux version of /bin/su:
+ SHIP_SU=${SHIP_SU:-NO}
+ # Add /etc/pam.d config files:
+ rm -rf $PKG/etc/pam.d
+ mkdir -p $PKG/etc/pam.d
+ for file in $CWD/pam.d/* ; do
+ cp -a ${file} $PKG/etc/pam.d/
+ done
+ if [ "$SHIP_SU" = "YES" ]; then
+ # Add su default file to ensure using ENV_SUPATH with 'su':
+ mkdir -p $PKG/etc/default
+ cp -a $CWD/su.default $PKG/etc/default/su.new
+ chown root:root $PKG/etc/default/su.new
+ chmod 644 $PKG/etc/default/su.new
+ # Add su /etc/pam.d files:
+ cp -a $CWD/pam.d-su/* $PKG/etc/pam.d/
+ fi
+ # Ensure correct perms/ownership on files in /etc/pam.d/:
+ chown root:root $PKG/etc/pam.d/*
+ chmod 644 $PKG/etc/pam.d/*
+ # Don't clobber existing config files:
+ find $PKG/etc/pam.d -type f -exec mv {} {}.new \;
+else
+ # Don't use the util-linux version of /bin/su.
+ # It can't be built without PAM anyway.
+ SHIP_SU=NO
+ LOGIN_OPTIONS="--disable-login"
+fi
+
+# Changing the fdisk -l output (this was done prior to util-linux-ng) broke
+# our installation scripts, so we have changed the name of partition type
+# 83 back to "Linux swap":
+zcat $CWD/util-linux.fdisk-no-solaris.diff.gz | patch -p1 --verbose || exit 1
+
+# Revert to the behavior of earlier versions of fdisk which did not list the
+# /dev/ram* devices in 'fdisk -l' output:
+zcat $CWD/util-linux.do.not.list.ram.devices.diff.gz | patch -p1 --verbose || exit 1
+
+# This just call the configure script with $1 either being 2 for python2
+# or 3 for python3.
+#
+# The releasenotes say to use --runstatedir, but it doesn't work and the
+# configure script fails. So we'll leave things using localstatedir, but
+# check again later:
+#
+# --runstatedir=/run
+configure_with_python(){
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --docdir=/usr/doc/util-linux-$VERSION \
+ --disable-static \
+ --enable-agetty \
+ --enable-kill \
+ --disable-last \
+ --enable-libmount-support-mtab \
+ --enable-line \
+ --enable-mesg \
+ --enable-partx \
+ --enable-pg \
+ --enable-raw \
+ --enable-rename \
+ $LOGIN_OPTIONS \
+ --enable-schedutils \
+ --enable-wall \
+ --enable-write \
+ --enable-use-tty-group \
+ --enable-libblkid \
+ --enable-libmount \
+ --enable-libuuid \
+ --disable-uuidd \
+ --with-python=$1 \
+ --build=$ARCH-slackware-linux
+}
+
+CFLAGS="$SLKCFLAGS" \
+ configure_with_python 2 || exit 1
+
+make $NUMJOBS || make || exit 1
+make install $NUMJOBS DESTDIR=$PKG || exit 1
+
+# These need to be setuid root to work properly (only built for PAM):
+if [ -r $PKG/usr/bin/chfn ]; then
+ chmod 4711 $PKG/usr/bin/chfn
+fi
+if [ -r $PKG/usr/bin/chsh ]; then
+ chmod 4711 $PKG/usr/bin/chsh
+fi
+
+# Build python3 bindings for libmount:
+make clean
+CFLAGS="$SLKCFLAGS" \
+ configure_with_python 3 || exit 1
+make $NUMJOBS \
+ install-pylibmountexecLTLIBRARIES \
+ install-pylibmountexecPYTHON \
+ DESTDIR=$PKG || exit 1
+
+# Remove all overlap with the shadow package, since --disable-login doesn't quite do that:
+rm $PKG/sbin/nologin $PKG/usr/man/man8/nologin.8 $PKG/sbin/sulogin $PKG/usr/man/man8/sulogin.8
+
+# If we aren't shipping su, remove the files:
+if [ "$SHIP_SU" = "NO" ]; then
+ rm -f $PKG/bin/su
+ rm -f $PKG/usr/man/man1/su.1
+ rm -f $PKG/usr/share/bash-completion/completions/su
+fi
+
+# Move the libblkid, libfdisk, libmount, libsmartcols, and
+# libuuid libraries to /lib${LIBSUFFIX}:
+mkdir -p $PKG/lib${LIBDIRSUFFIX}
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ mv libblkid.so.1* $PKG/lib${LIBDIRSUFFIX}
+ mv libfdisk.so.1* $PKG/lib${LIBDIRSUFFIX}
+ mv libmount.so.1* $PKG/lib${LIBDIRSUFFIX}
+ mv libsmartcols.so.1* $PKG/lib${LIBDIRSUFFIX}
+ mv libuuid.so.1* $PKG/lib${LIBDIRSUFFIX}
+ rm -f libblkid.so libfdisk.so libmount.so libsmartcols.so libuuid.so
+ ln -sf ../../lib${LIBDIRSUFFIX}/libblkid.so.1 libblkid.so
+ ln -sf ../../lib${LIBDIRSUFFIX}/libfdisk.so.1 libfdisk.so
+ ln -sf ../../lib${LIBDIRSUFFIX}/libmount.so.1 libmount.so
+ ln -sf ../../lib${LIBDIRSUFFIX}/libsmartcols.so.1 libsmartcols.so
+ ln -sf ../../lib${LIBDIRSUFFIX}/libuuid.so.1 libuuid.so
+)
+
+# Moving things around that have been in the same place
+# for 15 years is, IMHO, not a wise idea AT ALL.
+# If this had to be moved, some place out of /usr might
+# have shown a grain of insight...
+if [ -r $PKG/usr/sbin/fdformat ]; then
+ mkdir -p $PKG/usr/bin
+ mv $PKG/usr/sbin/fdformat $PKG/usr/bin/fdformat
+ # Now since stuff will start looking in this new place,
+ # we have no choice but to link these:
+ ( cd $PKG/usr/sbin
+ ln -sf ../bin/fdformat .
+ )
+fi
+
+# Add the rc.setterm init script to set default terminal attributes:
+mkdir -p $PKG/etc/rc.d
+cp -a $CWD/rc.setterm $PKG/etc/rc.d/rc.setterm.new
+chown root:root $PKG/etc/rc.d/rc.setterm.new
+chmod 755 $PKG/etc/rc.d/rc.setterm.new
+
+# ddate.{1,c} taken from https://github.com/bo0ts/ddate:
+cp -a $CWD/ddate.? .
+cc -O -o ddate ddate.c
+cp -a ddate $PKG/usr/bin
+cat ddate.1 > $PKG/usr/man/man1/ddate.1
+chown root:root $PKG/usr/bin/ddate
+
+# Build ziptool (install as jaztool to avoid conflict with libzip):
+cd $TMP || exit 1
+rm -rf ziptool-$ZIPTOOLVERS
+tar xvf $CWD/ziptool-$ZIPTOOLVERS.tar.xz || exit 1
+cd ziptool-$ZIPTOOLVERS || exit 1
+zcat $CWD/ziptool-fix_build.patch.gz | patch -p1 || exit 1
+mkdir scsi
+cat $CWD/scsi_ioctl.h > scsi/scsi_ioctl.h
+chown -R root:root .
+make || exit 1
+strip ziptool
+cat ziptool > $PKG/sbin/jaztool
+chmod 0755 $PKG/sbin/jaztool
+mkdir -p $PKG/usr/doc/ziptool-$ZIPTOOLVERS
+cp -a README $PKG/usr/doc/ziptool-$ZIPTOOLVERS
+chmod 644 $PKG/usr/doc/ziptool-$ZIPTOOLVERS/*
+cat ziptool.1.gz > $PKG/usr/man/man1/jaztool.1.gz
+
+# Build bsdstrings
+cd $TMP || exit 1
+rm -rf bsdstrings
+tar xvf $CWD/bsdstrings.tar.gz || exit 1
+cd bsdstrings || exit 1
+zcat $CWD/bsdstrings-util-linux_overflow.diff.gz | patch -p1 --verbose || exit 1
+make || exit 1
+strip strings
+cat strings > $PKG/usr/bin/strings-BSD
+chmod 0755 $PKG/usr/bin/strings-BSD
+cat strings.1 | gzip -9c > $PKG/usr/man/man1/strings-BSD.1.gz
+
+# Build adjtimex
+cd $TMP || exit 1
+rm -rf adjtimex-$ADJTIMEXVERS
+tar xvf $CWD/adjtimex_${ADJTIMEXVERS}.orig.tar.gz || exit 1
+cd adjtimex-$ADJTIMEXVERS || exit 1
+chown -R root:root .
+zcat $CWD/adjtimex_1.29-2.2.diff.gz | patch -p1 || exit 1
+CFLAGS=-O2 ./configure --prefix=/usr || exit 1
+make || exit 1
+strip adjtimex
+cat adjtimex > $PKG/sbin/adjtimex
+chmod 0755 $PKG/sbin/adjtimex
+cat adjtimex.8 | gzip -9c > $PKG/usr/man/man8/adjtimex.8.gz
+mkdir -p $PKG/usr/doc/adjtimex-$ADJTIMEXVERS
+cp -a COPYING COPYRIGHT README README.ru adjtimex.lsm \
+ $PKG/usr/doc/adjtimex-$ADJTIMEXVERS
+
+# Build setserial
+cd $TMP || exit 1
+rm -rf setserial-$SETSERIALVERS
+tar xvf $CWD/setserial-$SETSERIALVERS.tar.gz || exit 1
+cd setserial-$SETSERIALVERS || exit 1
+chown -R root:root .
+zcat $CWD/setserial-rc.serial.diff.gz | patch -E -p1 --verbose || exit 1
+zcat $CWD/setserial-undef_TIOCGHAYESESP.diff.gz | patch -E -p1 --verbose || exit 1
+# The original config.{guess,sub} do not work on x86_64
+cp -p /usr/share/libtool/config/config.{guess,sub} .
+./configure --prefix=/usr || exit 1
+make || exit 1
+strip setserial
+cat setserial > $PKG/sbin/setserial
+chmod 0755 $PKG/sbin/setserial
+mkdir -p $PKG/etc/rc.d
+cat rc.serial > $PKG/etc/rc.d/rc.serial.new
+cat serial.conf > $PKG/etc/serial.conf.new
+cat setserial.8 | gzip -9c > $PKG/usr/man/man8/setserial.8.gz
+
+# These have always traditionally been available before /usr
+# might be mounted:
+( cd $PKG/usr/bin
+ mv getopt setterm $PKG/bin
+ cd $PKG/usr/bin
+ ln -s ../../bin/getopt .
+ ln -s ../../bin/setterm .
+)
+
+cd $TMP/util-linux-$VERSION # Go back home :)
+
+# Now let's add some important symlinks :)
+( cd $PKG/sbin
+ ln -s ../bin/mount .
+ ln -s ../bin/umount .
+ #ln -s ziptool jaztool
+ ln -s hwclock clock
+ cd $PKG/usr/sbin
+ ln -s ../../sbin/cfdisk .
+ ln -s ../../sbin/ctrlaltdel .
+ ln -s ../../sbin/sfdisk .
+ cd $PKG/usr/bin
+ ln -s ../sbin/readprofile .
+ # tunelp was removed by upstream:
+ #ln -s ../sbin/tunelp .
+ ln -s ../../bin/more .
+ ln -s ../../sbin/raw .
+ cd $PKG/usr/man/man1
+ #ln -s ziptool.1 jaztool.1
+ cd $PKG/usr/man/man8
+ ln -s hwclock.8 clock.8
+)
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" \
+ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+# Compress and if needed symlink the man pages:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Compress info page and remove dir file
+rm $PKG/usr/info/dir
+gzip -9 $PKG/usr/info/*
+
+mkdir -p $PKG/usr/doc/util-linux-$VERSION
+cp -a AUTHORS COPYING* DEPRECATED NEWS README* \
+ Documentation/v${VERSION}-ReleaseNotes \
+ Documentation/licenses/* Documentation/{TODO,*.txt} \
+ $PKG/usr/doc/util-linux-$VERSION
+
+mkdir $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/util-linux-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/deps/util-linux/util-linux.do.not.list.ram.devices.diff.gz b/deps/util-linux/util-linux.do.not.list.ram.devices.diff.gz
new file mode 100644
index 0000000..fa79e82
--- /dev/null
+++ b/deps/util-linux/util-linux.do.not.list.ram.devices.diff.gz
Binary files differ
diff --git a/deps/util-linux/util-linux.fdisk-no-solaris.diff.gz b/deps/util-linux/util-linux.fdisk-no-solaris.diff.gz
new file mode 100644
index 0000000..73a3183
--- /dev/null
+++ b/deps/util-linux/util-linux.fdisk-no-solaris.diff.gz
Binary files differ
diff --git a/deps/util-linux/ziptool-fix_build.patch.gz b/deps/util-linux/ziptool-fix_build.patch.gz
new file mode 100644
index 0000000..f367eb0
--- /dev/null
+++ b/deps/util-linux/ziptool-fix_build.patch.gz
Binary files differ
diff --git a/kde/build/kjots b/kde/build/kjots
index 00750ed..b8626c4 100644
--- a/kde/build/kjots
+++ b/kde/build/kjots
@@ -1 +1 @@
-3
+4
diff --git a/kde/build/plasma-workspace b/kde/build/plasma-workspace
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/kde/build/plasma-workspace
@@ -0,0 +1 @@
+2
diff --git a/kde/build/polkit-kde-framework b/kde/build/polkit-kde-framework
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/kde/build/polkit-kde-framework
@@ -0,0 +1 @@
+2
diff --git a/kde/build/powerdevil b/kde/build/powerdevil
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/kde/build/powerdevil
@@ -0,0 +1 @@
+2
diff --git a/kde/build/sddm-qt5 b/kde/build/sddm-qt5
index b8626c4..7ed6ff8 100644
--- a/kde/build/sddm-qt5
+++ b/kde/build/sddm-qt5
@@ -1 +1 @@
-4
+5
diff --git a/kde/cmake/sddm-qt5 b/kde/cmake/sddm-qt5
index 1265dc5..6f187cb 100644
--- a/kde/cmake/sddm-qt5
+++ b/kde/cmake/sddm-qt5
@@ -1,13 +1,23 @@
if [ "$SLACKPAM" == "no" ]; then
DO_SLACKPAM="-DENABLE_PAM:BOOL=OFF"
else
- DO_SLACKPAM=""
+ DO_SLACKPAM="-DENABLE_PAM:BOOL=ON"
+fi
+
+if [ "$SLKELOGIND" == "no" ]; then
+ DO_SLKELOGIND=""
+else
+ DO_SLKELOGIND=" \
+ -DNO_SYSTEMD:BOOL=TRUE \
+ -DUSE_ELOGIND:BOOL=TRUE \
+ "
fi
mkdir -p build
cd build
cmake \
$DO_SLACKPAM \
+ $DO_SLKELOGIND \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
@@ -15,8 +25,10 @@ cd build
-DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DBUILD_MAN_PAGES:BOOL=TRUE \
+ -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf" \
-DUSE_QT4:BOOL=FALSE \
-DUSE_QT5:BOOL=TRUE \
- -DENABLE_JOURNALD:BOOL=OFF \
+ -DENABLE_JOURNALD:BOOL=FALSE \
..
diff --git a/kde/doinst.sh/powerdevil b/kde/doinst.sh/powerdevil
index 6e92caa..d311aa0 100644
--- a/kde/doinst.sh/powerdevil
+++ b/kde/doinst.sh/powerdevil
@@ -12,8 +12,7 @@ config() {
}
# Move over the new policy files:
-config etc/polkit-1/rules.d/10-enable-suspend.rules.new
-config etc/polkit-1/localauthority/50-local.d/30-org.freedesktop.upower.pkla.new
-config etc/polkit-1/localauthority/50-local.d/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla.new
-config etc/polkit-1/localauthority/50-local.d/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla.new
+config etc/polkit-1/rules.d/10-enable-upower-suspend.rules.new
+config etc/polkit-1/rules.d/10-enable-elogind-poweroff.rules.new
+config etc/polkit-1/rules.d/10-enable-powerdevil-discrete-gpu.rules.new 2>/dev/null
diff --git a/kde/kde.options b/kde/kde.options
index dc8b8be..f29b953 100644
--- a/kde/kde.options
+++ b/kde/kde.options
@@ -61,3 +61,9 @@ else
SLACKPAM=${SLACKPAM:-"no"}
fi
+# Choose correct options depending on whether elogind is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libelogind.so.? ]; then
+ SLKELOGIND=${SLKELOGIND:-"yes"}
+else
+ SLKELOGIND=${SLKELOGIND:-"no"}
+fi
diff --git a/kde/modules/plasma b/kde/modules/plasma
index 66cf51c..a329e8f 100644
--- a/kde/modules/plasma
+++ b/kde/modules/plasma
@@ -6,6 +6,7 @@ breeze-gtk
breeze-grub
#breeze-plymouth
kwayland-integration
+kwayland-server
plasma-integration
kinfocenter
libksysguard
diff --git a/kde/patch/sddm-qt5.patch b/kde/patch/sddm-qt5.patch
index d57fb12..5919925 100644
--- a/kde/patch/sddm-qt5.patch
+++ b/kde/patch/sddm-qt5.patch
@@ -1,26 +1,21 @@
-# Add missing consolekit support
-# (brings back the switch_user functionality in KDE):
-cat $CWD/patch/sddm-qt5/sddm_consolekit.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
+if [ "$SLKELOGIND" == "no" ]; then
+ # Add missing consolekit support
+ # (brings back the switch_user functionality in KDE):
+ cat $CWD/patch/sddm-qt5/sddm_consolekit.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
-# Don't assume that ConsoleKit2 exposes a login1 dbus interface:
-cat $CWD/patch/sddm-qt5/sddm_ck2_revert.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
+ # Don't assume that ConsoleKit2 exposes a login1 dbus interface:
+ cat $CWD/patch/sddm-qt5/sddm_ck2_revert.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
+fi
+
+# Properly honor supplemental groups, https://github.com/sddm/sddm/issues/1159 :
+cat $CWD/patch/sddm-qt5/sddm_revert-honor-PAM-supplemental-groups.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
+cat $CWD/patch/sddm-qt5/sddm_honor-PAM-supplemental-groups-v2.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
# SDDM 0.14 sources $HOME/.xsession which in Slackware will override the
# session selection you make in SDDM. We fix that unwanted side effect by
# reverting the change:
cat $CWD/patch/sddm-qt5/sddm_userxsession.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
-# Fix display of user avatars ($HOME/.face.icon file)
-# (fixed in sddm-0.15.0).
-#cat $CWD//patch/sddm-qt5/sddm_avatars.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
-
-# Fix a compilation error on passwd backend:
-#cat $CWD/patch/sddm-qt5/sddm_auth.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
-
-# Fix a compilation error on passwd backend:
-# (fixed in sddm-0.12.0).
-#cat $CWD/patch/sddm-qt5/sddm_qstring.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
-
# Add the dutch translation:
if ! grep -q nl.ts data/translations/CMakeLists.txt ; then
sed -e '/set(TRANSLATION_FILES/s/TRANSLATION_FILES/&\n nl.ts/' \
diff --git a/kde/patch/sddm-qt5/sddm_honor-PAM-supplemental-groups-v2.patch b/kde/patch/sddm-qt5/sddm_honor-PAM-supplemental-groups-v2.patch
new file mode 100644
index 0000000..bf3bfd2
--- /dev/null
+++ b/kde/patch/sddm-qt5/sddm_honor-PAM-supplemental-groups-v2.patch
@@ -0,0 +1,183 @@
+From 75e6e00d9e1ecf25e3a9c8332530a1e40d737cdb Mon Sep 17 00:00:00 2001
+From: "J. Konrad Tegtmeier-Rottach" <jktr@0x16.de>
+Date: Thu, 9 May 2019 03:06:48 +0200
+Subject: [PATCH] Honor PAM's supplemental groups (v2) (#834, #1159)
+
+This moves the supplemental group initialization step from
+UserSession.cpp to the Backend system, so that the Pam Backend can
+inject additional supplemental groups via modules like pam_group.so.
+
+pam_setcred(3) assumes that it operates on an already initialized
+supplemental group list. However, PamBackend calls
+pam_setcred(PAM_ESTABLISH_CRED) earlier, at the start
+PamBackend::openSession, so a pam_setcred(PAM_REINITIALIZE_CRED) call
+must be issued to repeat the injection of PAM's supplemental groups.
+---
+ src/helper/Backend.cpp | 5 +++++
+ src/helper/Backend.h | 3 +++
+ src/helper/HelperApp.cpp | 4 ++++
+ src/helper/HelperApp.h | 1 +
+ src/helper/UserSession.cpp | 13 ++++++++-----
+ src/helper/backend/PamBackend.cpp | 18 ++++++++++++++++++
+ src/helper/backend/PamBackend.h | 2 ++
+ 7 files changed, 41 insertions(+), 5 deletions(-)
+
+diff --git a/src/helper/Backend.cpp b/src/helper/Backend.cpp
+index d6bb4d0a..35ae2bdf 100644
+--- a/src/helper/Backend.cpp
++++ b/src/helper/Backend.cpp
+@@ -29,6 +29,7 @@
+ #include <QtCore/QProcessEnvironment>
+
+ #include <pwd.h>
++#include <grp.h>
+
+ namespace SDDM {
+ Backend::Backend(HelperApp* parent)
+@@ -79,4 +80,8 @@ namespace SDDM {
+ bool Backend::closeSession() {
+ return true;
+ }
++
++ bool Backend::setupSupplementalGroups(struct passwd *pw) {
++ return !initgroups(pw->pw_name, pw->pw_gid);
++ }
+ }
+diff --git a/src/helper/Backend.h b/src/helper/Backend.h
+index b790e001..3caf1592 100644
+--- a/src/helper/Backend.h
++++ b/src/helper/Backend.h
+@@ -22,6 +22,7 @@
+ #define BACKEND_H
+
+ #include <QtCore/QObject>
++#include <pwd.h>
+
+ namespace SDDM {
+ class HelperApp;
+@@ -38,6 +39,8 @@ namespace SDDM {
+ void setAutologin(bool on = true);
+ void setGreeter(bool on = true);
+
++ virtual bool setupSupplementalGroups(struct passwd *pw);
++
+ public slots:
+ virtual bool start(const QString &user = QString()) = 0;
+ virtual bool authenticate() = 0;
+diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
+index cad93bd8..d0891d75 100644
+--- a/src/helper/HelperApp.cpp
++++ b/src/helper/HelperApp.cpp
+@@ -253,6 +253,10 @@ namespace SDDM {
+ return m_session;
+ }
+
++ Backend *HelperApp::backend() {
++ return m_backend;
++ }
++
+ const QString& HelperApp::user() const {
+ return m_user;
+ }
+diff --git a/src/helper/HelperApp.h b/src/helper/HelperApp.h
+index 3742df12..cb5959a7 100644
+--- a/src/helper/HelperApp.h
++++ b/src/helper/HelperApp.h
+@@ -39,6 +39,7 @@ namespace SDDM {
+ virtual ~HelperApp();
+
+ UserSession *session();
++ Backend *backend();
+ const QString &user() const;
+ const QString &cookie() const;
+
+diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
+index f71fd358..62fd4d70 100644
+--- a/src/helper/UserSession.cpp
++++ b/src/helper/UserSession.cpp
+@@ -19,6 +19,7 @@
+ *
+ */
+
++#include "Backend.h"
+ #include "Configuration.h"
+ #include "UserSession.h"
+ #include "HelperApp.h"
+@@ -129,7 +130,8 @@ namespace SDDM {
+ #endif
+
+ // switch user
+- const QByteArray username = qobject_cast<HelperApp*>(parent())->user().toLocal8Bit();
++ HelperApp* app = qobject_cast<HelperApp*>(parent());
++ const QByteArray username = app->user().toLocal8Bit();
+ struct passwd pw;
+ struct passwd *rpw;
+ long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+@@ -146,12 +148,13 @@ namespace SDDM {
+ qCritical() << "getpwnam_r(" << username << ") failed with error: " << strerror(err);
+ exit(Auth::HELPER_OTHER_ERROR);
+ }
+- if (setgid(pw.pw_gid) != 0) {
+- qCritical() << "setgid(" << pw.pw_gid << ") failed for user: " << username;
++
++ if (!app->backend()->setupSupplementalGroups(&pw)) {
++ qCritical() << "failed to set up supplemental groups for user: " << username;
+ exit(Auth::HELPER_OTHER_ERROR);
+ }
+- if (initgroups(pw.pw_name, pw.pw_gid) != 0) {
+- qCritical() << "initgroups(" << pw.pw_name << ", " << pw.pw_gid << ") failed for user: " << username;
++ if (setgid(pw.pw_gid) != 0) {
++ qCritical() << "setgid(" << pw.pw_gid << ") failed for user: " << username;
+ exit(Auth::HELPER_OTHER_ERROR);
+ }
+ if (setuid(pw.pw_uid) != 0) {
+diff --git a/src/helper/backend/PamBackend.cpp b/src/helper/backend/PamBackend.cpp
+index f86d77d6..cccfa258 100644
+--- a/src/helper/backend/PamBackend.cpp
++++ b/src/helper/backend/PamBackend.cpp
+@@ -289,6 +289,24 @@ namespace SDDM {
+ return QString::fromLocal8Bit((const char*) m_pam->getItem(PAM_USER));
+ }
+
++ bool PamBackend::setupSupplementalGroups(struct passwd *pw) {
++ if (!Backend::setupSupplementalGroups(pw))
++ return false;
++
++ // pam_setcred(3) may inject additional groups into the user's
++ // list of supplemental groups, and assumes that the user's
++ // supplemental groups have already been initialized before
++ // its invocation. Since pam_setcred was already called at the
++ // start of openSession, we need to repeat this step here as
++ // the user's groups have only just now been initialized.
++
++ if (!m_pam->setCred(PAM_REINITIALIZE_CRED)) {
++ m_app->error(m_pam->errorString(), Auth::ERROR_AUTHENTICATION);
++ return false;
++ }
++ return true;
++ }
++
+ int PamBackend::converse(int n, const struct pam_message **msg, struct pam_response **resp) {
+ qDebug() << "[PAM] Conversation with" << n << "messages";
+
+diff --git a/src/helper/backend/PamBackend.h b/src/helper/backend/PamBackend.h
+index 4c8b4b35..5b079099 100644
+--- a/src/helper/backend/PamBackend.h
++++ b/src/helper/backend/PamBackend.h
+@@ -28,6 +28,7 @@
+ #include <QtCore/QObject>
+
+ #include <security/pam_appl.h>
++#include <pwd.h>
+
+ namespace SDDM {
+ class PamHandle;
+@@ -61,6 +62,7 @@ namespace SDDM {
+ explicit PamBackend(HelperApp *parent);
+ virtual ~PamBackend();
+ int converse(int n, const struct pam_message **msg, struct pam_response **resp);
++ virtual bool setupSupplementalGroups(struct passwd *pw);
+
+ public slots:
+ virtual bool start(const QString &user = QString());
+
diff --git a/kde/patch/sddm-qt5/sddm_revert-honor-PAM-supplemental-groups.patch b/kde/patch/sddm-qt5/sddm_revert-honor-PAM-supplemental-groups.patch
new file mode 100644
index 0000000..2391c80
--- /dev/null
+++ b/kde/patch/sddm-qt5/sddm_revert-honor-PAM-supplemental-groups.patch
@@ -0,0 +1,88 @@
+From d3953e88a94ec25a87d3c5136517b3d1009cb1fd Mon Sep 17 00:00:00 2001
+From: "J. Konrad Tegtmeier-Rottach" <jktr@0x16.de>
+Date: Wed, 8 May 2019 18:58:53 +0200
+Subject: [PATCH] Revert "Honor PAM's ambient supplemental groups. (#834)"
+
+This reverts commit 1bc813d08b8130e458a6550ec47fb2bfbe6de080, which
+misuses PAM and leads to pulling in all of root's supplemental groups
+during session initialization instead of only adding PAM's extra
+groups. The problem was masked due to the root user not having any
+supplemental groups in some common contexts, like running sddm from a
+systemd unit.
+---
+ src/helper/UserSession.cpp | 57 --------------------------------------
+ 1 file changed, 57 deletions(-)
+
+diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
+index b3aec356..f71fd358 100644
+--- a/src/helper/UserSession.cpp
++++ b/src/helper/UserSession.cpp
+@@ -150,67 +150,10 @@ namespace SDDM {
+ qCritical() << "setgid(" << pw.pw_gid << ") failed for user: " << username;
+ exit(Auth::HELPER_OTHER_ERROR);
+ }
+-
+-#ifdef USE_PAM
+-
+- // fetch ambient groups from PAM's environment;
+- // these are set by modules such as pam_groups.so
+- int n_pam_groups = getgroups(0, NULL);
+- gid_t *pam_groups = NULL;
+- if (n_pam_groups > 0) {
+- pam_groups = new gid_t[n_pam_groups];
+- if ((n_pam_groups = getgroups(n_pam_groups, pam_groups)) == -1) {
+- qCritical() << "getgroups() failed to fetch supplemental"
+- << "PAM groups for user:" << username;
+- exit(Auth::HELPER_OTHER_ERROR);
+- }
+- } else {
+- n_pam_groups = 0;
+- }
+-
+- // fetch session's user's groups
+- int n_user_groups = 0;
+- gid_t *user_groups = NULL;
+- if (-1 == getgrouplist(username.constData(), pw.pw_gid,
+- NULL, &n_user_groups)) {
+- user_groups = new gid_t[n_user_groups];
+- if ((n_user_groups = getgrouplist(username.constData(),
+- pw.pw_gid, user_groups,
+- &n_user_groups)) == -1 ) {
+- qCritical() << "getgrouplist(" << username << ", " << pw.pw_gid
+- << ") failed";
+- exit(Auth::HELPER_OTHER_ERROR);
+- }
+- }
+-
+- // set groups to concatenation of PAM's ambient
+- // groups and the session's user's groups
+- int n_groups = n_pam_groups + n_user_groups;
+- if (n_groups > 0) {
+- gid_t *groups = new gid_t[n_groups];
+- memcpy(groups, pam_groups, (n_pam_groups * sizeof(gid_t)));
+- memcpy((groups + n_pam_groups), user_groups,
+- (n_user_groups * sizeof(gid_t)));
+-
+- // setgroups(2) handles duplicate groups
+- if (setgroups(n_groups, groups) != 0) {
+- qCritical() << "setgroups() failed for user: " << username;
+- exit (Auth::HELPER_OTHER_ERROR);
+- }
+- delete[] groups;
+- }
+- delete[] pam_groups;
+- delete[] user_groups;
+-
+-#else
+-
+ if (initgroups(pw.pw_name, pw.pw_gid) != 0) {
+ qCritical() << "initgroups(" << pw.pw_name << ", " << pw.pw_gid << ") failed for user: " << username;
+ exit(Auth::HELPER_OTHER_ERROR);
+ }
+-
+-#endif /* USE_PAM */
+-
+ if (setuid(pw.pw_uid) != 0) {
+ qCritical() << "setuid(" << pw.pw_uid << ") failed for user: " << username;
+ exit(Auth::HELPER_OTHER_ERROR);
+
diff --git a/kde/post-install/plasma-workspace/pam.d/kde b/kde/post-install/plasma-workspace/pam.d/kde
index 7acfd90..50e0f53 100644
--- a/kde/post-install/plasma-workspace/pam.d/kde
+++ b/kde/post-install/plasma-workspace/pam.d/kde
@@ -5,5 +5,6 @@ account include system-auth
password include system-auth
session include system-auth
session required pam_loginuid.so
-session optional pam_ck_connector.so nox11
+-session optional pam_ck_connector.so nox11
+-session optional pam_elogind.so
session include postlogin
diff --git a/kde/post-install/plasma-workspace/scripts/startkwayland b/kde/post-install/plasma-workspace/scripts/startkwayland
index 7ca8a0a..2d8cf55 100644
--- a/kde/post-install/plasma-workspace/scripts/startkwayland
+++ b/kde/post-install/plasma-workspace/scripts/startkwayland
@@ -1,9 +1,4 @@
#!/bin/sh
# Start KWin as a Plasma 5 Wayland session
-# Choose correct options depending on whether PAM is installed:
-if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
- dbus-launch --sh-syntax --exit-with-session /usr/bin/startplasma-wayland
-else
- ck-launch-session dbus-launch --sh-syntax --exit-with-session /usr/bin/startplasma-wayland
-fi
+dbus-launch --sh-syntax --exit-with-session /usr/bin/startplasma-wayland
diff --git a/kde/post-install/powerdevil.post-install b/kde/post-install/powerdevil.post-install
index 9eb14f2..24a9bc1 100644
--- a/kde/post-install/powerdevil.post-install
+++ b/kde/post-install/powerdevil.post-install
@@ -3,21 +3,28 @@ mkdir -p $PKG/etc
mv $PKG/etc/kde/dbus-1 $PKG/etc/
mkdir -p $PKG/etc/polkit-1/rules.d
-mkdir -p $PKG/etc/polkit-1/localauthority/50-local.d
-chmod 700 $PKG/etc/polkit-1/localauthority
-# Add polkit policy file that brings back suspend/hibernate options:
+# Add upower policy allowing users in the 'power' group
+# to suspend/hibernate the computer:
install -m 0644 -o root \
- $CWD/post-install/powerdevil/10-enable-suspend.rules \
- $PKG/etc/polkit-1/rules.d/10-enable-suspend.rules.new
-install -m 0660 -o root \
- $CWD/post-install/powerdevil/30-org.freedesktop.upower.pkla \
- $PKG/etc/polkit-1/localauthority/50-local.d/30-org.freedesktop.upower.pkla.new
-# Add polkit policy files that bring back shutdown/reboot:
-install -m 0660 -o root \
- $CWD/post-install/powerdevil/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla \
- $PKG/etc/polkit-1/localauthority/50-local.d/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla.new
-install -m 0660 -o root \
- $CWD/post-install/powerdevil/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla \
- $PKG/etc/polkit-1/localauthority/50-local.d/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla.new
+ $CWD/post-install/powerdevil/10-enable-upower-suspend.rules \
+ $PKG/etc/polkit-1/rules.d/10-enable-upower-suspend.rules.new
+if [ "SLKELOGIND" = YES ]; then
+ # Add login1 policy file that allows users in the 'power' group
+ # to shutdown/reboot the computer:
+ install -m 0644 -o root \
+ $CWD/post-install/powerdevil/10-enable-elogind-power.rules \
+ $PKG/etc/polkit-1/rules.d/10-enable-session-poweroff.rules.new
+ # Add powerdevil policy file that allows users in the 'power' group
+ # to check for existence of a discrete gpu:
+ install -m 0644 -o root \
+ $CWD/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules \
+ $PKG/etc/polkit-1/rules.d/10-enable-powerdevil-discrete-gpu.rules.new
+else
+ # Add ConsoleKit2 policy file that allows users in the 'power' group
+ # to shutdown/reboot the computer:
+ install -m 0644 -o root \
+ $CWD/post-install/powerdevil/10-enable-ck2-power.rules \
+ $PKG/etc/polkit-1/rules.d/10-enable-session-poweroff.rules.new
+fi
diff --git a/kde/post-install/powerdevil/10-enable-ck2-poweroff.rules b/kde/post-install/powerdevil/10-enable-ck2-poweroff.rules
new file mode 100644
index 0000000..2c68027
--- /dev/null
+++ b/kde/post-install/powerdevil/10-enable-ck2-poweroff.rules
@@ -0,0 +1,12 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( (action.id == "org.freedesktop.consolekit.reboot" ||
+ action.id == "org.freedesktop.consolekit.reboot-multiple-sessions" ||
+ action.id == "org.freedesktop.consolekit.power-off" ||
+ action.id == "org.freedesktop.consolekit.power-off-multiple-sessions")
+ && subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
+
diff --git a/kde/post-install/powerdevil/10-enable-elogind-poweroff.rules b/kde/post-install/powerdevil/10-enable-elogind-poweroff.rules
new file mode 100644
index 0000000..db49920
--- /dev/null
+++ b/kde/post-install/powerdevil/10-enable-elogind-poweroff.rules
@@ -0,0 +1,12 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( (action.id == "org.freedesktop.login1.reboot" ||
+ action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
+ action.id == "org.freedesktop.login1.power-off" ||
+ action.id == "org.freedesktop.login1.power-off-multiple-sessions")
+ && subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
+
diff --git a/kde/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules b/kde/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules
new file mode 100644
index 0000000..f001848
--- /dev/null
+++ b/kde/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules
@@ -0,0 +1,9 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( action.id == "org.kde.powerdevil.discretegpuhelper.hasdualgpu" &&
+ subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
+
diff --git a/kde/post-install/powerdevil/10-enable-suspend.rules b/kde/post-install/powerdevil/10-enable-suspend.rules
deleted file mode 100644
index 5ef58ac..0000000
--- a/kde/post-install/powerdevil/10-enable-suspend.rules
+++ /dev/null
@@ -1,10 +0,0 @@
-polkit.addRule(
- function(action, subject) {
- if ((action.id == "org.freedesktop.upower.suspend" ||
- action.id == "org.freedesktop.upower.hibernate") &&
- subject.isInGroup("power"))
- {
- return polkit.Result.YES;
- }
- }
-);
diff --git a/kde/post-install/powerdevil/10-enable-upower-suspend.rules b/kde/post-install/powerdevil/10-enable-upower-suspend.rules
new file mode 100644
index 0000000..4bccfb0
--- /dev/null
+++ b/kde/post-install/powerdevil/10-enable-upower-suspend.rules
@@ -0,0 +1,9 @@
+polkit.addRule(
+ function(action, subject) {
+ if ( (action.id == "org.freedesktop.upower.suspend" ||
+ action.id == "org.freedesktop.upower.hibernate")
+ && subject.isInGroup("power") ) {
+ return polkit.Result.YES;
+ }
+ }
+);
diff --git a/kde/post-install/powerdevil/30-org.freedesktop.upower.pkla b/kde/post-install/powerdevil/30-org.freedesktop.upower.pkla
deleted file mode 100644
index b3b5dd2..0000000
--- a/kde/post-install/powerdevil/30-org.freedesktop.upower.pkla
+++ /dev/null
@@ -1,9 +0,0 @@
-# /etc/polkit-1/localauthority/50-local.d/30-org.freedesktop.upower.pkla
-# Allow all power users to suspend/hibernate the computer:
-[Power Users]
-Identity=unix-group:power
-Action=org.freedesktop.upower.suspend;org.freedesktop.upower.hibernate
-ResultAny=yes
-ResultInactive=no
-ResultActive=yes
-
diff --git a/kde/post-install/powerdevil/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla b/kde/post-install/powerdevil/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla
deleted file mode 100644
index 1fae73a..0000000
--- a/kde/post-install/powerdevil/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla
+++ /dev/null
@@ -1,8 +0,0 @@
-# /etc/polkit-1/localauthority/50-local.d/40-org.freedesktop.consolekit.system.stop-multiple-users.pkla
-[Allow power users to shutdown]
-Identity=unix-group:power
-Action=org.freedesktop.consolekit.system.stop-multiple-users;org.freedesktop.consolekit.system.stop
-ResultAny=yes
-ResultInactive=no
-ResultActive=yes
-
diff --git a/kde/post-install/powerdevil/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla b/kde/post-install/powerdevil/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla
deleted file mode 100644
index db17c63..0000000
--- a/kde/post-install/powerdevil/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla
+++ /dev/null
@@ -1,7 +0,0 @@
-# /etc/polkit-1/localauthority/50-local.d/41-org.freedesktop.consolekit.system.restart-multiple-users.pkla
-[Allow power users to restart]
-Identity=unix-group:power
-Action=org.freedesktop.consolekit.system.restart-multiple-users;org.freedesktop.consolekit.system.restart
-ResultAny=yes
-ResultInactive=no
-ResultActive=yes
diff --git a/kde/post-install/sddm-qt5.post-install b/kde/post-install/sddm-qt5.post-install
index 006e234..3d168b1 100644
--- a/kde/post-install/sddm-qt5.post-install
+++ b/kde/post-install/sddm-qt5.post-install
@@ -12,6 +12,19 @@ fi
# Remove the sddm.conf file because we will generate our own in doinst.sh:
rm -f $PKG/etc/sddm.conf
+# Make sure that Plasma and SDDM work on older GPUs,
+# by forcing Qt5 to use software GL rendering:
+cat <<"EOGL" >> $PKG/usr/share/sddm/scripts/Xsetup
+
+# Make sure that Plasma and SDDM work on older GPUs,
+# by forcing Qt5 to use software GL rendering:
+OPENGL_VERSION=$(LANG=C glxinfo |grep '^OpenGL version string: ' |head -n 1 |sed -e 's/^OpenGL version string: \([0-9]\).*$/\1/g')
+if [ "$OPENGL_VERSION" -lt 2 ]; then
+ QT_XCB_FORCE_SOFTWARE_OPENGL=1
+ export QT_XCB_FORCE_SOFTWARE_OPENGL
+fi
+EOGL
+
# Ensure that user customizations to the session files are not lost:
mv $PKG/usr/share/sddm/scripts/Xsession{,.new}
mv $PKG/usr/share/sddm/scripts/Xsetup{,.new}
diff --git a/kde/post-install/sddm-qt5/pam.d/sddm b/kde/post-install/sddm-qt5/pam.d/sddm
index f0b2345..df016a7 100644
--- a/kde/post-install/sddm-qt5/pam.d/sddm
+++ b/kde/post-install/sddm-qt5/pam.d/sddm
@@ -19,7 +19,8 @@ password substack system-auth
session optional pam_keyinit.so force revoke
session substack system-auth
session required pam_loginuid.so
-session optional pam_ck_connector.so nox11
+-session optional pam_ck_connector.so nox11
+-session optional pam_elogind.so
-session optional pam_gnome_keyring.so auto_start
-session optional pam_kwallet5.so auto_start
session include postlogin
diff --git a/kde/post-install/sddm-qt5/pam.d/sddm-autologin b/kde/post-install/sddm-qt5/pam.d/sddm-autologin
index fd926ef..3602395 100644
--- a/kde/post-install/sddm-qt5/pam.d/sddm-autologin
+++ b/kde/post-install/sddm-qt5/pam.d/sddm-autologin
@@ -17,7 +17,8 @@ password include system-auth
session substack system-auth
session required pam_loginuid.so
-session optional pam_ck_connector.so nox11
+-session optional pam_ck_connector.so nox11
+-session optional pam_elogind.so
-session optional pam_gnome_keyring.so auto_start
-session optional pam_kwallet5.so auto_start
session include postlogin
diff --git a/kde/post-install/sddm-qt5/pam.d/sddm-greeter b/kde/post-install/sddm-qt5/pam.d/sddm-greeter
index c7bd8a3..fe30e60 100644
--- a/kde/post-install/sddm-qt5/pam.d/sddm-greeter
+++ b/kde/post-install/sddm-qt5/pam.d/sddm-greeter
@@ -15,4 +15,5 @@ password required pam_deny.so
# Setup session
session required pam_unix.so
-session optional pam_systemd.so
+-session optional pam_ck_connector.so nox11
-session optional pam_elogind.so