File: Makefile

package info (click to toggle)
wader 0.5.12-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,672 kB
  • ctags: 5,053
  • sloc: python: 17,191; makefile: 142; sh: 131
file content (45 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
SHELL = /bin/bash

VERSION := $(shell python -c 'from wader.common.consts import APP_VERSION; print APP_VERSION')
SOURCES := $(shell rpmbuild --eval '%{_topdir}' 2>/dev/null)/SOURCES
WV := wader-$(VERSION)

all:
	@echo Usage: make deb \[TARGET=ubuntu-lucid\] \| rpm

rpm:
	@if [ ! -d $(SOURCES) ] ;\
	then\
		echo 'SOURCES does not exist, are you running on a non RPM based system?';\
		exit 1;\
	fi

	touch resources/extra/networks.py

	tar -jcvf $(SOURCES)/$(WV).tar.bz2 --exclude=.git --transform="s/^\./$(WV)/" .
	rpmbuild -ba resources/rpm/wader.spec

deb:
	@if [ ! -d /var/lib/dpkg ] ;\
	then\
		echo 'Debian package directory does not exist, are you running on a non Debian based system?';\
		exit 1;\
	fi

	touch resources/extra/networks.py

	@if [ -d packaging/debian/$(TARGET)/debian ] ;\
	then\
		PKGSOURCE=$(TARGET);\
	else\
		PKGSOURCE=generic;\
	fi;\
	tar -C packaging/debian/$$PKGSOURCE -cf - debian | tar -xf -

	@if ! head -1 debian/changelog | grep -q $(VERSION) ;\
	then\
		echo Changelog and package version are different;\
		exit 1;\
	fi

	dpkg-buildpackage -rfakeroot