summaryrefslogtreecommitdiff
path: root/Makefile
blob: 56d04ae94466244726b05e37e84383d6a48154bb (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
37
38
39
40
41
42
43
44
45
46
47
REL_VERSION:=1.4
ROOT_DIR=$(shell pwd)

all: release srpm rpm

rel-upload: release
	scp $(ROOT_DIR)/dropwatch-$(REL_VERSION).tbz2 fedorahosted.org:dropwatch

release: tarball 

tarball:
	mkdir -p stage 
	ln -s $(ROOT_DIR) stage/dropwatch-$(REL_VERSION)
	tar jchf $(ROOT_DIR)/stage/dropwatch-$(REL_VERSION).tbz2 --exclude \.git --exclude stage -C stage dropwatch-$(REL_VERSION)/
	mv $(ROOT_DIR)/stage/*.tbz2 $(ROOT_DIR)
	rm -rf stage

srpm: tarball
	$(shell sed -e"s/MAKEFILE_VERSION/$(REL_VERSION)/" ./spec/dropwatch.spec > ./dropwatch.spec)
	rpmbuild --define "_sourcedir $(ROOT_DIR)" --define "_srcrpmdir $(ROOT_DIR)" -bs $(ROOT_DIR)/dropwatch.spec

rpm: srpm
	mkdir -p BUILD
	mkdir -p RPMS
	rpmbuild --define "_sourcedir $(ROOT_DIR)" --define "_builddir $(ROOT_DIR)/BUILD" --define "_rpmdir $(ROOT_DIR)/RPMS" -bb $(ROOT_DIR)/dropwatch.spec
	rm -rf BUILD

clean:
	rm -f $(ROOT_DIR)/dropwatch*.tbz2 $(ROOT_DIR)/*.rpm $(ROOT_DIR)/*.spec
	rm -rf BUILD
	rm -rf RPMS
	rm -rf stage
	make -C src clean 

build:
	make -C src all 

build_clean:
	make -c src clean

tag:
	git tag -s -u $(GIT_AUTHOR_EMAIL) -m"Tag V$(REL_VERSION)" V$(REL_VERSION)

git-upload:
	git push --all ssh://git.fedorahosted.org/git/dropwatch.git
	git push --tags ssh://git.fedorahosted.org/git/dropwatch.git