irkerd: Store less state in IRCServerConnection.connect()
[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
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 install.html: install.txt
25         asciidoc -o install.html install.txt
26 security.html: security.txt
27         asciidoc -o security.html security.txt
28 hacking.html: hacking.txt
29         asciidoc -o hacking.html hacking.txt
30
31 install: irkerd.8 irkerhook.1 uninstall
32         install -m 755 -o 0 -g 0 -d "$(target)/bin"
33         install -m 755 -o 0 -g 0 irkerd "$(target)/bin/irkerd"
34 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
35         install -m 755 -o 0 -g 0 -d "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
36         install -m 644 -o 0 -g 0 irkerd.service "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
37 endif
38         install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man8"
39         install -m 755 -o 0 -g 0 irkerd.8 "$(target)$(mandir)/man8/irkerd.8"
40         install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man1"
41         install -m 755 -o 0 -g 0 irkerhook.1 "$(target)$(mandir)/man1/irkerhook.1"
42
43 uninstall:
44         rm -f "$(target)/bin/irkerd"
45 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
46         rm -f "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service"
47 endif
48         rm -f "$(target)$(mandir)/man8/irkerd.8"
49         rm -f "$(target)$(mandir)/man1/irkerhook.1"
50
51 clean:
52         rm -f irkerd.8 irkerhook.1 irker-*.tar.gz *~ *.html
53
54 PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0201,W0212,W0621,W0702,F0401"
55 pylint:
56         @pylint --output-format=parseable $(PYLINTOPTS) irkerd
57         @pylint --output-format=parseable $(PYLINTOPTS) irkerhook.py
58
59 loc:
60         @echo "LOC:"; wc -l irkerd irkerhook.py
61         @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l
62
63 DOCS = \
64         README \
65         COPYING \
66         NEWS \
67         install.txt \
68         security.txt \
69         hacking.txt \
70         irkerhook.xml \
71         irkerd.xml \
72
73 SOURCES = \
74         $(DOCS) \
75         irkerd \
76         irkerhook.py \
77         filter-example.py \
78         filter-test.py \
79         irk \
80         Makefile
81
82 EXTRA_DIST = \
83         org.catb.irkerd.plist \
84         irkerd.service \
85         irker-logo.png
86
87 version:
88         @echo $(VERS)
89
90 irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1
91         mkdir irker-$(VERS)
92         cp -pR $(SOURCES) $(EXTRA_DIST) irker-$(VERS)/
93         @COPYFILE_DISABLE=1 tar -cvzf irker-$(VERS).tar.gz irker-$(VERS)
94         rm -fr irker-$(VERS)
95
96 dist: irker-$(VERS).tar.gz
97
98 release: irker-$(VERS).tar.gz irkerd.html irkerhook.html install.html security.html hacking.html
99         shipper version=$(VERS) | sh -e -x