1 | #!/bin/sh |
---|
2 | |
---|
3 | # Copyright 2008, 2009, 2010 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 | |
---|
24 | VERSION=7.6 |
---|
25 | BUILD=${BUILD:-1} |
---|
26 | |
---|
27 | # Automatically determine the architecture we're building on: |
---|
28 | if [ -z "$ARCH" ]; then |
---|
29 | case "$( uname -m )" in |
---|
30 | i?86) export ARCH=i486 ;; |
---|
31 | arm*) export ARCH=arm ;; |
---|
32 | # Unless $ARCH is already set, use uname -m for all other archs: |
---|
33 | *) export ARCH=$( uname -m ) ;; |
---|
34 | esac |
---|
35 | fi |
---|
36 | |
---|
37 | NUMJOBS=${NUMJOBS:-" -j7 "} |
---|
38 | |
---|
39 | if [ "$ARCH" = "x86_64" ]; then |
---|
40 | LIBDIRSUFFIX="64" |
---|
41 | else |
---|
42 | LIBDIRSUFFIX="" |
---|
43 | fi |
---|
44 | |
---|
45 | CWD=$(pwd) |
---|
46 | TMP=${TMP:-/tmp} |
---|
47 | PKG=$TMP/package-tcp_wrappers |
---|
48 | |
---|
49 | rm -rf $PKG |
---|
50 | mkdir -p $TMP $PKG |
---|
51 | |
---|
52 | cd $TMP |
---|
53 | rm -rf tcp_wrappers-$VERSION |
---|
54 | tar xvf $CWD/tcp_wrappers_$VERSION.tar.gz || exit 1 |
---|
55 | cd tcp_wrappers-$VERSION || exit 1 |
---|
56 | |
---|
57 | chown -R root:root . |
---|
58 | find . \ |
---|
59 | \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ |
---|
60 | -exec chmod 755 {} \; -o \ |
---|
61 | \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ |
---|
62 | -exec chmod 644 {} \; |
---|
63 | |
---|
64 | sh extract-and-patch.sh |
---|
65 | cd tcp_wrappers_$VERSION || exit 1 |
---|
66 | make REAL_DAEMON_DIR=/usr/sbin linux |
---|
67 | strip tcpd safe_finger tcpdchk tcpdmatch try-from |
---|
68 | mkdir -p $PKG/usr/lib${LIBDIRSUFFIX} |
---|
69 | cat libwrap.a > $PKG/usr/lib${LIBDIRSUFFIX}/libwrap.a |
---|
70 | mkdir -p $PKG/usr/include |
---|
71 | cat tcpd.h > $PKG/usr/include/tcpd.h |
---|
72 | mkdir -p $PKG/usr/sbin |
---|
73 | cat safe_finger > $PKG/usr/sbin/safe_finger |
---|
74 | cat tcpd > $PKG/usr/sbin/tcpd |
---|
75 | cat tcpdchk > $PKG/usr/sbin/tcpdchk |
---|
76 | cat tcpdmatch > $PKG/usr/sbin/tcpdmatch |
---|
77 | cat try-from > $PKG/usr/sbin/try-from |
---|
78 | chmod 755 $PKG/usr/sbin/* |
---|
79 | mkdir -p $PKG/usr/man/man{3,5,8} |
---|
80 | cat hosts_access.3 | gzip -9c > $PKG/usr/man/man3/hosts_access.3.gz |
---|
81 | cat hosts_access.5 | gzip -9c > $PKG/usr/man/man5/hosts_access.5.gz |
---|
82 | cat hosts_options.5 | gzip -9c > $PKG/usr/man/man5/hosts_options.5.gz |
---|
83 | cat tcpd.8 | gzip -9c > $PKG/usr/man/man8/tcpd.8.gz |
---|
84 | cat tcpdchk.8 | gzip -9c > $PKG/usr/man/man8/tcpdchk.8.gz |
---|
85 | cat tcpdmatch.8 | gzip -9c > $PKG/usr/man/man8/tcpdmatch.8.gz |
---|
86 | |
---|
87 | mkdir -p $PKG/usr/doc/tcp_wrappers_$VERSION |
---|
88 | cp -a \ |
---|
89 | BLURB CHANGES DISCLAIMER README README.NIS \ |
---|
90 | $PKG/usr/doc/tcp_wrappers_$VERSION |
---|
91 | |
---|
92 | # Finish up the package: |
---|
93 | mkdir -p $PKG/install |
---|
94 | cat $CWD/slack-desc > $PKG/install/slack-desc |
---|
95 | |
---|
96 | # Build the package: |
---|
97 | cd $PKG |
---|
98 | /sbin/makepkg -l y -c n $TMP/tcp_wrappers-$VERSION-$ARCH-$BUILD.txz |
---|
99 | |
---|