From e404baf33dad8902f5b6d11e1020d7489d34b671 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Tue, 30 Oct 2012 16:54:05 -0500 Subject: export.py: Add bcfg2-selinux spec file updates Signed-off-by: Sol Jerome --- misc/bcfg2-selinux.spec | 2 +- tools/export.py | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/misc/bcfg2-selinux.spec b/misc/bcfg2-selinux.spec index fa3d447d7..a5864848d 100644 --- a/misc/bcfg2-selinux.spec +++ b/misc/bcfg2-selinux.spec @@ -70,7 +70,7 @@ deployment strategies. This package includes the Bcfg2 server and client SELinux policy. %prep -%setup -q -n bcfg2-%{version} +%setup -q -n %{name}-%{version} %build cd redhat/selinux diff --git a/tools/export.py b/tools/export.py index 3b52b35bb..8604c7f2f 100755 --- a/tools/export.py +++ b/tools/export.py @@ -137,14 +137,13 @@ E.G. 1.2.0pre1 is a valid version. tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version) newchangelog = \ -"""bcfg2 (%s%s-0.0) unstable; urgency=low +"""bcfg2 (%s-0.0) unstable; urgency=low * New upstream release -- %s <%s> %s -""" % (version_release, - version_info['build'], +""" % (version, name, email, formatdate(localtime=True)) @@ -174,7 +173,7 @@ E.G. 1.2.0pre1 is a valid version. # write out the new RPM changelog specs = ["misc/bcfg2.spec", "redhat/bcfg2.spec.in"] if options.dryrun: - print("*** Add the following to the top of the %changelog section in %s:\n%s\n" + print("*** Add the following to the top of the %%changelog section in %s:\n%s\n" % (rpmchangelog, " and ".join(specs))) else: for fname in specs: @@ -197,7 +196,7 @@ E.G. 1.2.0pre1 is a valid version. # Update redhat directory versions if options.dryrun: - print("*** Replace redhat/VERIONS content with '%s'." + print("*** Replace redhat/VERSIONS content with '%s'." % version_release) print("*** Replace redhat/RELEASE content with '%s'." % version_info['build']) @@ -230,13 +229,41 @@ E.G. 1.2.0pre1 is a valid version. '__version__ =', '__version__ = "%s"\n' % version, dryrun=options.dryrun) - # replace version in misc/bcfg2.spec + # replace version in misc/bcfg2.spec and misc/bcfg2-selinux.spec find_and_replace('misc/bcfg2.spec', 'Version:', 'Version: %s\n' % version_release, dryrun=options.dryrun) + find_and_replace('misc/bcfg2-selinux.spec', 'Version:', + 'Version: %s\n' % version_release, + dryrun=options.dryrun) find_and_replace('misc/bcfg2.spec', 'Release: ', 'Release: 0.0%s\n' % version_info['build'], dryrun=options.dryrun) + find_and_replace('misc/bcfg2-selinux.spec', 'Release: ', + 'Release: 0.0%s\n' % version_info['build'], + dryrun=options.dryrun) + find_and_replace('misc/bcfg2.spec', '%setup', + '%%setup -q -n %%{name}-%%{version}%s\n' % + version_info['build'], + startswith=True, + dryrun=options.dryrun) + find_and_replace('misc/bcfg2-selinux.spec', '%setup', + '%%setup -q -n %%{name}-%%{version}%s\n' % + version_info['build'], + startswith=True, + dryrun=options.dryrun) + # fix pre problem noted in + # http://trac.mcs.anl.gov/projects/bcfg2/ticket/1129 + find_and_replace('misc/bcfg2.spec', + 'Source0', + 'Source0: ftp://ftp.mcs.anl.gov/pub/bcfg/%%{name}-%%{version}%s.tar.gz\n' % version_info["build"], + startswith=True, + dryrun=options.dryrun) + find_and_replace('misc/bcfg2-selinux.spec', + 'Source0', + 'Source0: ftp://ftp.mcs.anl.gov/pub/bcfg/%%{name}-%%{version}%s.tar.gz\n' % version_info["build"], + startswith=True, + dryrun=options.dryrun) # update the version in reports find_and_replace('src/lib/Bcfg2/Reporting/templates/base.html', 'Bcfg2 Version', -- cgit v1.2.3-1-g7c22