summaryrefslogtreecommitdiffstats
path: root/libraries/libctl/libctl.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/libctl/libctl.SlackBuild')
-rw-r--r--libraries/libctl/libctl.SlackBuild47
1 files changed, 32 insertions, 15 deletions
diff --git a/libraries/libctl/libctl.SlackBuild b/libraries/libctl/libctl.SlackBuild
index 80dec43ea4..6043ec01b7 100644
--- a/libraries/libctl/libctl.SlackBuild
+++ b/libraries/libctl/libctl.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for libctl
@@ -22,10 +22,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=libctl
-VERSION=${VERSION:-4.3.0}
+VERSION=${VERSION:-4.5.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +38,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -54,13 +64,13 @@ else
LIBDIRSUFFIX=""
fi
+set -e
+
# change annoying underscores into hyphens
SVERSION=$(echo $VERSION | tr '_' '-')
# make a custom list of doc files in advance
DOCFILES="AUTHORS COPYING COPYRIGHT NEWS.md README.md doc/docs/*.md "
-set -e
-
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -74,12 +84,17 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# if there is no configure script, try to build one!
-if [ ! -f ./configure ] ; then
- ./autogen.sh
-fi
LOCALCONFIGS="--enable-shared"
+XDBFILE=/etc/sbo_pkg_options.conf
+if [ -f ${XDBFILE} ] ; then
+ LOCALCONFIGS=${LOCALCONFIGS}" "$(grep "^${PRGNAM}:" ${XDBFILE} | grep -v '^#' | awk -F: '{print$2}')
+ echo Build options selected by file: LOCALCONFIGS=${LOCALCONFIGS}
+fi
+if [ -n "${SBOPTIONS_LIBCTL}" ] ; then
+ LOCALCONFIGS=${LOCALCONFIGS}" "${SBOPTIONS_LIBCTL}
+ echo Build options selected by environment: LOCALCONFIGS=${LOCALCONFIGS}
+fi
CFLAGS="$SLKCFLAGS" \
CPPFLAGS="$SLKCFLAGS" \
@@ -89,25 +104,27 @@ CPPFLAGS="$SLKCFLAGS" \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux \
- --enable-static=no \
- --enable-shared=yes \
+ --disable-static \
$LOCALCONFIGS
make
make install DESTDIR=$PKG
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+install -m 0644 $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
find $PKG -print0 | xargs -0 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
-install -m 0644 $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -f $PKG/usr/lib*/*.la
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}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE