diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-03-21 18:13:55 +0100 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-03-21 18:13:55 +0100 |
commit | 6c156ba682675a5f44a9dc2c22af638db1677708 (patch) | |
tree | c5ddc26fe27b6fe9d09b9bdfe60c8b016922138c /src/pyfedpkg/__init__.py | |
parent | 540bd77ac2959471c0aa6f6f278e718aacad966b (diff) | |
download | fedora-packager-6c156ba682675a5f44a9dc2c22af638db1677708.tar.gz fedora-packager-6c156ba682675a5f44a9dc2c22af638db1677708.tar.xz fedora-packager-6c156ba682675a5f44a9dc2c22af638db1677708.zip |
Implement rpmbuild options: --define --with --withoutrpmbuild-option-passthrough
Implement the following global fedpkg options for passing on
to rpmbuild, regardless of whether fedpkg is directly calling
rpmbuild or calling it indirectly via mock:
-D 'MACRO EXPR', --define 'MACRO EXPR'
define an rpm macro for rpmbuild and mock
--with RPMWITH enable configure option for rpmbuild and mock
--without RPMWITHOUT disable configure option for rpmbuild and mock
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-rw-r--r-- | src/pyfedpkg/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 92bc7df..cd43498 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1198,6 +1198,10 @@ class PackageModule: "--define 'dist .%s'" % self.dist, "--define '%s %s'" % (self.distvar, self.distval), "--define '%s 1'" % self.dist] + self.rpmbuildopts = ( + [ ( "--define '%s'" % x) for x in args.rpmmacros] + + [ ( "--with '%s'" % x) for x in args.rpmwith ] + + [ ("--without '%s'" % x) for x in args.rpmwithout ]) try: self.ver = self.getver() self.rel = self.getrel() @@ -1393,6 +1397,7 @@ class PackageModule: # setup the rpm command cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) if arch: cmd.extend(['--target', arch]) if short: @@ -1565,6 +1570,7 @@ class PackageModule: # setup the rpm command cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) if arch: cmd.extend(['--target', arch]) if short: @@ -1622,6 +1628,7 @@ class PackageModule: # build up the rpm command cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) # This may need to get updated if we ever change our checksum default if not hashtype == 'sha256': cmd.extend(["--define '_source_filedigest_algorithm %s'" % hashtype, @@ -1646,6 +1653,7 @@ class PackageModule: # setup the command cmd = ['mock'] cmd.extend(mockargs) + cmd.extend(self.rpmbuildopts) cmd.extend(['-r', self.mockconfig, '--resultdir', os.path.join(self.path, self.module, self.ver, self.rel), '--rebuild', self.srpmname]) @@ -1792,6 +1800,7 @@ class PackageModule: # setup the rpm command cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) if arch: cmd.extend(['--target', arch]) cmd.extend(['--nodeps', '-bp', os.path.join(self.path, self.spec)]) @@ -1815,6 +1824,7 @@ class PackageModule: cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) # Figure out which hashtype to use, if not provided one if not hashtype: hashtype = self.hashtype @@ -1853,6 +1863,7 @@ class PackageModule: # setup the rpm command cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) + cmd.extend(self.rpmbuildopts) cmd.extend(['-bl', os.path.join(self.path, self.spec)]) # Run the command _run_command(cmd, shell=True) |