~q3cpma/posix-build

ref: 37b4edf688c9a4e9702e3c9137feecc6d2c1b76e posix-build/build.sh -rwxr-xr-x 843 bytes
37b4edf6q3cpma Fix indentation 9 months ago
                                                                                
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
#!/bin/sh
set -eu
cd -P -- "$(dirname -- "$0")"
. ./build_util.sh

export PROJECT=example-project

PREFIX=$(preadlinkf "${DESTDIR+${DESTDIR%/}}${PREFIX:-/usr/local}")

if [ $# -eq 1 ]
then
	case "$(tolower "$1")" in
		install)
			set_rpaths bin="$PREFIX"/bin share="$PREFIX"/share/"$PROJECT"
			pb_install -m 755 -r "$PREFIX"/bin/ prog
			pb_install -m 644 "$PREFIX"/share/"$PROJECT"/ util.sh
			pb_install -m 644 "$PREFIX"/share/doc/"$PROJECT"/ README
			;;
		uninstall)
			uninstall \
				"$PREFIX"/bin/prog \
				"$PREFIX"/share/"$PROJECT"/util.sh \
				"$PREFIX"/share/doc/"$PROJECT"/README
			;;
		clean) # Just pass it to prog-c
			;;
		help)
			pb_usage 0
			;;
		*)
			die "$1: unknown action"
			;;
	esac
	prog-c/build.sh "$1"
	exit
elif [ $# -gt 1 ]
then
	pb_usage 1
fi

# Build stuff related to prog but not prog-c

prog-c/build.sh