From 57a6a5147897525742331568d9538371c7260cf8 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 12 Oct 2003 12:44:26 +0000 Subject: More flexible RPM building. (Gerard Patel) Have scripts look for the build engine in the site-packages subdirectory as wel. (Charles Crain) --- rpm/scons.spec.in | 10 +++++----- src/CHANGES.txt | 7 +++++++ src/script/scons.bat | 4 ++-- src/script/scons.py | 7 ++++++- src/script/sconsign.py | 7 ++++++- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/rpm/scons.spec.in b/rpm/scons.spec.in index bbc77bf..53a245c 100644 --- a/rpm/scons.spec.in +++ b/rpm/scons.spec.in @@ -41,9 +41,9 @@ python setup.py build %install python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-lib=/usr/lib/scons --install-scripts=/usr/bin -mkdir -p $RPM_BUILD_ROOT/usr/man/man1 -gzip -c scons.1 > $RPM_BUILD_ROOT/usr/man/man1/scons.1.gz -gzip -c sconsign.1 > $RPM_BUILD_ROOT/usr/man/man1/sconsign.1.gz +mkdir -p $RPM_BUILD_ROOT%_mandir/man1 +gzip -c scons.1 > $RPM_BUILD_ROOT%_mandir/man1/scons.1.gz +gzip -c sconsign.1 > $RPM_BUILD_ROOT%_mandir/man1/sconsign.1.gz %clean rm -rf $RPM_BUILD_ROOT @@ -51,5 +51,5 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) __RPM_FILES__ -%doc /usr/man/man1/scons.1.gz -%doc /usr/man/man1/sconsign.1.gz +%doc %{_mandir}/man1/scons.1* +%doc %{_mandir}/man1/sconsign.1* diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d228c81..1706903 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -34,6 +34,9 @@ RELEASE X.XX - XXX - Support directories as build sources, so that a rebuild of a target can be triggered if anything underneath the directory changes. + - Have the scons.bat and scons.py files look for the SCons modules + in site-packages as well. + From Christian Engel: - Support more flexible inclusion of separate C and C++ compilers. @@ -128,6 +131,10 @@ RELEASE X.XX - XXX - Allow a directory to be the target or source or dependency of a Depends(), Ignore(), Precious() or SideEffect() call. + From Gerard Patel: + + - Use the %{_mandir} macro when building our RPM package. + From Marko Rauhamaa: - Have the closing message say "...terminated because of errors" if diff --git a/src/script/scons.bat b/src/script/scons.bat index d2770c6..782d8c4 100644 --- a/src/script/scons.bat +++ b/src/script/scons.bat @@ -1,11 +1,11 @@ @echo off if "%OS%" == "Windows_NT" goto WinNT REM for 9x/Me you better not have more than 9 args -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 REM no way to set exit status of this script for 9x/Me goto endscons :WinNT -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %* +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endscons if errorlevel 9009 echo you do not have python in your PATH REM color 00 causes this script to exit with non-zero exit status diff --git a/src/script/scons.py b/src/script/scons.py index 501f071..a90e1ba 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -79,6 +79,7 @@ if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. prefs.append(sys.prefix) + prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to # the variety of path names and library locations. Try to be smart @@ -120,7 +121,11 @@ else: # check only /foo/lib/scons*. prefs.append(sys.prefix) - prefs = map(lambda x: os.path.join(x, 'lib'), prefs) + temp = map(lambda x: os.path.join(x, 'lib'), prefs) + temp.extend(map(lambda x: os.path.join(x, 'lib', 'python%d.%d' % (sys.version_info[0], + sys.version_info[1]), + 'site-packages'), prefs)) + prefs = temp # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 015f1db..520d0fa 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -80,6 +80,7 @@ if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. prefs.append(sys.prefix) + prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to # the variety of path names and library locations. Try to be smart @@ -121,7 +122,11 @@ else: # check only /foo/lib/scons*. prefs.append(sys.prefix) - prefs = map(lambda x: os.path.join(x, 'lib'), prefs) + temp = map(lambda x: os.path.join(x, 'lib'), prefs) + temp.extend(map(lambda x: os.path.join(x, 'lib', 'python%d.%d' % (sys.version_info[0], + sys.version_info[1]), + 'site-packages'), prefs)) + prefs = temp # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. -- cgit v0.12