development/bcpp: Added (indent C/C++ source).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-03-12 07:19:50 +07:00 committed by Willy Sudiarto Raharjo
parent b2cdbf956a
commit 7a804b8134
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 130 additions and 0 deletions

12
development/bcpp/README Normal file
View file

@ -0,0 +1,12 @@
bcpp (C/C++ source beautifier)
bcpp indents C/C++ source programs, replacing tabs with spaces or the
reverse. Unlike indent, it does (by design) not attempt to wrap long
statements. It supports quite a few options to control the output; see
the man page for details.
Note that bcpp looks in the current directory for bcpp.cfg, by default
(there is no system-wide config file in /etc). Two sample config files
are installed in the documentation directory. These can be used with
the -fnc option, and should be used as templates for creating your own
project-specific config files.

View file

@ -0,0 +1,89 @@
#!/bin/bash
# Slackware build script for bcpp
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=bcpp
VERSION=${VERSION:-20230130}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
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
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tgz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--disable-static \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
strip $PKG/usr/bin/$PRGNAM
gzip -9 $PKG/usr/man/*/*
# stuff in txtdocs/: hirachy.txt documents internals, for hacking
# bcpp's code (not needed in a SBo package), and manual.txt is just
# a preformatted copy of the man page. wpdocs/ are the same, in
# WordPerfect 5.1 format (do not package).
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a CHANGES COPYING README *.cfg $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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

View file

@ -0,0 +1,10 @@
PRGNAM="bcpp"
VERSION="20230130"
HOMEPAGE="https://invisible-island.net/bcpp/bcpp.html"
DOWNLOAD="https://invisible-island.net/archives/bcpp/bcpp-20230130.tgz"
MD5SUM="da9ba740760c3d15c54c8fb2e8d21a9e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
bcpp: bcpp (indent C/C++ source)
bcpp:
bcpp: bcpp indents C/C++ source programs, replacing tabs with spaces or the
bcpp: reverse. Unlike indent, it does (by design) not attempt to wrap long
bcpp: statements.
bcpp:
bcpp:
bcpp:
bcpp:
bcpp:
bcpp: