78 |
'prune translations/CVS'], |
'prune translations/CVS'], |
79 |
preserve_path = 1), |
preserve_path = 1), |
80 |
Data_Files (base_dir = 'install_data', |
Data_Files (base_dir = 'install_data', |
|
copy_to = 'share/man/man1', |
|
|
template = ['recursive-include man *.1'], |
|
|
preserve_path = 0), |
|
|
Data_Files (base_dir = 'install_data', |
|
81 |
copy_to = 'share/doc/gnue-common', |
copy_to = 'share/doc/gnue-common', |
82 |
template = ['recursive-include doc *', |
template = ['recursive-include doc *', |
83 |
'prune doc/CVS', |
'prune doc/CVS', |
92 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
93 |
|
|
94 |
def build_files (): |
def build_files (): |
|
# First check if we have everything installed we need to build the |
|
|
# distribution |
|
|
|
|
|
# is gsscvs available (to build man pages)? |
|
|
if not os.path.isfile ("scripts/gsscvs"): |
|
|
print "Could not find file 'scripts/gsscvs'. Please run 'setup-cvs.py'." |
|
|
sys.exit (1) |
|
|
|
|
|
# --------------------------------------------------------------------------- |
|
95 |
|
|
96 |
print "building man page" |
# nothing to do here |
97 |
if os.system ("mkdir -p man && cd man " \ |
pass |
|
+ " && ../scripts/gsscvs --generate-man-page") != 0: |
|
|
sys.exit (1) |
|
98 |
|
|
99 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
100 |
# Check dependencies for installation: |
# Check dependencies for installation: |
117 |
import distutils.command.sdist |
import distutils.command.sdist |
118 |
import distutils.command.build |
import distutils.command.build |
119 |
import distutils.command.install |
import distutils.command.install |
120 |
|
import distutils.command.install_scripts |
121 |
from setupext import Data_Files, install_Data_Files |
from setupext import Data_Files, install_Data_Files |
122 |
|
|
123 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
166 |
except ValueError: |
except ValueError: |
167 |
pass |
pass |
168 |
|
|
169 |
if (sys.platform != "win32" and not have_prefix and "install" in sys.argv) \ |
if (os.name == "posix" and not have_prefix and "install" in sys.argv) \ |
170 |
or have_setupcfg: |
or have_setupcfg: |
171 |
os.system ("cp %s setup.cfg" % setupcfg) |
os.system ("cp %s setup.cfg" % setupcfg) |
172 |
else: |
else: |
356 |
def run (self): |
def run (self): |
357 |
check_dependencies () |
check_dependencies () |
358 |
|
|
359 |
self._generate_scripts () |
# self._generate_scripts () |
360 |
|
|
361 |
self._write_gnue_pth () |
self._write_gnue_pth () |
362 |
|
|
364 |
|
|
365 |
distutils.command.install.install.run (self) |
distutils.command.install.install.run (self) |
366 |
|
|
367 |
|
# ============================================================================= |
368 |
|
# install_scripts: Generate man pages after installing |
369 |
|
# ============================================================================= |
370 |
|
|
371 |
|
class install_scripts (distutils.command.install_scripts.install_scripts): |
372 |
|
|
373 |
|
def run (self): |
374 |
|
distutils.command.install_scripts.install_scripts.run (self) |
375 |
|
|
376 |
|
if os.name == "posix": |
377 |
|
instcmd = self.get_finalized_command ("install") |
378 |
|
man1dir = os.path.join (instcmd.install_data, "share", "man", "man1") |
379 |
|
if not os.path.isdir (man1dir): |
380 |
|
os.makedirs (man1dir) |
381 |
|
olddir = os.getcwd () |
382 |
|
os.chdir (man1dir) |
383 |
|
for script in self.get_outputs (): |
384 |
|
print "building man page for %s" % os.path.basename (script) |
385 |
|
os.system ("PYTHONPATH=" + instcmd.install_lib + " " + \ |
386 |
|
script + " --generate-man-page") |
387 |
|
os.chdir (olddir) |
388 |
|
|
389 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
390 |
# Get all packages in a directory |
# Get all packages in a directory |
391 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
442 |
data_files = setup_params ["data_files"], |
data_files = setup_params ["data_files"], |
443 |
|
|
444 |
# Override certain command classes with our own ones |
# Override certain command classes with our own ones |
445 |
cmdclass = {"build": build, |
cmdclass = {"sdist": sdist, |
446 |
|
"build": build, |
447 |
"install": install, |
"install": install, |
448 |
|
"install_scripts": install_scripts, |
449 |
"install_data": install_Data_Files}) |
"install_data": install_Data_Files}) |
450 |
|
|
451 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |