source: npl/overig/aspell/aspell.SlackBuild.orig @ f33f781

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

php7 and deps

  • Property mode set to 100755
File size: 3.7 KB
RevLine 
[f33f781]1#!/bin/bash
2
3# Copyright 2008, 2009, 2010, 2018, 2019  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
23cd $(dirname $0) ; CWD=$(pwd)
24
25PKGNAM=aspell
26VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
27BUILD=${BUILD:-3}
28
29# Automatically determine the architecture we're building on:
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) export ARCH=i586 ;;
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
39# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
40# the name of the created package would be, and then exit. This information
41# could be useful to other scripts.
42if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
43  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
44  exit 0
45fi
46
47NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
48
49if [ "$ARCH" = "i586" ]; then
50  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
51  LIBDIRSUFFIX=""
52elif [ "$ARCH" = "s390" ]; then
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55elif [ "$ARCH" = "x86_64" ]; then
56  SLKCFLAGS="-O2 -fPIC"
57  LIBDIRSUFFIX="64"
58else
59  SLKCFLAGS="-O2"
60  LIBDIRSUFFIX=""
61fi
62
63TMP=${TMP:-/tmp}
64PKG=$TMP/package-aspell
65
66rm -rf $PKG
67mkdir -p $TMP $PKG/usr
68
69cd $TMP
70rm -rf aspell-$VERSION
71tar xvf $CWD/aspell-$VERSION.tar.?z || exit 1
72cd aspell-$VERSION
73chown -R root:root .
74find . \
75  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
76  -exec chmod 755 {} \+ -o \
77  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
78  -exec chmod 644 {} \+
79
80CFLAGS="$SLKCFLAGS" \
81CXXFLAGS="$SLKCFLAGS -fpermissive" \
82./configure \
83  --prefix=/usr \
84  --libdir=/usr/lib${LIBDIRSUFFIX} \
85  --mandir=/usr/man \
86  --infodir=/usr/info \
87  --enable-pkgdatadir=/usr/lib${LIBDIRSUFFIX}/aspell \
88  --enable-data-dir=/usr/lib${LIBDIRSUFFIX}/aspell \
89  --enable-pkglibdir=/usr/lib${LIBDIRSUFFIX}/aspell \
90  --enable-dict-dir=/usr/lib${LIBDIRSUFFIX}/aspell \
91  --build=$ARCH-slackware-linux || exit 1
92
93make $NUMJOBS || make || exit 1
94make install DESTDIR=$PKG || exit 1
95
96# Don't ship .la files:
97rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
98
99( cd $PKG
100  find . | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded
101)
102
103## This looks like crap clutter to me
104## ... turns out to be required.  How ugly...
105#rm -f $PKG/usr/bin/pre*
106
107rm -f $PKG/usr/info/dir
108gzip -9 $PKG/usr/info/*
109gzip -9 $PKG/usr/man/man?/*.?
110mkdir -p $PKG/usr/doc/aspell-$VERSION
111cp -a \
112  COPYING* README* TODO \
113  $PKG/usr/doc/aspell-$VERSION
114#mv $PKG/usr/share/doc/aspell/*html $PKG/usr/doc/aspell-$VERSION
115rm -rf $PKG/usr/share/doc
116mkdir -p $PKG/install
117cat $CWD/slack-desc > $PKG/install/slack-desc
118
119cd $PKG
120makepkg -l y -c n $TMP/aspell-$VERSION-$ARCH-$BUILD.txz
121
Note: See TracBrowser for help on using the repository browser.