3 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4 # Version 2, December 2004
6 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
8 # Everyone is permitted to copy and distribute verbatim or modified
9 # copies of this license document, and changing it is allowed as long
10 # as the name is changed.
12 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
13 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16 # 0. You just DO WHAT THE FUCK YOU WANT TO.
18 # SlackBuild script for slock
19 # ===========================
20 # By: r1w1s1 (https://fosstodon.org/@r1w1s1)
22 # Descr: slock is a simple X display locker.
23 # URL: https://www.suckless.org/programs/slock.html
25 # v1.4: Grabbed from slackbuilds.org
26 # v1.5: 17/july/2024 by r1w1s1 - update build and clean-up the slackbuild script
28 cd $
(dirname $0) ; CWD
=$
(pwd)
31 VERSION
=${VERSION:-1.5}
34 PKGTYPE
=${PKGTYPE:-tgz}
36 if [ -z "$ARCH" ]; then
37 case "$( uname -m )" in
40 *) ARCH
=$
( uname
-m ) ;;
44 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
45 # the name of the created package would be, and then exit. This information
46 # could be useful to other scripts.
47 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
48 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
53 PKG
=$TMP/package-
$PRGNAM
54 OUTPUT
=${OUTPUT:-/tmp}
56 if [ "$ARCH" = "i586" ]; then
57 SLKCFLAGS
="-O2 -march=i586 -mtune=i686"
59 elif [ "$ARCH" = "x86_64" ]; then
72 mkdir
-p $TMP $PKG $OUTPUT
75 # Download and extract the source code
76 rm -rf "${PRGNAM}-${VERSION}"
77 wget
-O "${PRGNAM}-${VERSION}.tar.gz" "https://dl.suckless.org/tools/${PRGNAM}-${VERSION}.tar.gz"
78 tar xvf
"${PRGNAM}-${VERSION}.tar.gz"
79 cd "${PRGNAM}-${VERSION}"
83 \
( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \
) \
84 -exec chmod 755 {} \
; -o \
85 \
( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \
) \
92 X11INC
=/usr
/include
/X11 \
93 X11LIB
=/usr
/lib
${LIBDIRSUFFIX}/X11
98 X11INC
=/usr
/include
/X11 \
99 X11LIB
=/usr
/lib
${LIBDIRSUFFIX}/X11 \
102 # This approach was preferable, but since slock must have root privs to
103 # adjust its OOM score, oh well...
104 #chown root:shadow $PKG/usr/bin/slock
105 #chmod 2755 $PKG/usr/bin/slock
106 chmod 4755 $PKG/usr
/bin
/slock
108 find $PKG -print0 |
xargs -0 file |
grep -e "executable" -e "shared object" |
grep ELF \
109 | cut
-f 1 -d : |
xargs strip
--strip-unneeded 2> /dev
/null || true
111 gzip -9 $PKG/usr
/man
/man?
/*.?
113 mkdir
-p $PKG/usr
/doc
/$PRGNAM-$VERSION
114 cp -a $DOCS $PKG/usr
/doc
/$PRGNAM-$VERSION
115 cat $CWD/$PRGNAM.SlackBuild
> $PKG/usr
/doc
/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
117 mkdir
-p $PKG/install
118 cat $CWD/slack-desc
> $PKG/install
/slack-desc
121 /sbin
/makepkg
-l y
-c n
$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.
$PKGTYPE