diff options
author | Jay Lanagan <j@lngn.net> | 2024-01-05 08:15:27 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-01-06 08:08:38 +0700 |
commit | 7bf1de94f58d89a0c4f3f19f4f772d017b41ccf9 (patch) | |
tree | 4b4be533e1c40c447e66613bfc678df992e240a2 /system/greetd | |
parent | ed718574a9a690e2ae47f506dbf99a9f65d16623 (diff) | |
download | slackbuilds-7bf1de94f58d89a0c4f3f19f4f772d017b41ccf9.tar.gz slackbuilds-7bf1de94f58d89a0c4f3f19f4f772d017b41ccf9.tar.xz |
system/greetd: Added (minimal and flexible login manager daemon).
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/greetd')
-rw-r--r-- | system/greetd/README | 29 | ||||
-rw-r--r-- | system/greetd/greetd.SlackBuild | 218 | ||||
-rw-r--r-- | system/greetd/greetd.info | 104 | ||||
-rw-r--r-- | system/greetd/greetd.pam | 9 | ||||
-rw-r--r-- | system/greetd/rc.4.greetd | 11 | ||||
-rw-r--r-- | system/greetd/slack-desc | 19 |
6 files changed, 390 insertions, 0 deletions
diff --git a/system/greetd/README b/system/greetd/README new file mode 100644 index 0000000000..b79afac01c --- /dev/null +++ b/system/greetd/README @@ -0,0 +1,29 @@ +greetd (A login manager daemon) + +greetd is a minimal and flexible login manager daemon that makes no +assumptions about what you want to launch. + +Prior to installation you must create a user/group for 'greetd' on +your system: + +'groupadd -g 381 greeter' +'useradd -d /var/lib/greeter -u 381 -g greeter -G video -s /bin/false \ +greeter' + +To start 'greetd' at boot, ensure you've set runlevel 4 and copy the +included '/etc/rc.d/rc.4.greetd' to '/etc/rc.d/rc.4.local' (or add the +contents to your existing file) and reboot. + +The default greeter is 'agreety' which is included. This is a text-based +greeter login that resembles a console login. You can change greetd to +load any program upon boot by editing the '/etc/greetd/config.toml' +file. In order to save any changes during an upgrade, it is recommended +to copy the file to '/etc/greetd/greetd.conf' to save your personalized +settings. + +*NOTE* You will see an error about "unable to set working directory", +which appears to happen on all non-systemd distros, but doesn't +effect overall use. + +There are many additional greeters for greetd, which have yet to be +submitted to SBo, if you have a favorite, please upload a SlackBuild! diff --git a/system/greetd/greetd.SlackBuild b/system/greetd/greetd.SlackBuild new file mode 100644 index 0000000000..2230bd9e0e --- /dev/null +++ b/system/greetd/greetd.SlackBuild @@ -0,0 +1,218 @@ +#!/bin/bash +# +# Slackware build script for greetd +# +# Copyright 2023-2024 Jay Lanagan (j@lngn.net), Detroit, MI, 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) + +PRGNAM=greetd +PRGUID=greeter +PRGGID=greeter +VERSION=${VERSION:-0.9.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +bailout() { + printf "This requires a \"greeter\" user and group.\n" + printf "groupadd -g 381 greeter\n" + printf "useradd -d /var/lib/greeter -u 381 -g greeter -G video -s /bin/false greeter" + exit 1 +} + +if ! getent group $PRGGID 2>/dev/null 1>/dev/null ; then + bailout +elif ! getent passwd $PRGUID 2>/dev/null 1>/dev/null ; then + bailout +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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +export PATH="/opt/rust16/bin:$PATH" +if [ -z "$LD_LIBRARY_PATH" ]; then + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX" +else + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$VERSION.tar.?z +cd $PRGNAM-$VERSION + +# build offline +# configuration tells cargo to use the configured directory +# for dependencies instead of downloading from crates.io +# borrowed from alacritty slackbuild +mkdir .cargo +cat << EOF >> .cargo/config +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = '$(pwd)/vendor' +EOF + +# deps and versions come from Cargo.lock +mkdir vendor +( + cd vendor + + grep -h -A 4 "\[\[package\]\]" \ + $(find "../" -maxdepth 1 -mindepth 1 -name Cargo.lock | tr '\n' ' ') | \ + sed 's/[[:space:]]*=[[:space:]]*/=/g;s/^--//;s/^\[\[/--\n[[/' | \ + awk 'BEGIN { RS = "--\n" ; FS="\n" } { print $2, $3, $4, $5 }' | \ + sed 's/"//g;s/name=//;s/ version=/=/' | \ + grep " source=" | \ + sed 's/ dependencies=.*$//' | \ + sed 's/ source=[^ ]*//' | \ + sed 's/ checksum=/=/' | \ + sort -u | \ + while read -r dep ; do + + cksum="$(printf "%s\n" "$dep" | cut -d= -f3)" + ver="$(printf "%s\n" "$dep" | cut -d= -f2)" + dep="$(printf "%s\n" "$dep" | cut -d= -f1)" + + tar xvf $CWD/$dep-$ver.crate + + touch $dep-$ver/.cargo-ok + + # generate checksum + { + printf "{\n" + printf ' "files": {\n' + + ( + cd $dep-$ver + find . -type f -print0 | xargs -0 sha256sum | sed -n '/\.cargo-checksum\.json/!p' | sed 's/\.\///;s/^\([^ ]*\)[[:space:]][[:space:]]*\(.*\)$/"\2":"\1",/' + ) | sed '$ s/,$//' + + printf " },\n" + printf ' "package": "%s"' "$cksum" + + printf "}\n" + } > $dep-$ver/.cargo-checksum.json + done +) + +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 {} \; + +# Set /bin/bash rather than /bin/sh as default shell +sed -i -e 's,vt = 1,vt = 7,g' config.toml +sed -i -e 's,bin/sh,bin/bash,g' config.toml + +# Adding extra parms to default config to ensure our envir is good +cat <<EOT >> config.toml + +[system] +source_profile = "true" +runfile = "/var/run/greetd.run" +EOT + +## to do online rust build uncomment these two lines +#cargo fetch --locked --target "$ARCH-unknown-linux-gnu" +#cargo build --frozen --release --all-features + +## and comment the line below this +cargo build --offline --frozen --release --all-features +make -C man all + +install -Dm0755 -t "$PKG/usr/bin/" "target/release/agreety" +install -Dm0755 -t "$PKG/usr/bin/" "target/release/fakegreet" +install -Dm0755 -t "$PKG/usr/bin/" "target/release/$PRGNAM" +install -Dm0644 -t "$PKG/etc/$PRGNAM/" config.toml +install -Dm0644 "$CWD/$PRGNAM.pam" "$PKG/etc/pam.d/$PRGNAM" +make -C man DESTDIR="$PKG" MANDIR=/usr/man PREFIX=/usr install + +cd $TMP/$PRGNAM-$VERSION + +find $PKG | xargs file | egrep "ELF.*executable" | cut -f 1 -d : \ + | xargs strip --strip-unneeded 2> /dev/null + +# move this file to 'rc.4.local' for Slackware to boot directly +# to greetd from init level 4 startup +mkdir -p $PKG/etc/rc.d +cp -a $CWD/rc.4.$PRGNAM $PKG/etc/rc.d/rc.4.$PRGNAM +chmod 0644 $PKG/etc/rc.d/rc.4.$PRGNAM + +# create this in pkg to ensure it exists with proper perms +mkdir -p $PKG/var/lib/$PRGNAM +chown -R $PRGUID:$PRGGID $PKG/var/lib/$PRGNAM + +gzip -9 $PKG/usr/man/man?/* + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/greetd/greetd.info b/system/greetd/greetd.info new file mode 100644 index 0000000000..6b60d2a6ae --- /dev/null +++ b/system/greetd/greetd.info @@ -0,0 +1,104 @@ +PRGNAM="greetd" +VERSION="0.9.0" +HOMEPAGE="https://git.sr.ht/~kennylevinsen/greetd" +DOWNLOAD="https://static.crates.io/crates/async-trait/async-trait-0.1.60.crate \ + https://static.crates.io/crates/autocfg/autocfg-1.1.0.crate \ + https://static.crates.io/crates/bitflags/bitflags-1.3.2.crate \ + https://static.crates.io/crates/bytes/bytes-1.3.0.crate \ + https://static.crates.io/crates/cfg-if/cfg-if-1.0.0.crate \ + https://static.crates.io/crates/enquote/enquote-1.1.0.crate \ + https://static.crates.io/crates/getopts/getopts-0.2.21.crate \ + https://static.crates.io/crates/itoa/itoa-1.0.5.crate \ + https://static.crates.io/crates/libc/libc-0.2.139.crate \ + https://static.crates.io/crates/log/log-0.4.17.crate \ + https://static.crates.io/crates/memchr/memchr-2.5.0.crate \ + https://static.crates.io/crates/memoffset/memoffset-0.7.1.crate \ + https://static.crates.io/crates/mio/mio-0.8.5.crate \ + https://static.crates.io/crates/nix/nix-0.26.1.crate \ + https://static.crates.io/crates/pam-sys/pam-sys-0.5.6.crate \ + https://static.crates.io/crates/pin-project-lite/pin-project-lite-0.2.9.crate \ + https://static.crates.io/crates/pin-utils/pin-utils-0.1.0.crate \ + https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.49.crate \ + https://static.crates.io/crates/quote/quote-1.0.23.crate \ + https://static.crates.io/crates/rpassword/rpassword-5.0.1.crate \ + https://static.crates.io/crates/ryu/ryu-1.0.12.crate \ + https://static.crates.io/crates/serde/serde-1.0.152.crate \ + https://static.crates.io/crates/serde_derive/serde_derive-1.0.152.crate \ + https://static.crates.io/crates/serde_json/serde_json-1.0.91.crate \ + https://static.crates.io/crates/signal-hook-registry/signal-hook-registry-1.4.0.crate \ + https://static.crates.io/crates/socket2/socket2-0.4.7.crate \ + https://static.crates.io/crates/static_assertions/static_assertions-1.1.0.crate \ + https://static.crates.io/crates/syn/syn-1.0.107.crate \ + https://static.crates.io/crates/thiserror-impl/thiserror-impl-1.0.38.crate \ + https://static.crates.io/crates/thiserror/thiserror-1.0.38.crate \ + https://static.crates.io/crates/tokio-macros/tokio-macros-1.8.2.crate \ + https://static.crates.io/crates/tokio/tokio-1.24.0.crate \ + https://static.crates.io/crates/unicode-ident/unicode-ident-1.0.6.crate \ + https://static.crates.io/crates/unicode-width/unicode-width-0.1.10.crate \ + https://static.crates.io/crates/users/users-0.11.0.crate \ + https://static.crates.io/crates/wasi/wasi-0.11.0+wasi-snapshot-preview1.crate \ + https://static.crates.io/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate \ + https://static.crates.io/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate \ + https://static.crates.io/crates/winapi/winapi-0.3.9.crate \ + https://static.crates.io/crates/windows-sys/windows-sys-0.42.0.crate \ + https://static.crates.io/crates/windows_aarch64_gnullvm/windows_aarch64_gnullvm-0.42.0.crate \ + https://static.crates.io/crates/windows_aarch64_msvc/windows_aarch64_msvc-0.42.0.crate \ + https://static.crates.io/crates/windows_i686_gnu/windows_i686_gnu-0.42.0.crate \ + https://static.crates.io/crates/windows_x86_64_gnu/windows_x86_64_gnu-0.42.0.crate \ + https://static.crates.io/crates/windows_i686_msvc/windows_i686_msvc-0.42.0.crate \ + https://static.crates.io/crates/windows_x86_64_gnullvm/windows_x86_64_gnullvm-0.42.0.crate \ + https://static.crates.io/crates/windows_x86_64_msvc/windows_x86_64_msvc-0.42.0.crate \ + https://git.sr.ht/~kennylevinsen/greetd/archive/0.9.0.tar.gz" +MD5SUM="fdfbe819b079678795b1ee1e1c61b9cb \ + 05d77ef52e90ad161fdd41b252420467 \ + a295edb6953237ebbdfa8e731229f9a3 \ + 4dfac92ee6bdeb44117342cb203dd36c \ + 74634128440dbc3766bda76fdf0aaa05 \ + 14be1ab75b7fa1711d7c81313f15ea4d \ + c3ec5977ecc0f6244ef3be87f5325e72 \ + f2ffcbe94a83f2437ffe47d7dbf4ad04 \ + 2f4991ee29e75b732dbfbbe637506066 \ + b31bf94ffe7e0f2ada93afae1076eaeb \ + 94b8bf179385ff071bdc33b58bf047c0 \ + 48e7cc866f45af55ea3f627e29a2cd98 \ + a8a1c536701e539cdce215fd7f55de9f \ + 5574bd0280c1d59555909f6b598ced79 \ + 1a61e05436ba382ed378ec9cf100fea2 \ + ce6dde2ea2691fdd97632fb8c9b3e042 \ + 07c75fec267864bcbb800ca7709ceae2 \ + e6bfe297f458a83f516e46e9b0ba07b4 \ + 41defdffa40e7cbcc7e17a933c5660ab \ + 1e585d25db7b5bb009b060befc74e9fe \ + 4ca29f2ce41fb9f282c527c1d8ae5cc4 \ + 2d82330c9f218f42ccc9e44c2d18ff8f \ + 3338953ce1388e5ff5fef5aac76ab1f5 \ + 4da6e91a5a30bc8163694b0809798d0e \ + 21b43d5721b3a9c16059acb691f4314d \ + 362eebacce3b2c9204fdef6d1c04d757 \ + c9defe80406280bcfce4ecf31c0200b3 \ + 8efa8e23cddda0540efe4ba8ff60840b \ + 44e45d4d9b0904fd06d6f46107eda592 \ + 3d2277774414ad0f59584e7021b9be06 \ + d6f24a12196b2e717d4fd869f3410e7f \ + 6cdee292cf5bfd88a1608ebe48e3cab7 \ + e522898b2cb1fd23af2695324b3a5c78 \ + 7d6d4fc9fad200d6e295f6930e97e022 \ + d4c929fc9daf131daef04ee7eaa91fd4 \ + e972ea58ec203bfa6c79c1207852298b \ + db96b50050277bf05a3c68534bbb9586 \ + 09de9d01e7331ff3da11f58be8bef0df \ + 0498c4a11448bfc35dc7bb2caa64c753 \ + 110789f2dd21a2ea820ebed976b4b1c2 \ + 86854324255f07e8f64cc11ef8be3b3c \ + 510f0324dbaea90d9d3ca2eea5e71a04 \ + 38cf2b9fa16048f19e0d3b2d73479e50 \ + c373eadcbc79dfc0b580d12851add17d \ + f41cbc66ecf1f5006d0f0a7df2726c73 \ + b04135c0705b10e9866585e1d75e68a3 \ + 404688aa3e82019927df8a16c7d258d1 \ + af714594386b3e648f20d6d923d2357d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="gtk-layer-shell rust16 scdoc" +MAINTAINER="Jay Lanagan" +EMAIL="j@lngn.net" diff --git a/system/greetd/greetd.pam b/system/greetd/greetd.pam new file mode 100644 index 0000000000..743b5ccc6d --- /dev/null +++ b/system/greetd/greetd.pam @@ -0,0 +1,9 @@ +#%PAM-1.0 + +auth required pam_securetty.so +auth requisite pam_nologin.so +auth include system-auth +account include system-auth +session include system-auth +-session optional pam_elogind.so + diff --git a/system/greetd/rc.4.greetd b/system/greetd/rc.4.greetd new file mode 100644 index 0000000000..4633cc781c --- /dev/null +++ b/system/greetd/rc.4.greetd @@ -0,0 +1,11 @@ +#!/bin/bash + +# /etc/rc.d/rc.4.greetd +# Rename this script /etc/rc.d/rc.4.local +# and make it executable and it will be used instead: + +if [ -x /usr/bin/greetd ]; then + exec /usr/bin/greetd +fi + +# EOF diff --git a/system/greetd/slack-desc b/system/greetd/slack-desc new file mode 100644 index 0000000000..44e4c15c16 --- /dev/null +++ b/system/greetd/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------------------------------------------------------| +greetd: greetd (A login manager daemon) +greetd: +greetd: greetd is a minimal and flexible login manager daemon that makes no +greetd: assumptions about what you want to launch. +greetd: +greetd: Homepage: https://git.sr.ht/~kennylevinsen/greetd +greetd: +greetd: +greetd: +greetd: +greetd: |