File: Makefile

package info (click to toggle)
python-messaging 0.5.11%2Bdebian-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 964 kB
  • ctags: 392
  • sloc: python: 3,303; makefile: 145
file content (33 lines) | stat: -rw-r--r-- 820 bytes parent folder | download
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
SHELL = /bin/bash

VERSION := $(shell python -c 'from messaging import VERSION; print "%s.%s.%s" % VERSION')
SOURCES := $(shell rpmbuild --eval '%{_topdir}' 2>/dev/null)/SOURCES
PMV := python-messaging-$(VERSION)

all:
	@echo Usage: make deb\|rpm

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

	tar -zcvf $(SOURCES)/$(PMV).tar.gz --exclude=.git --transform="s/^\./$(PMV)/" .
	rpmbuild -ba python-messaging.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

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

	dpkg-buildpackage -rfakeroot;