source: npl/internetserver/ppp/ppp.SlackBuild.orig

Last change on this file was ddea341, checked in by Edwin Eefting <edwin@datux.nl>, 7 years ago

update ppp pptp for windows 10

  • Property mode set to 100755
File size: 5.3 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2013, 2015  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
23VERSION=2.4.7
24RADVER=1.1.6
25PPPVER=1.98
26BUILD=${BUILD:-1}
27
28NUMJOBS=${NUMJOBS:-" -j7 "}
29
30# Automatically determine the architecture we're building on:
31if [ -z "$ARCH" ]; then
32  case "$( uname -m )" in
33    i?86) export ARCH=i486 ;;
34    arm*) export ARCH=arm ;;
35    # Unless $ARCH is already set, use uname -m for all other archs:
36       *) export ARCH=$( uname -m ) ;;
37  esac
38fi
39
40if [ "$ARCH" = "x86_64" ]; then
41  LIBDIRSUFFIX="64"
42else
43  LIBDIRSUFFIX=""
44fi
45
46CWD=$(pwd)
47TMP=${TMP:-/tmp}
48PKG=$TMP/package-ppp
49
50rm -rf $PKG
51mkdir -p $TMP $PKG
52
53echo "+============+"
54echo "| ppp-$VERSION |"
55echo "+============+"
56cd $TMP
57rm -rf ppp-$VERSION
58tar xvf $CWD/ppp-$VERSION.tar.xz || exit 1
59cd ppp-$VERSION || exit 1
60chown -R root:root .
61find . \
62  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
63  -exec chmod 755 {} \; -o \
64  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
65  -exec chmod 644 {} \;
66
67zcat $CWD/ppp.slack.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
68sed -i -e "s#lib/pppd#lib${LIBDIRSUFFIX}/pppd#g" $(grep -lr 'lib/pppd' *)
69
70# This conflicts with the header in 3.5+ kernels:
71rm -f include/linux/if_pppol2tp.h
72
73zcat $CWD/ppp.CVE-2015-3310.diff.gz | patch -p1 --verbose || exit 1
74
75./configure \
76  --prefix=/usr \
77  --libdir=/usr/lib${LIBDIRSUFFIX}
78make $NUMJOBS || make || exit 1
79make install DESTDIR=$PKG/usr
80
81# Install PPP config files:
82mkdir -p $PKG/etc/ppp
83cp -a etc.ppp/* $PKG/etc/ppp
84chmod 600 $PKG/etc/ppp/*secrets
85( cd $PKG/etc/ppp
86  mv chap-secrets chap-secrets.new
87  mv options options.new
88  mv pap-secrets pap-secrets.new
89)
90zcat $CWD/options.new.gz > $PKG/etc/ppp/options.new
91
92# Fix what seems like an insecure default setting.
93# Feel free to "chmod 4750 pppoatm.so rp-pppoe.so" at your own risk.
94# Since they are only runnable by group root, the risk really isn't much...
95chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/pppd/*/*.so
96
97mkdir -p $PKG/usr/doc/ppp-$VERSION
98cp -a \
99  FAQ PLUGINS README* SETUP scripts \
100  $PKG/usr/doc/ppp-$VERSION
101
102echo "+====================+"
103echo "| freeradius-client-$RADVER |"
104echo "+====================+"
105cd $TMP
106rm -rf freeradius-client-$RADVER
107tar xf $CWD/freeradius-client-$RADVER.tar.xz || exit 1
108cd freeradius-client-$RADVER || exit 1
109chown -R root:root .
110./configure \
111  --prefix=/usr \
112  --libdir=/usr/lib${LIBDIRSUFFIX} \
113  --sysconfdir=/etc \
114  --build=$ARCH-slackware-linux
115make $NUMJOBS || make || exit 1
116make install DESTDIR=$PKG || exit 1
117zcat $CWD/radius.msdict.gz > $PKG/etc/radiusclient/dictionary.microsoft
118zcat $CWD/realms.gz > $PKG/etc/radiusclient/realms
119( cd $PKG/etc/radiusclient
120  chmod 600 realms servers
121  mv issue issue.new
122  mv radiusclient.conf radiusclient.conf.new
123  mv realms realms.new
124  mv servers servers.new
125)
126mkdir -p $PKG/usr/doc/freeradius-client-$RADVER
127cp -a \
128  BUGS COPYRIGHT README README.radexample doc/instop.html \
129  $PKG/usr/doc/freeradius-client-$RADVER
130chmod 644 $PKG/usr/doc/freeradius-client-$RADVER/*
131
132echo "+===============+"
133echo "| pppsetup-$PPPVER |"
134echo "+===============+"
135cd $TMP
136rm -rf pppsetup-$PPPVER
137tar xvf $CWD/pppsetup-$PPPVER.tar.xz || exit 1
138cd pppsetup-$PPPVER || exit 1
139chown -R root:root .
140zcat $CWD/pppsetup-1.98.slack.diff.gz | patch -p1 --backup || exit
141zcat $CWD/pppsetup-1.98.pppoff.diff.gz | patch -p0 --backup || exit
142zcat $CWD/pppsetup-1.98.moredevs.diff.gz | patch -p1 --backup || exit
143zcat $CWD/pppsetup-1.98.backupfiles.diff.gz | patch -p1 --backup || exit
144chmod 755 ppp-off pppsetup
145cp -a ppp-off pppsetup $PKG/usr/sbin
146mkdir -p $PKG/usr/doc/pppsetup
147cp -a \
148  README.pppsetup ppp-compile.txt pppsetup-$PPPVER.README pppsetup-$PPPVER.lsm \
149  $PKG/usr/doc/pppsetup
150
151( cd $PKG
152  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
153  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
154  find . -name "*.a" | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null
155)
156
157chmod 755 $PKG/usr/sbin/*
158
159gzip -9 $PKG/usr/man/man?/*.?
160chmod 644 $PKG/usr/man/man?/*
161
162mkdir -p $PKG/install
163zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
164cat $CWD/slack-desc > $PKG/install/slack-desc
165
166# Build the package:
167cd $PKG
168/sbin/makepkg -l y -c n $TMP/ppp-$VERSION-$ARCH-$BUILD.txz
169
Note: See TracBrowser for help on using the repository browser.