summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Andrew Clemons <andrew.clemons@gmail.com>2022-03-26 11:11:33 +1300
committer Andrew Clemons <andrew.clemons@gmail.com>2022-03-26 11:19:41 +1300
commitcc7abeadd64917c96012cf2d7c3f4aa0ada9e5bb (patch)
tree5ef9246bae2f385a0a4abd93152c7a6255ee2d96
parentd29324e8865e051680500db5f251c21ba25b7b92 (diff)
downloadslackbuilds-cc7abeadd64917c96012cf2d7c3f4aa0ada9e5bb.tar.gz
slackbuilds-cc7abeadd64917c96012cf2d7c3f4aa0ada9e5bb.tar.xz
system/libtrash: Align to template.
Put libs in correct dir, docs in correct dir, config for new files, don't package 0 byte AUTHORS or useless INSTALL, don't include .la files. Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
-rw-r--r--system/libtrash/doinst.sh11
-rw-r--r--system/libtrash/libtrash.SlackBuild51
2 files changed, 43 insertions, 19 deletions
diff --git a/system/libtrash/doinst.sh b/system/libtrash/doinst.sh
new file mode 100644
index 0000000000..7c7c3e502e
--- /dev/null
+++ b/system/libtrash/doinst.sh
@@ -0,0 +1,11 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/libtrash.conf.new
diff --git a/system/libtrash/libtrash.SlackBuild b/system/libtrash/libtrash.SlackBuild
index 0107030d69..d0c7a6e1a8 100644
--- a/system/libtrash/libtrash.SlackBuild
+++ b/system/libtrash/libtrash.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/bash
# Slackware build script for libtrash
-#
+
# Copyright 2020-2022 Isaac Yu <isaacyu1@isaacyu1.com>
# All rights reserved.
#
@@ -11,22 +11,22 @@
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# 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=libtrash
VERSION=${VERSION:-3.7}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -38,9 +38,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# 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
@@ -80,19 +77,35 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
./autogen.sh
-./configure --prefix=/usr --sysconfdir=/etc --disable-static --enable-shared
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --disable-static \
+ --build=$ARCH-slackware-linux \
+ --enable-shared
+
make
-make DESTDIR=$PKG install
+make install DESTDIR=$PKG
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+mv $PKG/etc/libtrash.conf $PKG/etc/libtrash.conf.new
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS BUILD ChangeLog config.txt COPYING INSTALL NEWS README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION
+rm -f $PKG/usr/doc/$PRGNAM-$VERSION/{AUTHORS,INSTALL}
+cp -a BUILD ChangeLog config.txt COPYING NEWS README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-mkdir -p $PKG/install
+mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE