source: npl/system/procps_ng/procps-ng.SlackBuild.orig @ 4933918

perl-5.22
Last change on this file since 4933918 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: 7.5 KB
Line 
1#!/bin/sh
2
3# Copyright 2005-2016  Patrick J. Volkerding, Sebeka, Minnesota, 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
23PKGNAM=procps-ng
24VERSION=${VERSION:-3.3.11}
25PSMISCVER=${PSMISCVER:-22.21}
26PROCINFONGVER=${PROCINFONGVER:-2.0.304}
27PROCINFOVER=${PROCINFOVER:-18}
28BUILD=${BUILD:-1}
29
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) ARCH=i586 ;;
33    arm*) ARCH=arm ;;
34       *) ARCH=$( uname -m ) ;;
35  esac
36fi
37
38NUMJOBS=${NUMJOBS:-" -j7 "}
39
40CWD=$(pwd)
41TMP=${TMP:-/tmp}
42PKG=$TMP/package-$PKGNAM
43
44if [ "$ARCH" = "i586" ]; then
45  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
46  LIBDIRSUFFIX=""
47elif [ "$ARCH" = "i686" ]; then
48  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
49  LIBDIRSUFFIX=""
50elif [ "$ARCH" = "x86_64" ]; then
51  SLKCFLAGS="-O2 -fPIC"
52  LIBDIRSUFFIX="64"
53else
54  SLKCFLAGS="-O2"
55  LIBDIRSUFFIX=""
56fi
57
58rm -rf $PKG
59mkdir -p $TMP $PKG
60cd $TMP
61rm -rf $PKGNAM-$VERSION
62tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
63cd $PKGNAM-$VERSION || exit 1
64tar xvf $CWD/psmisc-$PSMISCVER.tar.xz || exit 1
65tar xvf $CWD/procinfo-ng-$PROCINFONGVER.tar.xz || exit 1
66tar xvf $CWD/procinfo-$PROCINFOVER.tar.xz || exit 1
67chown -R root:root .
68
69find -L . \
70 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
71  -o -perm 511 \) -exec chmod 755 {} \; -o \
72 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
73  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
74
75CFLAGS="$SLKCFLAGS" \
76CXXFLAGS="$SLKCFLAGS" \
77./configure \
78  --prefix=/ \
79  --bindir=/bin \
80  --sbindir=/sbin \
81  --libdir=/usr/lib${LIBDIRSUFFIX} \
82  --includedir=/usr/include \
83  --sysconfdir=/etc \
84  --localstatedir=/var \
85  --mandir=/usr/man \
86  --datarootdir=/usr/share \
87  --docdir=/usr/doc/$PKGNAM-$VERSION \
88  --enable-static=no \
89  --disable-silent-rules \
90  --disable-rpath \
91  --enable-watch8bit \
92  --enable-skill \
93  --enable-sigwinch \
94  --enable-w-from \
95  --disable-kill \
96  --without-systemd \
97  --disable-modern-top \
98  --build=$ARCH-slackware-linux || exit 1
99
100make $NUMJOBS || exit 1
101make install DESTDIR=$PKG || exit 1
102
103# Move the shared library to $PKG/lib${LIBDIRSUFFIX}:
104mkdir -p $PKG/lib${LIBDIRSUFFIX}
105( cd $PKG/usr/lib${LIBDIRSUFFIX}
106  for file in lib*.so.?.* ; do
107    mv $file ../../lib${LIBDIRSUFFIX}
108    ln -sf ../../lib${LIBDIRSUFFIX}/$file .
109  done
110  cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
111)
112
113# Remove .la file(s):
114rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
115
116# It seems that upstream has shuffled the location of many tools with the
117# 3.3.11 release.  To me, this just doesn't make sense to break any existing
118# scripts that might be using an absolute path, or to move tools that might
119# be needed before /usr is mounted into /usr.  So, we will make sure that
120# everything is moved back to where the Slackware locations have always been.
121# These tools belong in /bin:
122mkdir -p $PKG/bin
123for file in free killall ps ; do
124  find $PKG -name $file -exec mv "{}" $PKG/bin \;
125done
126# These tools belong in /sbin:
127mkdir -p $PKG/sbin
128for file in pidof sysctl ; do
129  find $PKG -name $file -exec mv "{}" $PKG/sbin \;
130done
131mkdir -p $PKG/usr/bin
132# These tools belong in /usr/bin:
133for file in fuser lsdev peekfd pgrep pkill pmap procinfo prtstat pstree pwdx skill slabtop snice socklist tload top uptime vmstat w watch ; do
134  find $PKG -name $file -exec mv "{}" $PKG/usr/bin \;
135done
136# These symlinks belong in /bin:
137rm -f $PKG/bin/pidof
138ln -sf /sbin/pidof $PKG/bin/pidof
139# These symlinks belong in /usr/bin:
140rm -f $PKG/usr/bin/free $PKG/usr/bin/pidof $PKG/usr/bin/ps
141ln -sf /bin/free $PKG/usr/bin/free
142ln -sf /sbin/pidof $PKG/usr/bin/pidof
143ln -sf /bin/ps $PKG/usr/bin/ps
144
145# Create /etc/sysctl.d:
146mkdir -p $PKG/etc/sysctl.d
147
148cd psmisc-$PSMISCVER || exit 1
149
150# Fix fuser -s:
151zcat $CWD/psmisc.3638cc55b4d08851faba46635d737b24d016665b.diff.gz | patch -p1 --verbose || exit 1
152
153CFLAGS="$SLKCFLAGS" \
154CXXFLAGS="$SLKCFLAGS" \
155./configure \
156  --prefix=/usr \
157  --libdir=/usr/lib${LIBDIRSUFFIX} \
158  --sysconfdir=/etc \
159  --localstatedir=/var \
160  --mandir=/usr/man \
161  --docdir=/usr/doc/psmisc-$PSMISCVER \
162  --disable-silent-rules \
163  --disable-rpath \
164  --build=$ARCH-slackware-linux || exit 1
165
166make $NUMJOBS || exit 1
167make install DESTDIR=$PKG || exit 1
168
169# Move "killall" to the traditional location:
170mv $PKG/usr/bin/killall $PKG/bin
171ln -s /bin/killall $PKG/usr/bin/killall
172
173mkdir -p $PKG/usr/doc/psmisc-$PSMISCVER
174cp -a ChangeLog COPYING* NEWS README* $PKG/usr/doc/psmisc-$PSMISCVER
175
176# If there's a ChangeLog, installing at least part of the recent history
177# is useful, but don't let it get totally out of control:
178if [ -r ChangeLog ]; then
179  DOCSDIR=$PKG/usr/doc/psmisc-$PSMISCVER
180  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
181  touch -r ChangeLog $DOCSDIR/ChangeLog
182fi
183
184cd ../procinfo-ng-$PROCINFONGVER || exit 1
185CFLAGS="$SLKCFLAGS" \
186CXXFLAGS="$SLKCFLAGS" \
187./configure \
188  --prefix=/usr \
189  --libdir=/usr/lib${LIBDIRSUFFIX} \
190  --sysconfdir=/etc \
191  --localstatedir=/var \
192  --mandir=/usr/man \
193  --docdir=/usr/doc/procinfo-ng-$PROCINFONGVER \
194  --enable-maintainer-mode \
195  --build=$ARCH-slackware-linux || exit 1
196
197make $NUMJOBS || exit 1
198make install DESTDIR=$PKG || exit 1
199
200mkdir -p $PKG/usr/doc/procinfo-ng-$PROCINFONGVER
201cp -a GPL-2.txt LGPL-2.1.txt LICENSE.txt  $PKG/usr/doc/procinfo-ng-$PROCINFONGVER
202
203# Now install a couple of scripts from the original procinfo package.
204cd ../procinfo-$PROCINFOVER || exit 1
205install -m 0755 lsdev.pl $PKG/usr/bin/lsdev
206install -m 0755 socklist.pl $PKG/usr/bin/socklist
207install -m 0644 lsdev.8 socklist.8 $PKG/usr/man/man8
208
209# Strip binaries:
210( cd $PKG
211  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
212  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
213)
214
215# Compress and link manpages, if any:
216if [ -d $PKG/usr/man ]; then
217  ( cd $PKG/usr/man
218    for manpagedir in $(find . -type d -name "man*") ; do
219      ( cd $manpagedir
220        for eachpage in $( find . -type l -maxdepth 1 | grep -v '\.gz$') ; do
221          ln -s $( readlink $eachpage ).gz $eachpage.gz
222          rm $eachpage
223        done
224        gzip -9 *.?
225      )
226    done
227  )
228fi
229
230# Back to the procps-ng main source directory...
231cd ..
232
233mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
234cp -a \
235  AUTHORS ChangeLog COPYING* NEWS  \
236  $PKG/usr/doc/$PKGNAM-$VERSION
237
238# If there's a ChangeLog, installing at least part of the recent history
239# is useful, but don't let it get totally out of control:
240if [ -r ChangeLog ]; then
241  DOCSDIR=$PKG/usr/doc/$PKGNAM-$VERSION
242  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
243  touch -r ChangeLog $DOCSDIR/ChangeLog
244fi
245
246mkdir -p $PKG/install
247cat $CWD/slack-desc > $PKG/install/slack-desc
248
249cd $PKG
250/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
251
Note: See TracBrowser for help on using the repository browser.