diff options
Diffstat (limited to 'patches/sudo/sudo.SlackBuild')
-rwxr-xr-x | patches/sudo/sudo.SlackBuild | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/patches/sudo/sudo.SlackBuild b/patches/sudo/sudo.SlackBuild new file mode 100755 index 00000000..289ef526 --- /dev/null +++ b/patches/sudo/sudo.SlackBuild @@ -0,0 +1,129 @@ +#!/bin/bash +# +# Got it from http://slamd64.he.net/slamd64-10.2b/source/ap/sudo/sudo.SlackBuild +# Small changes by rhatto +# + +# Set initial variables: +CWD=`pwd` + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +PACKAGE="sudo" +VERSION=${VERSION:=1.6.8p12} +ARCH=${ARCH:=i486} +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC:=$CWD} +TMP=${TMP:=/tmp} +REPOS=${REPOS:=$TMP} + +RTOOL="wget" +PACKAGE_EXT="gz" +SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" +URL="http://www.sudo.ws/sudo/dist/$SRC" + +if [ "$PACKAGE_EXT" == "bz2" ]; then + tarflag="j" +else + tarflag="z" +fi + +SRC_DIR="$SRC_DIR/$PACKAGE" +mkdir -p $SRC_DIR + +if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then + rm -f $SRC_DIR/$SRC.sig + wget "$URL" -O "$SRC_DIR/$SRC" + wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" +fi + +gpg --import << EOGPG +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.0.7 (OpenBSD) + +mQGiBD2bdiURBACyoSsYq9t8jiLnhABRZcgDP2vaoJoGJD3eb9HNsv2+0IrcHaut +s1QR1AY88AGTMnQTFWjH1vIXz/YCKnvgqklfbVCMehvkOUKvGv2eP7IkmWvVPIQb +kayHCtChOKW86hqxZXyT8sbBJqHGHq7xBbg71uZ/CSaTY3ATencR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RC.sig $SRC || echo WARNING: Could not check signature or WRONG signature found. + +TMP="$TMP/$PACKAGE" +PKG=$TMP/package-sudo +rm -rf $TMP +mkdir -p $PKG + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2" +fi + +cd $TMP +rm -rf sudo-$VERSION +tar xvf$tarflag $SRC_DIR/$SRC +cd sudo-$VERSION +chown -R root.root . +CFLAGS="$SLKCFLAGS" \ +./configure --prefix=/usr --sbindir=/usr/sbin --with-getpass --with-C2 +make || exit 32 +make install DESTDIR=$PKG +chown -R root:bin $PKG/usr/bin $PKG/usr/sbin +( cd $PKG/usr/bin + chmod 4711 sudo + ln -sf sudo sudoedit +) +chmod 755 $PKG/usr/sbin/visudo +rm -f $PKG/usr/man/man8/sudoedit.8 +gzip -9 $PKG/usr/man/man?/*.? +( cd $PKG/usr/man/man8 ; ln -sf sudo.8.gz sudoedit.8.gz ) +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) +mv $PKG/etc/sudoers $PKG/etc/sudoers.new +mkdir -p $PKG/usr/doc/sudo-$VERSION +cp -a \ + BUGS HISTORY INSTALL LICENSE PORTING README README.LDAP RUNSON TODO TROUBLESHOOTING UPGRADE \ + $PKG/usr/doc/sudo-$VERSION +chmod 644 $PKG/usr/doc/sudo-$VERSION/* +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh + +# Build the package: +cd $PKG +makepkg -l y -c n $REPOS/sudo-$VERSION-$ARCH-$BUILD.tgz + +if [ "$CLEANUP" == "yes" ]; then + rm -rf $TMP +fi + |