/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/mpi/submit_filter/Makefile
ViewVC logotype

Contents of /trunk/nl.nikhef.ndpf.tools/mpi/submit_filter/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2226 - (show annotations) (download)
Mon Mar 7 11:44:15 2011 UTC (10 years, 10 months ago) by fbernabe
File size: 1888 byte(s)
The files for building submit_filter



1 .PHONY: install rpm spec tar release reltest filelist clean
2
3 # use 'make S=' to generate more output
4 S=@
5
6 # file containing the VERSION and RELEASE definitions
7 # which may be updated via make release
8 ver_cfg = config.version
9 include $(ver_cfg)
10
11 NAME = submit_filter
12 RPMBUILD := $(shell rpm -E %_topdir || echo ${HOME}/src/rpmbuild )
13 TARFILE = ${NAME}-${VERSION}.src.tgz
14 SPECFILE = ${NAME}-${VERSION}.spec
15 PREFIX = /var/spool
16 TMPFILE := $(shell mktemp /tmp/${NAME}-tmp.XXXXXXXX)
17
18 install:
19 @echo Installing in dir ${PREFIX}
20 mkdir -p ${PREFIX} 2> /dev/null
21 cp -a pbs ${PREFIX}/
22
23 rpm: spec tar
24 @echo [rpm] Building rpm ${NAME}-${version}-${release}.rpm
25 rpmbuild -bb ${RPMBUILD}/SPECS/${SPECFILE}
26
27 spec:
28 @echo Generating spec file ${SPECFILE}
29 @sed -e "s!@VERSION@!${VERSION}!g" -e "s!@INSTALL_ROOT@!${PREFIX}!g" \
30 -e "s!@RELEASE@!${RELEASE}!g" -e "s!@NAME@!${NAME}!g" template.spec \
31 > ${SPECFILE}
32 @cp ${SPECFILE} ${RPMBUILD}/SPECS/
33
34 tar:
35 /bin/rm -f ${TMPFILE}
36 find pbs -type f | egrep -v '/(CVS|.svn)/' >> ${TMPFILE} || true
37 echo Makefile >> ${TMPFILE} || true
38 echo config.version >> ${TMPFILE} || true
39 @tar czf ${TARFILE} -T ${TMPFILE}
40 @cp ${TARFILE} ${RPMBUILD}/SOURCES/
41
42 release:
43 @perl -n \
44 -e 'if (/VERSION\s*=\s*([^ ]+)\s*$$/) { $$v = $$1 and chomp $$v; }' \
45 -e 'if (/RELEASE\s*=\s*(\d+)\s*$$/) { $$r = $$1+1 and chomp $$r; }' \
46 -e 'END {' \
47 -e 'die "Cannot determine VERSION and/or RELEASE\n"' \
48 -e 'unless (defined $$v and defined $$r);' \
49 -e 'print "VERSION=$$v\nRELEASE=$$r\n"; }' \
50 < $(ver_cfg) > $(ver_cfg).tmp
51 @rm -f $(ver_cfg)
52 @mv $(ver_cfg).tmp $(ver_cfg)
53 $(MAKE) rpm
54
55 filelist:
56 @rm -f ${NAME}.filelist 2> /dev/null
57 @find pbs -type f -print | egrep -v '/(CVS|.svn)/' | \
58 sed -e "s!^!${PREFIX}/!" >> ${NAME}.filelist
59
60 clean:
61 @rm -f ${NAME}-*.*.*.spec ${NAME}-*.*.*.src.tgz ${NAME}.filelist /tmp/${NAME}-tmp.????????

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28