2014-02-13 12:31:19 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for ded
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
|
|
|
# At one time, there was a ded package on slackbuilds.org, for Slack 12.2.
|
|
|
|
# This build script was written from scratch for 14.1, without referring
|
|
|
|
# to the old script.
|
|
|
|
|
2020-10-25 06:14:27 +08:00
|
|
|
# 20200111 bkw: updated for 20200428 release
|
2020-01-11 23:43:07 +08:00
|
|
|
# 20200111 bkw: updated for 20191226 release
|
|
|
|
# 20180915 bkw: updated for 20180324 release
|
2018-09-16 11:32:01 +08:00
|
|
|
|
2017-08-20 02:02:00 +08:00
|
|
|
# 20170819 bkw:
|
|
|
|
# - ftp server's been down >1 week, use http archives for DOWNLOAD
|
|
|
|
|
2017-03-06 00:40:30 +08:00
|
|
|
# 20170305 bkw:
|
|
|
|
# - stop gnulib's long filename test from writing to /usr/lib and /var/lib
|
|
|
|
|
2020-01-11 23:43:07 +08:00
|
|
|
# 20150909 bkw: updated for 20150704 release
|
2014-08-27 06:02:21 +08:00
|
|
|
# 20140826 bkw:
|
|
|
|
# - updated for 20140722 release
|
|
|
|
# - added td_lib docs in /usr/doc
|
|
|
|
|
2014-02-13 12:31:19 +08:00
|
|
|
PRGNAM=ded
|
2020-10-25 06:14:27 +08:00
|
|
|
VERSION=${VERSION:-20200428}
|
2014-02-13 12:31:19 +08:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 17:00:26 +08:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-02-13 12:31:19 +08:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-19 17:00:26 +08:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2014-02-13 12:31:19 +08:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# not going to make td_lib a separate package. If anyone's packaging up any
|
|
|
|
# of the (very few) apps that use td_lib, let them list ded as a dependency.
|
|
|
|
LIBNAM=td_lib
|
|
|
|
LIBVER=${LIBVER:-$VERSION}
|
|
|
|
|
|
|
|
# build everything here so it's easy to clean up after
|
|
|
|
BUILDDIR=$TMP/$PRGNAM-build
|
|
|
|
|
|
|
|
rm -rf $PKG $BUILDDIR
|
|
|
|
mkdir -p $BUILDDIR $PKG $OUTPUT
|
|
|
|
|
|
|
|
cd $BUILDDIR
|
|
|
|
rm -rf $LIBNAM-$LIBVER
|
|
|
|
tar xvf $CWD/$LIBNAM-$LIBVER.tgz
|
|
|
|
cd $LIBNAM-$LIBVER
|
|
|
|
chown -R root:root .
|
2018-09-16 11:32:01 +08:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2014-02-13 12:31:19 +08:00
|
|
|
|
2017-03-06 00:40:30 +08:00
|
|
|
# "checking for long filenames" wants to create files in /usr/lib and
|
|
|
|
# /var/lib. Violates the principle of least surprise: users don't expect
|
|
|
|
# configure scripts (or SlackBuilds) to touch their system directories.
|
|
|
|
patch -p1 < $CWD/td_lib_no_write_usr.diff
|
|
|
|
|
2014-02-13 12:31:19 +08:00
|
|
|
# NB: the -j1's are necessary, even on 'make install'.
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make -j1
|
|
|
|
|
|
|
|
# actually, don't really need to make install, ded's configure will find
|
|
|
|
# the static lib just fine, but there do exist other apps that use td_lib
|
|
|
|
# so we'll include it in the package too. Upstream doesn't let us build
|
|
|
|
# it as a shared lib.
|
|
|
|
make -j1 install DESTDIR=$PKG
|
|
|
|
|
2014-08-27 06:02:21 +08:00
|
|
|
# let's include the td_lib docs
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/$LIBNAM-$LIBVER
|
|
|
|
cp -a CHANGES COPYING README $PKG/usr/doc/$PRGNAM-$VERSION/$LIBNAM-$LIBVER
|
|
|
|
|
2014-02-13 12:31:19 +08:00
|
|
|
cd $BUILDDIR
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tgz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2018-09-16 11:32:01 +08:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2014-02-13 12:31:19 +08:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make -j1
|
|
|
|
make -j1 install DESTDIR=$PKG
|
|
|
|
|
|
|
|
strip $PKG/usr/bin/$PRGNAM
|
|
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a CHANGES COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|