source: npl/overig/m4/m4.SlackBuild @ 03d3a6f

perl-5.22
Last change on this file since 03d3a6f 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: 4.2 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2011  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=m4
24VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
25BUILD=${BUILD:-1}
26
27NUMJOBS=${NUMJOBS:-" -j7 "}
28
29# Automatically determine the architecture we're building on:
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) export ARCH=i486 ;;
33    arm*) export ARCH=arm ;;
34    # Unless $ARCH is already set, use uname -m for all other archs:
35       *) export ARCH=$( uname -m ) ;;
36  esac
37fi
38
39CWD=$(pwd)
40TMP=${TMP:-/tmp}
41PKG=$TMP/package-m4
42
43if [ "$ARCH" = "i486" ]; then
44  SLKCFLAGS="-O2"
45  LIBDIRSUFFIX=""
46elif [ "$ARCH" = "s390" ]; then
47  SLKCFLAGS="-O2"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "x86_64" ]; then
50  SLKCFLAGS="-O2 -fPIC"
51  LIBDIRSUFFIX="64"
52else
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55fi
56
57rm -rf $PKG
58mkdir -p $TMP $PKG
59
60cd $TMP
61rm -rf m4-$VERSION
62tar xvf $CWD/m4-$VERSION.tar.xz || exit 1
63cd m4-$VERSION || exit 1
64chown -R root:root .
65find . \
66  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
67  -exec chmod 755 {} \; -o \
68  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
69  -exec chmod 644 {} \;
70
71CFLAGS="$SLKCFLAGS" \
72./configure \
73  --prefix=/usr \
74  --libdir=/usr/lib${LIBDIRSUFFIX} \
75  --mandir=/usr/man \
76  --infodir=/usr/info \
77  --docdir=/usr/doc/m4-$VERSION \
78  --build=$ARCH-slackware-linux || exit 1
79
80make $NUMJOBS || make || exit 1
81make install DESTDIR=$PKG || exit 1
82
83# Compress and if needed symlink the man pages:
84if [ -d $PKG/usr/man ]; then
85  ( cd $PKG/usr/man
86    for manpagedir in $(find . -type d -name "man*") ; do
87      ( cd $manpagedir
88        for eachpage in $( find . -type l -maxdepth 1) ; do
89          ln -s $( readlink $eachpage ).gz $eachpage.gz
90          rm $eachpage
91        done
92        gzip -9 *.?
93      )
94    done
95  )
96fi
97
98# Compress info pages and purge "dir" file from the package:
99if [ -d $PKG/usr/info ]; then
100  rm -f $PKG/usr/info/dir
101  gzip -9 $PKG/usr/info/*
102fi
103
104# ye olde cruft
105#
106# ansi2knr is no longer part of the m4 sources.
107# Geez, I'm gonna have to learn ANSI C now...
108#
109#( cd src ; make ansi2knr )
110#gzip -9 $PKG/usr/info/m4.info.gz
111#cat src/m4 > $PKG/usr/bin/m4
112#chmod 755 $PKG/usr/bin/*
113
114find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
115  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
116
117mkdir -p $PKG/usr/doc/m4-$VERSION
118cp -a \
119  BACKLOG COPYING* NEWS README* THANKS TODO examples \
120  $PKG/usr/doc/m4-$VERSION
121
122# If there's a ChangeLog, installing at least part of the recent history
123# is useful, but don't let it get totally out of control:
124if [ -r ChangeLog ]; then
125  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
126  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
127  touch -r ChangeLog $DOCSDIR/ChangeLog
128fi
129
130mkdir -p $PKG/install
131cat $CWD/slack-desc > $PKG/install/slack-desc
132
133cd $PKG
134/sbin/makepkg -l y -c n $TMP/m4-$VERSION-$ARCH-$BUILD.txz
135
136
137############ make syn3 packages
138cd $CWD
139for PKG in /tmp/package-*; do
140        NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/'`
141
142        #seperate dev-package
143        syn3_move_dev $PKG $PKG""_dev
144        syn3_makepkg $PKG""_dev $NAME""_dev $VERSION $ARCH || exit 1
145
146        #make main package
147        syn3_makepkg $PKG $NAME $VERSION $ARCH || exit 1
148done
Note: See TracBrowser for help on using the repository browser.