summaryrefslogtreecommitdiff
path: root/Makefile
blob: ddbc85c9417bea83bb6d721783b67e98f934d918 (plain)
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
PACKAGE	= rapid-tunneling
SPEC	= rapid-tunneling.spec

SCRIPTS = rapid-tunneling rapid-tunneling-status rtadm rt-from-remote
CONFIGS = rtadm.config sshd_support_config
INIT_D  = sshd_support
SOURCES = Makefile $(SPEC) $(SCRIPTS) $(CONFIGS) $(INIT_D)

VER	= $(shell awk '/^Version: / {print $$2}' $(SPEC)| head -n 1)
REL	= $(shell awk '/^Release: / {print $$2}' $(SPEC)| head -n 1)

all: rpm

rpm: $(SPEC) SOURCES/$(PACKAGE)-$(VER).tar.gz
	mkdir -p BUILD RPMS SOURCES SRPMS
	[ -e SPECS ] || ln -s . SPECS
	cd SPECS; rpmbuild --target noarch --define "_topdir $(PWD)" -ba $(SPEC)

SOURCES/$(PACKAGE)-$(VER).tar.gz: $(SOURCES)
	tar czf $@ --transform 's|^|$(PACKAGE)-$(VER)/|' $^

install:
	install -m 755 -d $(DESTDIR)/usr/sbin
	install -m 755 rapid-tunneling $(DESTDIR)/usr/sbin
	install -m 755 rapid-tunneling-status $(DESTDIR)/usr/sbin
	install -m 755 -d $(DESTDIR)/var/lib/rapid-tunneling	
	install -m 755 rtadm $(DESTDIR)/usr/sbin
	install -m 755 rt-from-remote $(DESTDIR)/usr/sbin
	install -m 755 -d $(DESTDIR)/etc/default
	install -m 644 rtadm.config $(DESTDIR)/etc/default/rtadm
	install -m 755 -d $(DESTDIR)/etc/ssh
	install -m 644 sshd_support_config $(DESTDIR)/etc/ssh

.PHONY: clean dummy
dummy:
clean: