desktop/slock: Added to 12.2 repository

This commit is contained in:
Grigorios Bouzakis 2010-05-12 23:28:21 +02:00 committed by Robby Workman
parent 1d0648b625
commit 2b010ce19c
6 changed files with 139 additions and 0 deletions

1
desktop/slock/README Normal file
View File

@ -0,0 +1 @@
slock is a simple X display locker

View File

@ -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

19
desktop/slock/slack-desc Normal file
View File

@ -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:

View File

@ -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;

View File

@ -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

8
desktop/slock/slock.info Normal file
View File

@ -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"