summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7cdcce6..e3b95c4 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,12 @@ 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)
+RPM_REL = $(shell awk '/^Release: / {print $$2}' $(SPEC)| head -n 1)
+DEB_VER = $(shell head -n 1 debian/changelog | sed -n 's/.*(\([0-9.-]*\)).*/\1/p' | cut -d- -f1)
+
+ifneq ($(VER),$(DEB_VER))
+$(error Version in $(SPEC) ($(VER)) conflicts with version in debian/changelog ($(DEB_VER)))
+endif
all: rpm deb
@@ -16,11 +21,14 @@ rpm: $(SPEC) SOURCES/$(PACKAGE)-$(VER).tar.gz
[ -e SPECS ] || ln -s . SPECS
cd SPECS; rpmbuild --target noarch --define "_topdir $(PWD)" -ba $(SPEC)
mkdir -p OUTPUT
- cp RPMS/rapid-tunneling{,-server}-$(VER)-$(REL).noarch.rpm OUTPUT/
- cp SRPMS/rapid-tunneling-$(VER)-$(REL).src.rpm OUTPUT/
+ cp RPMS/rapid-tunneling{,-server}-$(VER)-$(RPM_REL).noarch.rpm OUTPUT/
+ cp SRPMS/rapid-tunneling-$(VER)-$(RPM_REL).src.rpm OUTPUT/
deb:
- debuild -uc -us
+ debuild -uc -us -I -I'[A-Z]*'
+ mkdir -p OUTPUT
+ mv ../rapid-tunneling_$(VER)* OUTPUT/
+ mv ../rapid-tunneling-server_$(VER)* OUTPUT/
SOURCES/$(PACKAGE)-$(VER).tar.gz: $(SOURCES)
tar czf $@ --transform 's|^|$(PACKAGE)-$(VER)/|' $^