mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-13 21:56:09 +01:00
783ba9e72b
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
105 lines
2.8 KiB
Bash
105 lines
2.8 KiB
Bash
#!/bin/sh
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
# Slackware build script for coq
|
|
|
|
# Written by William Bowman (wilbowma@indiana.edu)
|
|
|
|
PRGNAM=coq
|
|
VERSION=${VERSION:-8.5pl1}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-_SBo}
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i486 ;;
|
|
arm*) ARCH=arm ;;
|
|
*) ARCH=$( uname -m ) ;;
|
|
esac
|
|
fi
|
|
|
|
CWD=$(pwd)
|
|
TMP=${TMP:-/tmp/SBo}
|
|
PKG=$TMP/package-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
# This is built using the ocaml compiler, not GCC, so SLKCFLAGS are
|
|
# not used.
|
|
if [ "$ARCH" = "i486" ]; then
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
LIBDIRSUFFIX="64"
|
|
else
|
|
LIBDIRSUFFIX=""
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
cd $PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find -L . \
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
|
|
|
|
if hash ocamlopt || hash ocamlopt.opt ; then
|
|
OPT="-opt"
|
|
else
|
|
OPT=""
|
|
fi
|
|
|
|
./configure \
|
|
-prefix /usr \
|
|
-libdir /usr/lib${LIBDIRSUFFIX}/coq \
|
|
-mandir /usr/man \
|
|
-arch $ARCH \
|
|
$OPT
|
|
|
|
make world
|
|
umask 022
|
|
COQINSTALLPREFIX=$PKG make install
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
cp -a \
|
|
CHANGES COMPATIBILITY COPYRIGHT CREDITS INSTALL* LICENSE README* \
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
zcat $CWD/gpl.txt.gz > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM-SlackBuild-license
|
|
|
|
mkdir -p $PKG/install
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
# Delete this if they don't have emacs. I don't like needless things
|
|
if [ `which emacs | grep "no emacs"` ]; then
|
|
rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/emacs
|
|
fi
|
|
|
|
cd $PKG
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|