source: trunk/Makefile.rpm @ 329

Last change on this file since 329 was 198, checked in by ramonb, 15 years ago

Makefile.rpm:

  • updated version
File size: 1.4 KB
Line 
1PRODUCT=pbs_python
2VERSION=3.2.0
3RELEASE=1
4
5#PYTHON_VERSION=2.3
6PYTHON_VERSION=$(shell python -c "import re;import sys;print re.match('(?P<major>\d\.\d)',sys.version).group('major')")
7#LIBDIR=/usr/lib64
8LIBDIR=$(shell if [ `uname -p` = 'x86_64' ]; then echo /usr/lib64; else echo /usr/lib; fi)
9
10TAR=/bin/tar
11
12SRCS = aclocal.m4 configure configure.in Makefile.in setup.py.in README TODO src examples
13
14_rpmtopdir = $(PWD)/rpm-build
15_rpmsrcdir = $(_rpmtopdir)/SOURCES
16_rpmbuilddir = $(_rpmtopdir)/BUILD
17_prodsrcdir = $(_rpmbuilddir)/$(PRODUCT)-$(VERSION)
18
19all:    rpm
20
21rpm:    $(_rpmsrcdir)/$(PRODUCT).tar.gz
22        @echo Building rpm...
23        @rpmbuild -ba --define '_sourcedir $(_rpmsrcdir)' \
24                      --define '_builddir $(_rpmbuilddir)' \
25                      --define 'prodversion $(VERSION)' \
26                      --define 'prodrelease $(RELEASE)' \
27                      --define 'pythonlib python$(PYTHON_VERSION)' \
28                      --define 'libdir $(LIBDIR)' \
29                         $(PRODUCT).spec
30        @rm -R $(_rpmsrcdir)
31
32$(_rpmsrcdir)/$(PRODUCT).tar.gz: $(SRCS) $(_rpmbuilddir) $(_rpmsrcdir)
33        @echo "Building tar file for sources ($(SRCS))..."
34        @if [ -d  $(_prodsrcdir) ]; then \
35          rm -Rf $(_prodsrcdir); \
36        fi
37        @mkdir -p $(_prodsrcdir)
38        @cp -R $(SRCS) $(_prodsrcdir)
39        @$(TAR) -cz -C $(_rpmbuilddir) --exclude .svn --exclude CVS -f $@ $(PRODUCT)-$(VERSION)
40
41$(_rpmbuilddir):
42        @mkdir -p $(_rpmbuilddir)
43
44$(_rpmsrcdir):
45        @mkdir -p $(_rpmsrcdir)
46
Note: See TracBrowser for help on using the repository browser.