~zethra/stargazer

ref: fbbf828c33087d1601d81db7c99c41d71fcb930f stargazer/scripts/install -rwxr-xr-x 1.6 KiB
fbbf828c — Ben Aaron Goldberg config: add bad config for testing 4 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
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
#!/bin/sh

CGOUT=${CGOUT:-'./target/release/stargazer'}

for arg
do
	case "$arg" in
		--bindir=*)
			BINDIR=${arg#*=}
			;;
		--libdir=*)
			LIBDIR=${arg#*=}
			;;
		--mandir=*)
			MANDIR=${arg#*=}
			;;
		--prefix=*)
			PREFIX=${arg#*=}
			if [ "$PREFIX" = "/usr" ]
			then
				SYSCONFDIR=/etc
			fi
			;;
		--sharedir=*)
			SHAREDIR=${arg#*=}
			;;
		--sysconfdir=*)
			SYSCONFDIR=${arg#*=}
			;;
		--bashdir=*)
			BASHDIR=${arg#*=}
			;;
		--zshdir=*)
			ZSHDIR=${arg#*=}
			;;
		--fishdir=*)
			FISHDIR=${arg#*=}
			;;
	esac
done

PREFIX=${PREFIX:-/usr/local}
BINDIR=${BINDIR:-$PREFIX/bin}
SHAREDIR=${SHAREDIR:-$PREFIX/share}
SYSCONFDIR=${SYSCONFDIR:-$PREFIX/etc}
MANDIR=${MANDIR:-$PREFIX/share/man}
BASHDIR=${BASHDIR:-/usr/share/bash-completion/completions}
ZSHDIR=${ZSHDIR:-/usr/share/zsh/site-functions}
FISHDIR=${FISHDIR:-/usr/share/fish/vendor_completions.d}

# Install files
mkdir -p \
	"${DESTDIR}${BINDIR}" \
	"${DESTDIR}${SHAREDIR}/stargazer" \
	"${DESTDIR}${MANDIR}/man5" \
	"${DESTDIR}${MANDIR}/man1" \
	"${BASHDIR}"\
	"${ZSHDIR}" \
	"${FISHDIR}"
install -Dm755 "$CGOUT" "${DESTDIR}${BINDIR}/stargazer"
install -Dm644 ./config.ini "${DESTDIR}${SHAREDIR}/stargazer/config.ini"
install -Dm644 ./stargazer.1 "${DESTDIR}${MANDIR}/man1/stargazer.1"
install -Dm644 ./stargazer.ini.5 "${DESTDIR}${MANDIR}/man5/stargazer.ini.5"

install -D -m644 "./target/release/completions/stargazer.bash" \
				 "${BASHDIR}/stargazer"
install -D -m644 "./target/release/completions/_stargazer" \
				 "${ZSHDIR}/_stargazer"
install -D -m644 "./target/release/completions/stargazer.fish" \
				 "${FISHDIR}/stargazer.fish"