summaryrefslogtreecommitdiffstats
path: root/system/capstone/capstone.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/capstone/capstone.SlackBuild')
-rw-r--r--system/capstone/capstone.SlackBuild50
1 files changed, 30 insertions, 20 deletions
diff --git a/system/capstone/capstone.SlackBuild b/system/capstone/capstone.SlackBuild
index 27aeb32b93..523dba767d 100644
--- a/system/capstone/capstone.SlackBuild
+++ b/system/capstone/capstone.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for capstone
@@ -22,10 +22,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220301 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - fix 32-bit build (libraries in /usr/lib, not /usr/lib64).
+# - do not install compile instructions or empty files in doc dir.
+# - don't install a pkgconfig .pc file to /usr/share.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=capstone
-VERSION=${VERSION:-4.0.1}
+VERSION=${VERSION:-5.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +43,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -65,9 +77,9 @@ 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 \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
mkdir -p build
cd build
@@ -76,7 +88,7 @@ cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX="$LIBDIRSUFFIX" \
+ -DINSTALL_LIB_DIR=/usr/lib$LIBDIRSUFFIX \
-DCAPSTONE_ARM_SUPPORT=1 \
-DCAPSTONE_ARM64_SUPPORT=1 \
-DCAPSTONE_M68K_SUPPORT=1 \
@@ -91,28 +103,26 @@ cmake \
-DCAPSTONE_BUILD_STATIC=0 \
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
- make install DESTDIR=$PKG
+ make install/strip DESTDIR=$PKG
cd ..
-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
+# 20220317 bkw: .pc file gets install to wrong place on 64-bit...
+rm -rf $PKG/usr/lib/pkgconfig
-# pkg-config (PKG_CONFIG_PATH environment variable)
-# to generate .pc file do: $ python setup.py build
-# inside bindings/python
-mkdir -p $PKG/usr/share/pkgconfig
-sed -e "s|@CMAKE_INSTALL_PREFIX@|/usr|" \
- -e "s|@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@|$VERSION|" \
- -e "s|@LIBSUFFIX@|$LIBDIRSUFFIX|" \
- < capstone.pc.in \
- > $PKG/usr/share/pkgconfig/capstone.pc
+# 20220317 bkw: updated the .pc.in file.
+mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig
+sed "s,@LIBDIRSUFFIX@,$LIBDIRSUFFIX,g" \
+ < $CWD/$PRGNAM.pc.in \
+ > $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/$PRGNAM.pc
+# 20220317 bkw: RELEASE_NOTES is a 0-byte placeholder.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COMPILE* CREDITS.TXT ChangeLog HACK.TXT LICENSE* README.md RELEASE_NOTES SPONSORS.TXT TODO $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CREDITS.TXT ChangeLog HACK.TXT LICENSE* README.md SPONSORS.TXT \
+ $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}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE