Author: gnichols Date: 2012-03-29 00:16:07 +0000 (Thu, 29 Mar 2012) New Revision: 1247
Added: trunk/v7spec.py Modified: trunk/Makefile trunk/v7.spec.in Log: 807714 - v7 1.5 R12 requires udisks package not in RHEL5
Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2012-03-28 13:44:54 UTC (rev 1246) +++ trunk/Makefile 2012-03-29 00:16:07 UTC (rev 1247) @@ -14,7 +14,7 @@ # Author: Greg Nichols
V7_VERSION := 1.5 -V7_RELEASE := 12 +V7_RELEASE := 13 V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE) V7_VERSION_PY := v7/version.py V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7 @@ -72,7 +72,7 @@ tar cjS -f $@ -X /tmp/v7/exclude --exclude $@ Makefile server
-/tmp/v7/exclude: +/tmp/v7/exclude: Makefile mkdir -p /tmp/v7 echo "CVS" > $@ echo "save" >> $@ @@ -81,9 +81,10 @@ echo "v7/*.pyc" >> $@ echo "test-env/bin/*.pyc" >> $@ echo "*.bz2" >> $@ + echo "v7spec.*" >> $@
-v7.spec: v7.spec.in Makefile - cat $< | sed -e 's/@V7_VERSION@/$(V7_VERSION)/g' -e 's/@V7_RELEASE@/$(V7_RELEASE)/g' -e 's/@V7_RHEL_VERSION@/$(V7_RHEL_VERSION)/g'> $@ +v7.spec: v7.spec.in v7spec.py v7/version.py + ./v7spec.py --rhelVersion $(V7_RHEL_VERSION) v7-server.spec: v7-server.spec.in Makefile cat $< | sed -e 's/@V7_VERSION@/$(V7_VERSION)/g' -e 's/@V7_RELEASE@/$(V7_RELEASE)/g' -e 's/@V7_RHEL_VERSION@/$(V7_RHEL_VERSION)/g'> $@
Modified: trunk/v7.spec.in =================================================================== --- trunk/v7.spec.in 2012-03-28 13:44:54 UTC (rev 1246) +++ trunk/v7.spec.in 2012-03-29 00:16:07 UTC (rev 1247) @@ -24,8 +24,9 @@ Obsoletes: hts Requires: lmbench, dt, httpd, nfs-utils, stress, gcc, PyXML, rpm-build Requires: dbus-python, kernel-devel, kernel-headers, sos -# RHEL6 +# RHEL6-only-begin Requires: udisks +# RHEL6-only-end
# v7-server subpackage %package server
Added: trunk/v7spec.py =================================================================== --- trunk/v7spec.py (rev 0) +++ trunk/v7spec.py 2012-03-29 00:16:07 UTC (rev 1247) @@ -0,0 +1,43 @@ +#!/usr/bin/python +""" generate the v7.spec file via macro substitution """ + +from optparse import OptionParser +import v7.version + +def doMacro(line, macro, value): + if macro not in line: + return line + + # otherwise + parts = line.split(macro) + return "%s%s%s" % (parts[0], value, parts[1]) + +usage = "usage: %prog [options]" + +parser = OptionParser(usage) + +parser.add_option("-v", "--rhelVersion", + action="store", dest="rhelVersion", type="int", default=6, + help="RHEL Major Version") + +(options,args) = parser.parse_args() + + +inputSpec = open("v7.spec.in") +outputSpec = open("v7.spec", "w") +skipping = False +for line in inputSpec.readlines(): + + if options.rhelVersion is not 6 and "# RHEL6-only-begin\n" == line: + skipping = True + continue + elif skipping and options.rhelVersion is not 6 and "# RHEL6-only-end\n" == line: + skipping = False + continue + elif skipping: + continue + macros = {"@V7_VERSION@": v7.version.version, "@V7_RELEASE@": v7.version.release, "@V7_RHEL_VERSION@": options.rhelVersion } + for (macro, value) in macros.items(): + line = doMacro(line, macro, value) + outputSpec.write(line) + \ No newline at end of file
Property changes on: trunk/v7spec.py ___________________________________________________________________ Added: svn:executable + *
v7-commits@lists.stg.fedorahosted.org