source: trunk/Makefile.rpm.in @ 360

Last change on this file since 360 was 360, checked in by bas, 6 years ago

updated all versions to 4.6.3

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