Mercurial > p > roundup > code
comparison setup.py @ 3273:e586bc06a6ca maint-0.8
fix bdist_rpm [SF#1164328]
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Thu, 07 Apr 2005 07:24:43 +0000 |
| parents | ed97e2a85576 |
| children | 5e45f3a553d8 |
comparison
equal
deleted
inserted
replaced
| 3272:8b0397a90a22 | 3273:e586bc06a6ca |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: setup.py,v 1.77.2.7 2005-03-03 22:12:35 richard Exp $ | 19 # $Id: setup.py,v 1.77.2.8 2005-04-07 07:24:43 a1s Exp $ |
| 20 | 20 |
| 21 from distutils.core import setup, Extension | 21 from distutils.core import setup, Extension |
| 22 from distutils.util import get_platform | 22 from distutils.util import get_platform |
| 23 from distutils.file_util import write_file | |
| 24 from distutils.command.bdist_rpm import bdist_rpm | |
| 25 from distutils.command.build import build | |
| 23 from distutils.command.build_scripts import build_scripts | 26 from distutils.command.build_scripts import build_scripts |
| 24 from distutils.command.build import build | |
| 25 from distutils.command.build_py import build_py | 27 from distutils.command.build_py import build_py |
| 26 | 28 |
| 27 import sys, os, string | 29 import sys, os, string |
| 28 from glob import glob | 30 from glob import glob |
| 29 | 31 |
| 252 | 254 |
| 253 def run(self): | 255 def run(self): |
| 254 check_manifest() | 256 check_manifest() |
| 255 self.build_message_files() | 257 self.build_message_files() |
| 256 build.run(self) | 258 build.run(self) |
| 259 | |
| 260 class bdist_rpm_roundup(bdist_rpm): | |
| 261 | |
| 262 def finalize_options(self): | |
| 263 bdist_rpm.finalize_options(self) | |
| 264 if self.install_script: | |
| 265 # install script is overridden. skip default | |
| 266 return | |
| 267 # install script option must be file name. | |
| 268 # create the file in rpm build directory. | |
| 269 install_script = os.path.join(self.rpm_base, "install.sh") | |
| 270 self.mkpath(self.rpm_base) | |
| 271 self.execute(write_file, (install_script, [ | |
| 272 ("%s setup.py install --root=$RPM_BUILD_ROOT " | |
| 273 "--record=ROUNDUP_FILES") % self.python, | |
| 274 # allow any additional extension for man pages | |
| 275 # (rpm may compress them to .gz or .bz2) | |
| 276 # man page here is any file | |
| 277 # with single-character extension | |
| 278 # in man directory | |
| 279 "sed -e 's,\(/man/.*\..\)$,\\1*,' " | |
| 280 "<ROUNDUP_FILES >INSTALLED_FILES", | |
| 281 ]), "writing '%s'" % install_script) | |
| 282 self.install_script = install_script | |
| 257 | 283 |
| 258 ############################################################################# | 284 ############################################################################# |
| 259 ### Main setup stuff | 285 ### Main setup stuff |
| 260 ############################################################################# | 286 ############################################################################# |
| 261 | 287 |
| 366 # Override certain command classes with our own ones | 392 # Override certain command classes with our own ones |
| 367 'cmdclass': { | 393 'cmdclass': { |
| 368 'build_scripts': build_scripts_roundup, | 394 'build_scripts': build_scripts_roundup, |
| 369 'build_py': build_py_roundup, | 395 'build_py': build_py_roundup, |
| 370 'build': build_roundup, | 396 'build': build_roundup, |
| 397 'bdist_rpm': bdist_rpm_roundup, | |
| 371 }, | 398 }, |
| 372 'scripts': roundup_scripts, | 399 'scripts': roundup_scripts, |
| 373 | 400 |
| 374 'data_files': installdatafiles | 401 'data_files': installdatafiles |
| 375 } | 402 } |
