X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=Makefile;h=10ce0e7681bda6a6164431e6571f1413264bd598;hb=c9f6f03abd219db14cf619200a4ca5ba963efc0e;hp=021b34570512772a36b4bdbf31d2490803476bf4;hpb=51133dcd46fe1258aaacb478603a2ca108e76d37;p=irker.git diff --git a/Makefile b/Makefile index 021b345..10ce0e7 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ # Makefile for the irker relaying daemon -VERS=$(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd) -SYSTEMDSYSTEMUNITDIR:=$(shell pkg-config --variable=systemdsystemunitdir systemd) +VERS := $(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd) +SYSTEMDSYSTEMUNITDIR := $(shell pkg-config --variable=systemdsystemunitdir systemd) -docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1 +# `prefix`, `mandir` & `DESTDIR` can and should be set on the command +# line to control installation locations +prefix ?= /usr +mandir ?= /share/man +target = $(DESTDIR)$(prefix) + +docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1 irk.html irk.1 irkerd.8: irkerd.xml xmlto man irkerd.xml @@ -15,6 +21,11 @@ irkerhook.1: irkerhook.xml irkerhook.html: irkerhook.xml xmlto html-nochunks irkerhook.xml +irk.1: irk.xml + xmlto man irk.xml +irk.html: irk.xml + xmlto html-nochunks irkerhook.xml + install.html: install.txt asciidoc -o install.html install.txt security.html: security.txt @@ -22,31 +33,32 @@ security.html: security.txt hacking.html: hacking.txt asciidoc -o hacking.html hacking.txt -install: irkerd.8 irkerhook.1 uninstall - install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/bin/ - install -m 755 -o 0 -g 0 irkerd $(DESTDIR)/usr/bin/irkerd +install: irk.1 irkerd.8 irkerhook.1 uninstall + install -m 755 -o 0 -g 0 -d "$(target)/bin" + install -m 755 -o 0 -g 0 irkerd "$(target)/bin/irkerd" ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),) - install -m 755 -o 0 -g 0 -d $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) - install -m 644 -o 0 -g 0 irkerd.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) + install -m 755 -o 0 -g 0 -d "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)" + install -m 644 -o 0 -g 0 irkerd.service "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)" endif - install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man8/ - install -m 755 -o 0 -g 0 irkerd.8 $(DESTDIR)/usr/share/man/man8/irkerd.8 - install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man1/ - install -m 755 -o 0 -g 0 irkerhook.1 $(DESTDIR)/usr/share/man/man1/irkerhook.1 + install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man8" + install -m 755 -o 0 -g 0 irkerd.8 "$(target)$(mandir)/man8/irkerd.8" + install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man1" + install -m 755 -o 0 -g 0 irkerhook.1 "$(target)$(mandir)/man1/irkerhook.1" + install -m 755 -o 0 -g 0 irk.1 "$(target)$(mandir)/man1/irk.1" uninstall: - rm -f $(DESTDIR)/usr/bin/irkerd + rm -f "$(target)/bin/irkerd" ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),) - rm -f $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service + rm -f "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service" endif - rm -f $(DESTDIR)/usr/share/man/man8/irkerd.8 - rm -f $(DESTDIR)/usr/share/man/man1/irkerhook.1 + rm -f "$(target)$(mandir)/man8/irkerd.8" + rm -f "$(target)$(mandir)/man1/irkerhook.1" + rm -f "$(target)$(mandir)/man1/irk.1" clean: - rm -f irkerd.8 irkerhook.1 irker-*.tar.gz *~ - rm -f SHIPPER.* *.html + rm -f irkerd.8 irkerhook.1 irk.1 irker-*.tar.gz *~ *.html -PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,R0201,R0902,R0903,R0912,R0915,E1101,W0201,W0621,W0702,F0401" +PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,C0302,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0142,W0201,W0212,W0621,W0702,W0703,F0401,E0611" pylint: @pylint --output-format=parseable $(PYLINTOPTS) irkerd @pylint --output-format=parseable $(PYLINTOPTS) irkerhook.py @@ -55,18 +67,41 @@ loc: @echo "LOC:"; wc -l irkerd irkerhook.py @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l -SOURCES = README COPYING NEWS install.txt security.txt hacking.txt \ - irkerd irkerhook.py filter-example.py filter-test.py irk \ - Makefile irkerd.xml irkerhook.xml -EXTRA_DIST = irker-logo.png org.catb.irkerd.plist irkerd.service +DOCS = \ + README \ + COPYING \ + NEWS \ + install.txt \ + security.txt \ + hacking.txt \ + irkerhook.xml \ + irkerd.xml \ + irk.xml \ + +SOURCES = \ + $(DOCS) \ + irkerd \ + irkerhook.py \ + filter-example.py \ + filter-test.py \ + irk \ + Makefile + +EXTRA_DIST = \ + org.catb.irkerd.plist \ + irkerd.service \ + irker-logo.png version: @echo $(VERS) -irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1 - tar --transform='s:^:irker-$(VERS)/:' --show-transformed-names -cvzf irker-$(VERS).tar.gz $(SOURCES) $(EXTRA_DIST) +irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1 irk.1 + mkdir irker-$(VERS) + cp -pR $(SOURCES) $(EXTRA_DIST) irker-$(VERS)/ + @COPYFILE_DISABLE=1 tar -cvzf irker-$(VERS).tar.gz irker-$(VERS) + rm -fr irker-$(VERS) dist: irker-$(VERS).tar.gz -release: irker-$(VERS).tar.gz irkerd.html irkerhook.html install.html security.html hacking.html - shipper -u -m -t; make clean +release: irker-$(VERS).tar.gz irkerd.html irk.html irkerhook.html install.html security.html hacking.html + shipper version=$(VERS) | sh -e -x