diff options
Diffstat (limited to 'development/uncrustify/uncrustify.SlackBuild')
-rw-r--r-- | development/uncrustify/uncrustify.SlackBuild | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/development/uncrustify/uncrustify.SlackBuild b/development/uncrustify/uncrustify.SlackBuild index d15d4f03b3..6a8c45c795 100644 --- a/development/uncrustify/uncrustify.SlackBuild +++ b/development/uncrustify/uncrustify.SlackBuild @@ -1,13 +1,17 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for uncrustify - +# Copyright 2015-2023, Zhu Qun-Ying +# # Written by Aleksandar Samardzic <asamardzic@gmail.com> +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=uncrustify -VERSION=${VERSION:-0.69.0} +VERSION=${VERSION:-0.78.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -17,7 +21,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} @@ -46,32 +57,30 @@ find -L . \ -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 {} \; - mkdir -p build cd build - cmake \ + cmake -G Ninja \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release .. - make - make install DESTDIR=$PKG + DESTDIR=$PKG ninja install 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 mv $PKG/usr/share/man $PKG/usr -rmdir $PKG/usr/share gzip -9 $PKG/usr/man/man1/* mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog documentation \ - $PKG/usr/doc/$PRGNAM-$VERSION +cp -a documentation $PKG/usr/doc/$PRGNAM-$VERSION +mv $PKG/usr/share/doc/uncrustify/* $PKG/usr/doc/$PRGNAM-$VERSION +rm -rf $PKG/usr/share 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 |