contrib/libpaper/Pkgfile

71 lines
1.7 KiB
Plaintext

# Description: Library for handling paper characteristics
# URL: http://ftp.debian.org/debian/pool/main/libp/libpaper/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on:
name=libpaper
version=1.1.28
release=2
source=(http://ftp.debian.org/debian/pool/main/libp/libpaper/libpaper_1.1.28.tar.gz)
build() {
cd $name-$version
autoreconf -fi
./configure --prefix=/usr \
--sysconfdir=/etc \
--disable-static
make
make DESTDIR=$PKG install
mkdir -vp $PKG/etc/libpaper.d
cat > $PKG/usr/bin/run-parts << "EOF"
#!/bin/sh
# run-parts: Runs all the scripts found in a directory.
# from Slackware, by Patrick J. Volkerding with ideas borrowed
# from the Red Hat and Debian versions of this utility.
# keep going when something fails
set +e
if [ $# -lt 1 ]; then
echo "Usage: run-parts <directory>"
exit 1
fi
if [ ! -d $1 ]; then
echo "Not a directory: $1"
echo "Usage: run-parts <directory>"
exit 1
fi
# There are several types of files that we would like to
# ignore automatically, as they are likely to be backups
# of other scripts:
IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"
# Main loop:
for SCRIPT in $1/* ; do
# If this is not a regular file, skip it:
if [ ! -f $SCRIPT ]; then
continue
fi
# Determine if this file should be skipped by suffix:
SKIP=false
for SUFFIX in $IGNORE_SUFFIXES ; do
if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
SKIP=true
break
fi
done
if [ "$SKIP" = "true" ]; then
continue
fi
# If we've made it this far, then run the script if it's executable:
if [ -x $SCRIPT ]; then
$SCRIPT || echo "$SCRIPT failed."
fi
done
exit 0
EOF
}