Mercurial > p > roundup > code
comparison roundup/dist/command/bdist_rpm.py @ 4068:e233d7a66343
Refactor setup.py.
| author | Stefan Seefeld <stefan@seefeld.name> |
|---|---|
| date | Mon, 23 Feb 2009 14:30:32 +0000 |
| parents | |
| children | 42bf0a707763 |
comparison
equal
deleted
inserted
replaced
| 4067:7309ac3b6e24 | 4068:e233d7a66343 |
|---|---|
| 1 # | |
| 2 # Copyright (C) 2009 Stefan Seefeld | |
| 3 # All rights reserved. | |
| 4 # For license terms see the file COPYING.txt. | |
| 5 # | |
| 6 from distutils.command.bdist_rpm import bdist_rpm as base | |
| 7 from distutils.file_util import write_file | |
| 8 import os | |
| 9 | |
| 10 class bdist_rpm(base): | |
| 11 | |
| 12 def finalize_options(self): | |
| 13 base.finalize_options(self) | |
| 14 if self.install_script: | |
| 15 # install script is overridden. skip default | |
| 16 return | |
| 17 # install script option must be file name. | |
| 18 # create the file in rpm build directory. | |
| 19 install_script = os.path.join(self.rpm_base, "install.sh") | |
| 20 self.mkpath(self.rpm_base) | |
| 21 self.execute(write_file, (install_script, [ | |
| 22 ("%s setup.py install --root=$RPM_BUILD_ROOT " | |
| 23 "--record=ROUNDUP_FILES") % self.python, | |
| 24 # allow any additional extension for man pages | |
| 25 # (rpm may compress them to .gz or .bz2) | |
| 26 # man page here is any file | |
| 27 # with single-character extension | |
| 28 # in man directory | |
| 29 "sed -e 's,\(/man/.*\..\)$,\\1*,' " | |
| 30 "<ROUNDUP_FILES >INSTALLED_FILES", | |
| 31 ]), "writing '%s'" % install_script) | |
| 32 self.install_script = install_script | |
| 33 |
