Version bump for release.
[irker.git] / Makefile
1 # Makefile for the irker relaying daemon
2
3 VERS := $(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd)
4 SYSTEMDSYSTEMUNITDIR := $(shell pkg-config --variable=systemdsystemunitdir systemd)
5
6 # `prefix`, `mandir` & `DESTDIR` can and should be set on the command
7 # line to control installation locations
8 prefix ?= /usr
9 mandir ?= /share/man
10 target = $(DESTDIR)$(prefix)
11
12 docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1 irk.html irk.1
13
14 irkerd.8: irkerd.xml
15         xmlto man irkerd.xml
16 irkerd.html: irkerd.xml
17         xmlto html-nochunks irkerd.xml
18
19 irkerhook.1: irkerhook.xml
20         xmlto man irkerhook.xml
21 irkerhook.html: irkerhook.xml
22         xmlto html-nochunks irkerhook.xml
23
24 irk.1: irk.xml
25         xmlto man irk.xml
26 irk.html: irk.xml
27         xmlto html-nochunks irkerhook.xml
28
29 install.html: install.txt
30         asciidoc -o install.html install.txt
31 security.html: security.txt
32         asciidoc -o security.html security.txt
33 hacking.html: hacking.txt
34         asciidoc -o hacking.html hacking.txt
35
36 install: irk.1 irkerd.8 irkerhook.1 uninstall
37         install -m 755 -o 0 -g 0 -d "$(target)/bin"
38         install -m 755 -o 0 -g 0 irkerd "$(target)/bin/irkerd"
39 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
40         install -m 755 -o 0 -g 0 -d "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
41         install -m 644 -o 0 -g 0 irkerd.service "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
42 endif
43         install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man8"
44         install -m 755 -o 0 -g 0 irkerd.8 "$(target)$(mandir)/man8/irkerd.8"
45         install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man1"
46         install -m 755 -o 0 -g 0 irkerhook.1 "$(target)$(mandir)/man1/irkerhook.1"
47         install -m 755 -o 0 -g 0 irk.1 "$(target)$(mandir)/man1/irk.1"
48
49 uninstall:
50         rm -f "$(target)/bin/irkerd"
51 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
52         rm -f "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service"
53 endif
54         rm -f "$(target)$(mandir)/man8/irkerd.8"
55         rm -f "$(target)$(mandir)/man1/irkerhook.1"
56         rm -f "$(target)$(mandir)/man1/irk.1"
57
58 clean:
59         rm -f irkerd.8 irkerhook.1 irk.1 irker-*.tar.gz *~ *.html
60
61 PYLINTOPTS = --rcfile=/dev/null --reports=n --dummy-variables-rgx='^_' --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --disable="C0103,C0111,C0301,C0302,C1001,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0142,W0201,W0212,W0621,W0702,W0703,W1201,F0401,E0611"
62 pylint:
63         @pylint $(PYLINTOPTS) irkerd
64         @pylint $(PYLINTOPTS) irkerhook.py
65
66 loc:
67         @echo "LOC:"; wc -l irkerd irkerhook.py
68         @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l
69
70 DOCS = \
71         README \
72         COPYING \
73         NEWS \
74         install.txt \
75         security.txt \
76         hacking.txt \
77         irkerhook.xml \
78         irkerd.xml \
79         irk.xml \
80
81 SOURCES = \
82         $(DOCS) \
83         irkerd \
84         irkerhook.py \
85         filter-example.py \
86         filter-test.py \
87         irk \
88         Makefile
89
90 EXTRA_DIST = \
91         org.catb.irkerd.plist \
92         irkerd.service \
93         irker-logo.png
94
95 version:
96         @echo $(VERS)
97
98 irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1 irk.1
99         mkdir irker-$(VERS)
100         cp -pR $(SOURCES) $(EXTRA_DIST) irker-$(VERS)/
101         @COPYFILE_DISABLE=1 tar -cvzf irker-$(VERS).tar.gz irker-$(VERS)
102         rm -fr irker-$(VERS)
103
104 dist: irker-$(VERS).tar.gz
105
106 release: irker-$(VERS).tar.gz irkerd.html irk.html irkerhook.html install.html security.html hacking.html
107         shipper version=$(VERS) | sh -e -x