aboutsummaryrefslogtreecommitdiff
path: root/core/mandoc/build
blob: 324e41386121a1b3831485a8003cf7b60d09514a (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
#!/bin/sh -e

sed_i() {
    for file; do :; done
    sed "$@" > _
    cat _ > "$file"; rm -f _
}

sed_i '/int dummy/d'         compat_err.c
sed_i 's,"more -s","less",g' main.c
sed_i "s/CC=.*/CC='$CC'/"    configure

cat > configure.local <<EOF
PREFIX=/usr
MANDIR=/usr/share/man
LIBDIR=/usr/lib
SBINDIR=/usr/bin
CC="${CC:-gcc}"
CFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS -static"
MANPATH_DEFAULT=/usr/share/man
LN="ln -sf"
EOF

MANPATH_BASE=/usr/share/man ./configure
make
make -j1 DESTDIR="$1" base-install lib-install

# Make binaries writable.
chmod u+w "$1/usr/bin/"*

# Remove all development files.
rm -rf "$1/usr/include" \
       "$1/usr/lib" \
       "$1/usr/share/man/man3"