summaryrefslogtreecommitdiffstats
path: root/development/astyle/astyle.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/astyle/astyle.SlackBuild')
-rw-r--r--development/astyle/astyle.SlackBuild135
1 files changed, 86 insertions, 49 deletions
diff --git a/development/astyle/astyle.SlackBuild b/development/astyle/astyle.SlackBuild
index a864c0005f..b903f559e0 100644
--- a/development/astyle/astyle.SlackBuild
+++ b/development/astyle/astyle.SlackBuild
@@ -1,18 +1,20 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for Artistic Style
-# Copyright 2017,2018 Nate Bargmann <n0nb@arrl.net>
+# Copyright 2020-2023 B. Watson <urchlay@slackware.uk>
-# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
+# Copyright 2017,2018 Nate Bargmann <email removed>
-# Maintained by Daniel Jordan, daniel.budd.j@gmail.com
+# Ryan P.C. McQuen | Everett, WA | <email removed>
+
+# Formerly maintained by Daniel Jordan <email removed>
# - updated version number
# - added default variable options
# - auto detect ARCH
-# - build and install shared libraries
+# - build and install shared libraries [bkw: say what?]
#
-# Originally by Dugan Chen (dugan_c@fastmail.fm)
+# Originally by Dugan Chen <email removed>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,12 +34,36 @@
# along with this program (most likely, a file named COPYING). If
# not, see <http://www.gnu.org/licenses/>.
+# 20240313 bkw: update for v3.4.13.
+# 20231101 bkw: update for v3.4.10.
+# 20230918 bkw: update for v3.4.6, fix zsh completion.
+
+# 20230818 bkw:
+# - Update for v3.4.
+# - Upstream includes a man page now, use it instead of Debian's.
+# - Use sed instead of a patch, for privacy in the HTML files.
+# - Move the .ini files to /usr/share/astyle.
+# - Install the shell completions (new in 3.4).
+
+# 20200113 bkw:
+# - Take over maintenance.
+# - Add man page and privacy patch, BUILD=2.
+# - Get rid of "shared" from make command. We weren't installing the
+# shared library anyway, despite the comment above from Daniel
+# Jordan. The only thing that lists astyle as a dependency is ebe,
+# and that's a runtime dep (it executes the astyle command, doesn't
+# link the shared lib). If someone needs the shared lib, I can add
+# it to the build, but for now I'm leaving it alone because the
+# .so isn't versioned (upgrades may cause breakage).
+# - Simplify and tweak the script.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=astyle
-VERSION=${VERSION:-3.1}
+VERSION=${VERSION:-3.4.13}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-
-SRCPK=astyle_$VERSION\_linux.tar.gz
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -47,23 +73,23 @@ 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}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- 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
@@ -71,44 +97,55 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM
-tar -xzvf $CWD/$SRCPK
-cd $PRGNAM
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+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 \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-cd build/gcc
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-make release shared
-
-inst_pfx=$PKG/usr
-make install prefix=$inst_pfx SYSCONF_PATH=$inst_pfx/doc/$PRGNAM-$VERSION
-
-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
-
-cd $TMP/$PRGNAM
-for file in *.md
-do
- cat $file > $PKG/usr/doc/$PRGNAM-$VERSION/$file
-done
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/file
-cd $TMP/$PRGNAM/file
-for file in *.ini
-do
- fromdos < $file > $PKG/usr/doc/$PRGNAM-$VERSION/file/$file
-done
-
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Don't change this back to template please. Every file in the tarball
+# is +x, and *none* of them need to be.
+find -L . -type d -a -exec chmod 755 {} + -o \
+ -type f -a -exec chmod 644 {} +
+
+DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
+
+# This prevents the user's browser from trying to load images from
+# sourceforge, when viewing the *local* HTML docs in a browser. It's
+# based on a patch from Debian.
+sed -i 's,<img[^>]*sflogo\.[^>]*>,Artistic Style on SourceForge.net,' doc/*.html
+
+CFLAGS="$SLKCFLAGS -Wl,-s" \
+CXXFLAGS="$SLKCFLAGS -Wl,-s" \
+ make -C build/gcc release
+ make -C build/gcc install prefix=$PKG/usr SYSCONF_PATH=$DOCDIR
+
+mkdir -p $PKG/usr/man/man1
+gzip -9c < man/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+# 20230818 bkw: this stuff used to be in the doc dir. Makes more sense
+# to keep it in /usr/share... though I'll keep a symlink in the doc dir
+# for users of the old package.
+mkdir -p $PKG/usr/share/$PRGNAM
+cp -a file/* $PKG/usr/share/$PRGNAM
+ln -s ../../share/$PRGNAM $DOCDIR/file
+
+# 20230820 bkw: upstream added shell completion support.
+# 20230918 bkw: the zsh completion is broken, fix it.
+sed -i 's,"\(mode\[\),"--\1,' sh-completion/astyle.zsh
+mkdir -p $PKG/usr/share/bash-completion/completions \
+ $PKG/usr/share/zsh/site-functions \
+ $PKG/etc/fish/completions
+install -m0644 sh-completion/astyle.bash $PKG/usr/share/bash-completion/completions/astyle
+install -m0644 sh-completion/astyle.zsh $PKG/usr/share/zsh/site-functions/_astyle
+install -m0644 sh-completion/astyle.fish $PKG/etc/fish/completions
+
+cp -a *.md $DOCDIR
+sed -i 's,\r,,' $DOCDIR/file/*
+
+cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$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