source: npl/system/sudo/sudo.SlackBuild @ b4abfab

perl-5.22
Last change on this file since b4abfab was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 3.8 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23
24PKGNAM=sudo
25VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26BUILD=${BUILD:-1}
27
28NUMJOBS=${NUMJOBS:-" -j7 "}
29
30CWD=$(pwd)
31TMP=${TMP:-/tmp}
32PKG=$TMP/package-sudo
33OUTPUT=${OUTPUT:-/tmp}
34rm -rf $PKG
35mkdir -p $TMP $PKG/var/{lib,db}
36
37CHOST="i586-pc-linux-gnu"
38CFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"
39CXXFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"
40
41cd $TMP
42rm -rf sudo-$VERSION
43tar xvf $CWD/sudo-$VERSION.tar.gz || exit 1
44cd sudo-$VERSION
45
46chown -R root:root .
47find . \
48  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
49  -exec chmod 755 {} \; -o \
50  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
51  -exec chmod 644 {} \;
52
53./configure \
54  --prefix=/usr \
55  --sbindir=/usr/sbin \
56  --mandir=/usr/man \
57  --docdir=/usr/doc/sudo-$VERSION \
58  --with-env-editor \
59  --disable-pam-session \
60  --with-pam=no \
61  --with-timedir=/var/db/sudo \
62  --build=i586-slackware-linux
63
64make $NUMJOBS || make || exit 1
65make install DESTDIR=$PKG || exit 1
66
67( cd $PKG/usr/bin
68  chmod 4711 sudo
69  ln -sf sudo sudoedit
70)
71chmod 755 $PKG/usr/sbin/visudo
72
73rm -f $PKG/usr/man/man8/sudoedit.8
74gzip -9 $PKG/usr/man/man?/*.?
75( cd $PKG/usr/man/man8 ; ln -sf sudo.8.gz sudoedit.8.gz )
76
77find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
78  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
79
80mv $PKG/etc/sudoers $PKG/etc/sudoers.new
81
82rm -r $PKG/usr/doc/sudo-$VERSION
83mkdir -p $PKG/usr/doc/sudo-$VERSION
84cp -a \
85  BUGS HISTORY INSTALL LICENSE PORTING README* \
86  RUNSON TODO TROUBLESHOOTING UPGRADE WHATSNEW \
87  $PKG/usr/doc/sudo-$VERSION
88chmod 644 $PKG/usr/doc/sudo-$VERSION/*
89
90# If there's a ChangeLog, installing at least part of the recent history
91# is useful, but don't let it get totally out of control:
92if [ -r ChangeLog ]; then
93  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
94  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
95  touch -r ChangeLog $DOCSDIR/ChangeLog
96fi
97
98mkdir -p $PKG/install
99cat $CWD/slack-desc > $PKG/install/slack-desc
100zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
101# Build the package:
102cd $PKG                                                                                                                                               
103/sbin/makepkg -l n -c n $CWD/$PKGNAM.pkg                                                                                                             
104echo $VERSION > $CWD/$PKGNAM.version &&                                                                                                               
105arch > $CWD/$PKGNAM.arch                                                                                                                             
106cd $OUTPUT
Note: See TracBrowser for help on using the repository browser.