blob: 2ce71e2e58fbd1edc6301d1d1f5981a089a998ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#!/bin/bash
# Slackware build script for po4a
# Originally written by Didier Spaier Paris, France
# Now maintained by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20230103 bkw: update for v0.69.
# 20220110 bkw:
# - new maintainer.
# - relicense as WTFPL with permission from Didier.
# - update for v0.65.
# - force a UTF-8 locale instead of making it a hoop for the user
# to notice and jump through.
# - move some of the details from README to a separate README_SBo.txt.
# - ARCH=noarch.
# - run the tests if TESTS=yes, as user nobody so they actually work.
cd $(dirname $0) ; CWD=$(pwd)
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
PRGNAM=po4a
VERSION=${VERSION:-0.69}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# There is no compiled code here.
ARCH=noarch
SRCNAM="$(printf $PRGNAM | cut -d- -f2-)"
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}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$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 {} \+
perl Build.PL \
prefix=/usr \
installdirs=vendor \
destdir=$PKG
./Build
# 20220110 bkw: Tests fail if run as root. Also they're time-consuming.
# Run them only if requested, and do it as "nobody".
if [ "${TESTS:-no}" = "yes" ]; then
chown -R nobody:nogroup t
su nobody -s /bin/sh -c "./Build test"
fi
./Build install \
--install_path bindoc=/usr/man/man1 \
--install_path libdoc=/usr/man/man3
find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | \
xargs rm -f || true
find $PKG -depth -type d -empty -delete || true
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a COPYING NEWS README* TODO changelog $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
|