|
root / base / tree / build.sh
build.sh Bash 30 lines 819 B
 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
#!/bin/bash
# Build script for tree
# Directory listing utility - no external dependencies

set -e

cd "$SRCDIR"

# illumos fix: rename 'struct comment' to avoid conflict with /usr/include/pwd.h
# which also defines struct comment
for f in *.h *.c; do
    sed -i 's/struct comment/struct tree_comment/g' "$f"
done

# tree uses a simple Makefile, needs some adjustments for illumos
# Override Linux-specific flags

gmake -j${JOBS:-1} \
    CC=gcc \
    CFLAGS="-O2 -Wall -fomit-frame-pointer -DSOLARIS" \
    LDFLAGS="" \
    prefix=$PREFIX \
    MANDIR=$PREFIX/share/man

# Manual install since Makefile doesn't properly support DESTDIR
mkdir -p "$PKGDIR$PREFIX/bin"
mkdir -p "$PKGDIR$PREFIX/share/man/man1"
install -m 755 tree "$PKGDIR$PREFIX/bin/tree"
install -m 644 doc/tree.1 "$PKGDIR$PREFIX/share/man/man1/tree.1"