Debian Codegraph @

GNUmakefile

raw
1 #
2 # Copyright (C) 2008 Andrew Beekhof
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18
19 -include Makefile
20
21 PROJECT = heartbeat
22 TARFILE = $(PROJECT).tar.bz2
23
24 RPM_ROOT = $(shell pwd)
25 RPM_OPTS = --define "_sourcedir $(RPM_ROOT)" \
26 --define "_srcrpmdir $(RPM_ROOT)" \
27 --define "dist .$(DISTRO)"
28
29
30 getdistro = $(shell test -e /etc/SuSE-release || echo fedora; test -e /etc/SuSE-release && echo suse)
31 DISTRO ?= $(call getdistro)
32 TAG ?= tip
33
34 hgarchive:
35 rm -f $(TARFILE)
36 hg archive -t tbz2 -r $(TAG) $(TARFILE)
37 echo `date`: Rebuilt $(TARFILE)
38
39 srpm: hgarchive
40 rm -f *.src.rpm
41 rpmbuild -bs $(RPM_OPTS) $(PROJECT)-$(DISTRO).spec
42
43 rpm: srpm
44 @echo To create custom builds, edit the flags and options in $(PROJECT)-$(call getdistro).spec first
45 rpmbuild $(RPM_OPTS) --rebuild $(RPM_ROOT)/*.src.rpm
46
47