summaryrefslogtreecommitdiff
path: root/desktop/slock
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/slock')
-rw-r--r--desktop/slock/README1
-rw-r--r--desktop/slock/config.mk.patch25
-rw-r--r--desktop/slock/slack-desc19
-rw-r--r--desktop/slock/slock-use_shadow_group.patch23
-rw-r--r--desktop/slock/slock.SlackBuild63
-rw-r--r--desktop/slock/slock.info8
6 files changed, 139 insertions, 0 deletions
diff --git a/desktop/slock/README b/desktop/slock/README
new file mode 100644
index 0000000000..6825e2e629
--- /dev/null
+++ b/desktop/slock/README
@@ -0,0 +1 @@
+slock is a simple X display locker
diff --git a/desktop/slock/config.mk.patch b/desktop/slock/config.mk.patch
new file mode 100644
index 0000000000..7c659ee51d
--- /dev/null
+++ b/desktop/slock/config.mk.patch
@@ -0,0 +1,25 @@
+--- a/config.mk 2009-01-01 02:25:45.983700591 -0600
++++ b/config.mk 2009-01-01 02:27:16.479701293 -0600
+@@ -4,10 +4,10 @@
+ # Customize below to fit your system
+
+ # paths
+-PREFIX = /usr/local
++PREFIX = /usr
+
+-X11INC = /usr/X11R6/include
+-X11LIB = /usr/X11R6/lib
++X11INC = /usr/include/X11
++X11LIB = /usr/lib/X11
+
+ # includes and libs
+ INCS = -I. -I/usr/include -I${X11INC}
+@@ -15,7 +15,7 @@
+
+ # flags
+ CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
+-CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
++CFLAGS = _SLACKCFLAGS_ -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+ LDFLAGS = -s ${LIBS}
+
+ # On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS and add -DHAVE_BSD_AUTH
diff --git a/desktop/slock/slack-desc b/desktop/slock/slack-desc
new file mode 100644
index 0000000000..7985a02b13
--- /dev/null
+++ b/desktop/slock/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------------------------------------------------------|
+slock: slock (Simple X display locker)
+slock:
+slock: slock is a simple X display locker.
+slock:
+slock: It is stable and quite a lot people in the suckless
+slock: community are using it every day when they are out
+slock: with friends or fetching some food from the local pub.
+slock:
+slock: Homepage: http://www.suckless.org/programs/slock.html
+slock:
+slock:
diff --git a/desktop/slock/slock-use_shadow_group.patch b/desktop/slock/slock-use_shadow_group.patch
new file mode 100644
index 0000000000..62bc1b8c03
--- /dev/null
+++ b/desktop/slock/slock-use_shadow_group.patch
@@ -0,0 +1,23 @@
+Patch by Robby Workman <rworkman@slackbuilds.org>
+This is trivial, and not really ideal, because it hardcodes our
+shadow group's guid (43), but oh well, it works for us. :-)
+
+diff -Nur a/slock.c b/slock.c
+--- a/slock.c 2008-07-29 13:22:46.000000000 -0500
++++ b/slock.c 2009-01-01 02:51:53.815701828 -0600
+@@ -34,12 +34,12 @@
+
+ #ifndef HAVE_BSD_AUTH
+ static const char *
+-get_password() { /* only run as root */
++get_password() { /* only run as shadow group - no need for suid root */
+ const char *rval;
+ struct passwd *pw;
+
+- if(geteuid() != 0)
+- die("slock: cannot retrieve password entry (make sure to suid slock)\n");
++ if(getegid() != 43)
++ die("slock: cannot retrieve password entry (make sure slock is sgid shadow)\n");
+ pw = getpwuid(getuid());
+ endpwent();
+ rval = pw->pw_passwd;
diff --git a/desktop/slock/slock.SlackBuild b/desktop/slock/slock.SlackBuild
new file mode 100644
index 0000000000..eeca7c2756
--- /dev/null
+++ b/desktop/slock/slock.SlackBuild
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# Slackware build script for slock
+
+# Written by Grigorios Bouzakis (grbzks@gmail.com)
+# Modified by Robby Workman <rworkman@slackbuilds.org>
+
+PRGNAM=slock
+VERSION=${VERSION:-0.9}
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+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 {} \;
+
+# This uses our CFLAGS defined above, changes the prefix to /usr and
+# corrects the X11 includes and libs directories
+sed "s/_SLACKCFLAGS_/$SLKCFLAGS/" $CWD/config.mk.patch | patch -p1
+
+# This makes slock requires sgid shadow instead of suid root
+patch -p1 < $CWD/slock-use_shadow_group.patch
+
+make
+make install DESTDIR=$PKG
+strip --strip-unneeded $PKG/usr/bin/slock
+chown root:shadow $PKG/usr/bin/slock
+chmod 2755 $PKG/usr/bin/slock
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE README $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.tgz
diff --git a/desktop/slock/slock.info b/desktop/slock/slock.info
new file mode 100644
index 0000000000..59fdea71e7
--- /dev/null
+++ b/desktop/slock/slock.info
@@ -0,0 +1,8 @@
+PRGNAM="slock"
+VERSION="0.9"
+HOMEPAGE="http://tools.suckless.org/slock"
+DOWNLOAD="http://code.suckless.org/dl/tools/slock-0.9.tar.gz"
+MD5SUM="df342ad129cf2c3b8eb8da9d9d0ab845"
+MAINTAINER="Grigorios Bouzakis"
+EMAIL="grbzks@gmail.com"
+APPROVED="rworkman"