Makefile 925 Bytes
Newer Older
1 2 3
DESTDIR = /
PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man
4
UNITDIR = /lib/systemd/system
5 6 7 8 9 10 11 12 13 14

MANPAGELIST := $(patsubst %,docs/%,re6st-conf.1 re6st-registry.1 re6stnet.8)

all: $(MANPAGELIST)

%.1 %.8: %.rst
	rst2man $< $@

install: install-noinit
	for x in daemon/*.service; \
15
	do install -Dpm 0644 $$x $(DESTDIR)$(UNITDIR)/$${x##*/}; \
16 17 18 19
	done

install-noinit: install-man
	set -e $(DESTDIR)$(PREFIX) /bin/re6stnet; [ -x $$1$$2 ] || \
20 21
	$(or $(PYTHON),python2) setup.py install \
		--prefix=$(PREFIX) --root=$(DESTDIR); \
22 23 24 25 26 27 28 29 30 31 32 33
	install -d $$1/sbin; mv $$1$$2 $$1/sbin
	install -Dpm 0644 daemon/README.conf $(DESTDIR)/etc/re6stnet/README
	install -Dpm 0644 daemon/logrotate.conf $(DESTDIR)/etc/logrotate.d/re6stnet

install-man: $(MANPAGELIST)
	set -e; for x in $^; \
	do install -Dpm 0644 $$x $(DESTDIR)$(MANDIR)/man$${x##*.}/$${x##*/}; \
	done

clean:
	find -name '*.pyc' -delete
	rm -rf build dist re6stnet.egg-info $(MANPAGELIST)