diff options
-rw-r--r-- | desktop/slock/config.mk.patch | 5 | ||||
-rw-r--r-- | desktop/slock/slock-use_shadow_group.patch | 23 | ||||
-rw-r--r-- | desktop/slock/slock.SlackBuild | 47 | ||||
-rw-r--r-- | desktop/slock/slock.info | 8 |
4 files changed, 32 insertions, 51 deletions
diff --git a/desktop/slock/config.mk.patch b/desktop/slock/config.mk.patch index b6eba0aee0..fb6b565ac1 100644 --- a/desktop/slock/config.mk.patch +++ b/desktop/slock/config.mk.patch @@ -1,6 +1,5 @@ -diff -Nur slock-0.9.orig/config.mk slock-0.9/config.mk ---- slock-0.9.orig/config.mk 2008-07-29 13:22:46.000000000 -0500 -+++ slock-0.9/config.mk 2009-07-06 00:50:51.209930578 -0500 +--- slock-1.0.orig/config.mk 2012-02-11 10:51:37.000000000 +0100 ++++ slock-1.0/config.mk 2012-02-23 23:03:34.416869615 +0100 @@ -15,7 +15,7 @@ # flags diff --git a/desktop/slock/slock-use_shadow_group.patch b/desktop/slock/slock-use_shadow_group.patch deleted file mode 100644 index 62bc1b8c03..0000000000 --- a/desktop/slock/slock-use_shadow_group.patch +++ /dev/null @@ -1,23 +0,0 @@ -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 index 0f31887c72..4b100b2832 100644 --- a/desktop/slock/slock.SlackBuild +++ b/desktop/slock/slock.SlackBuild @@ -1,21 +1,33 @@ #!/bin/sh - # Slackware build script for slock -# Written by Grigorios Bouzakis (grbzks@gmail.com) -# Modified by Robby Workman <rworkman@slackbuilds.org> +# Copyright 2007-2012 Grigorios Bouzakis <grbzks@imap.cc> +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for any purpose +# with or without fee is hereby granted, provided that the above copyright +# notice and this permission notice appear in all copies. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 +# AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS 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. PRGNAM=slock -VERSION=${VERSION:-0.9} +VERSION=${VERSION:-1.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -# Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi @@ -39,6 +51,8 @@ else LIBDIRSUFFIX="" fi +DOCS="LICENSE README" + set -e rm -rf $PKG @@ -57,26 +71,17 @@ find . \ # This uses our CFLAGS defined above 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 \ - PREFIX=/usr \ - X11INC=/usr/include/X11 \ - X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 +make PREFIX=/usr X11INC=/usr/include/X11 X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 +make install PREFIX=/usr X11INC=/usr/include/X11 X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 DESTDIR=$PKG -make install \ - PREFIX=/usr \ - X11INC=/usr/include/X11 \ - X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 \ - DESTDIR=$PKG - -strip --strip-unneeded $PKG/usr/bin/slock chown root:shadow $PKG/usr/bin/slock chmod 2755 $PKG/usr/bin/slock +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/desktop/slock/slock.info b/desktop/slock/slock.info index cfdb55aeae..4675f22f47 100644 --- a/desktop/slock/slock.info +++ b/desktop/slock/slock.info @@ -1,10 +1,10 @@ PRGNAM="slock" -VERSION="0.9" +VERSION="1.0" HOMEPAGE="http://tools.suckless.org/slock" -DOWNLOAD="http://dl.suckless.org/tools/slock-0.9.tar.gz" -MD5SUM="df342ad129cf2c3b8eb8da9d9d0ab845" +DOWNLOAD="http://dl.suckless.org/tools/slock-1.0.tar.gz" +MD5SUM="98503f0dae5acc15c90b81ffd423f987" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Grigorios Bouzakis" -EMAIL="grbzks@gmail.com" +EMAIL="grbzks@imap.cc" APPROVED="rworkman" |