-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
53 lines (42 loc) · 1.21 KB
/
Makefile
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
# This file is part of captal.
# See LICENSE file for copyright and license details.
# captal version
VERSION = 0.1
# paths
PREFIX = /usr/local
BINDIR = ${PREFIX}/bin
ETCDIR = /etc
RCDIR = /etc/rc.d
WWWDIR = /var/www
######################################################################
HELPERS = $(subst .in,,$(wildcard helpers/*.in))
CONFIGS = $(subst .in,,$(wildcard configs/*.in))
RCS = $(subst .in,,$(wildcard rc/*.in))
all: ${HELPERS} ${CONFIGS} ${RCS}
%: %.in
sed -e "s|@BINDIR@|${BINDIR}|g" \
-e "s|@ETCDIR@|${ETCDIR}|g" \
-e "s|@RCDIR@|${RCDIR}|g" \
-e "s|@WWWDIR@|${WWWDIR}|g" \
$< > $@
install: all
install -m 0755 -Dt ${DESTDIR}${BINDIR}/ ${HELPERS}
install -m 0644 -Dt ${DESTDIR}${ETCDIR}/captal ${CONFIGS}
install -m 0755 -Dt ${DESTDIR}${RCDIR}/ ${RCS}
# sites
install -d ${DESTDIR}${WWWDIR}/captal/sites
cp -a sites/* ${DESTDIR}${WWWDIR}/captal/sites/
uninstall:
# helpers
rm -f ${DESTDIR}${BINDIR}/captal-*
# configs
rm -rf ${DESTDIR}${ETCDIR}/captal/
# rc
rm -f ${DESTDIR}${RCDIR}/captal*
# sites
rm -rf ${DESTDIR}${WWWDIR}/captal/
clean:
rm -f ${HELPERS} ${CONFIGS} ${RCS}
.PHONY: all install uninstall clean
# vim:cc=72:tw=70
# End of file.