-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
67 lines (55 loc) · 1.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
PACKAGE=eve4pve-barc
VERSION=$(shell ./${PACKAGE} version)
DATE=$(shell LANG=en_us_8859_1; date '+%b %d, %Y')
DESTDIR=
PREFIX=/usr
SBINDIR=${PREFIX}/sbin
MANDIR=${PREFIX}/share/man
DOCDIR=${PREFIX}/share/doc/${PACKAGE}
MAN8DIR=${MANDIR}/man8
EXAMPLE=${DOCDIR}/examples
DEB=${PACKAGE}_${VERSION}_all.deb
all: ${DEB}
.PHONY: dinstall
dinstall: deb
dpkg -i ${DEB}
.PHONY: install
install:
install -d ${DESTDIR}${SBINDIR}
install -m 0755 ${PACKAGE} ${DESTDIR}${SBINDIR}
install -d ${DESTDIR}${MAN8DIR}
install -m 0644 ${PACKAGE}.8 ${DESTDIR}${MAN8DIR}
gzip -n -9 ${DESTDIR}${MAN8DIR}/${PACKAGE}.8
install -d ${DESTDIR}${EXAMPLE}
install -m 0755 script-hook.sh ${DESTDIR}${EXAMPLE}
.PHONY: deb ${DEB}
deb ${DEB}:
rm -rf debian
mkdir debian
$(shell ./${PACKAGE} help --no-logo > help.tmp)
sed '/@@COPYRIGHT@@/r copyright' ${PACKAGE}.8.template | \
sed "/@@COPYRIGHT@@/d" | \
sed '/@@SYNOPSIS@@/r help.tmp' | \
sed /@@SYNOPSIS@@/d | \
sed s/@@PACKAGE@@/${PACKAGE}/ | \
sed s/@@PACKAGE@@/${PACKAGE}/ | \
sed "s/@@DATE@@/${DATE}/" \
> ${PACKAGE}.8
make DESTDIR=${CURDIR}/debian install
install -d -m 0755 debian/DEBIAN
sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PACKAGE@@/${PACKAGE}/ <control.in >debian/DEBIAN/control
install -D -m 0644 copyright debian/${DOCDIR}/copyright
install -m 0644 changelog debian/${DOCDIR}/
gzip -n -9 debian/${DOCDIR}/changelog
dpkg-deb --build debian
mv debian.deb ${DEB}
rm -rf debian
rm ${PACKAGE}.8
rm help.tmp
#lintian ${DEB}
.PHONY: clean
clean:
rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.8.man *.8.gz *.tmp
find . -name '*~' -exec rm {} ';'
.PHONY: distclean
distclean: clean