Don't install wxWindows until the %install step, use --inplace to

facilitate this.

Change the name of the -devel package since it doesn't care about the
python version like the main pacakges do.

Instead of using directory names and wildcards in the %files section
generate an explicit file list with an %attr on each line.  This is
because the %defattr was not completly working for some reason.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-09-23 20:31:24 +00:00
parent 1df7d9c158
commit f3cfdd41c8
2 changed files with 101 additions and 53 deletions

View File

@@ -0,0 +1,51 @@
"""
Walk a directory tree and output a filename list suitable for use
in an RPM spec.
Usage: genfilelist.py [-r] build_root filespec(s)
"""
import sys, os, glob
def walktree(names, buildroot, recurse):
for name in names:
isdir = os.path.isdir(name)
printfilename(name, buildroot, isdir)
if isdir and recurse:
walktree([os.path.join(name, x) for x in os.listdir(name)], buildroot, recurse)
def printfilename(name, buildroot, isdir):
s = os.lstat(name)
realname = name[len(buildroot):]
if isdir:
fmt = "%%dir %%attr(%o, root, root) %s"
else:
fmt = "%%attr(%o, root, root) %s"
print fmt % (s.st_mode & 0777, realname)
def main(args):
if args[0] == '-r':
recurse = 1
args = args[1:]
else:
recurse = 0
if len(args) < 2:
print __str__
sys.exit(1)
buildroot = args[0]
for arg in args[1:]:
if arg[0] == '/':
arg = arg[1:]
walktree(glob.glob(os.path.join(buildroot, arg)), buildroot, recurse)
if __name__ == "__main__":
main(sys.argv[1:])

View File

@@ -65,13 +65,13 @@ This package is implemented using the %{port} port of wxWindows, and
includes the wx%{port} shared libs and etc. includes the wx%{port} shared libs and etc.
%package devel %package -n wxPython%{port}-devel
Summary: wxPython%{port} development files Summary: wxPython%{port} development files
Group: Development/Libraries Group: Development/Libraries
Requires: wxPython%{port} = %{version} Requires: wxPython%{port} = %{version}
%description devel %description -n wxPython%{port}-devel
This packages contains the headers and etc. for building apps or This packages contains the headers and etc. for building apps or
Python extension modules that use the same wx%{port} shared libraries Python extension modules that use the same wx%{port} shared libraries
that wxPython uses. that wxPython uses.
@@ -89,11 +89,12 @@ else
MAKE="make" MAKE="make"
fi fi
WXDIR=`pwd`
mkdir build mkdir build
cd build cd build
# Configure, trying to reduce dependencies # Configure, trying to reduce external dependencies
../configure --with-%{lcport} \ $WXDIR/configure --with-%{lcport} \
--prefix=%{wxpref} \ --prefix=%{wxpref} \
--disable-soname \ --disable-soname \
--enable-rpath=%{wxpref}/lib \ --enable-rpath=%{wxpref}/lib \
@@ -111,39 +112,33 @@ cd build
--with-libtiff=builtin \ --with-libtiff=builtin \
--with-zlib=builtin \ --with-zlib=builtin \
## --enable-debug_flag \
## --with-odbc \
# Build wxWindows # Build wxWindows
$MAKE $MAKE
cd $WXDIR/locale
cd ../locale
make allmo make allmo
# ** Unfortunately we have to do a bit of installation here so wxPython
# can be built. Perhaps wx-config should be changed to be able to be
# used from the build dir, maybe with an --inplace flag... Move these
# three lines to %install if/when that happens.
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
cd ../build
make prefix=$RPM_BUILD_ROOT%{wxpref} install
# Now build wxPython # Now build wxPython
cd ../wxPython cd $WXDIR/wxPython
%{python} setup.py \ %{python} setup.py \
IN_CVS_TREE=1 \ IN_CVS_TREE=1 \
NO_SCRIPTS=1 \ NO_SCRIPTS=1 \
WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \ WX_CONFIG="$WXDIR/build/wx-config --inplace --prefix=$RPM_BUILD_ROOT%{wxpref}" \
build build
#---------------------------------------------------------------- #----------------------------------------------------------------
%install %install
%find_lang wxstd [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
cd wxPython
# install wxWindows
WXDIR=`pwd`
cd build
make prefix=$RPM_BUILD_ROOT%{wxpref} install
# install wxPython
cd $WXDIR/wxPython
%{python} setup.py \ %{python} setup.py \
IN_CVS_TREE=1 \ IN_CVS_TREE=1 \
NO_SCRIPTS=1 \ NO_SCRIPTS=1 \
@@ -152,11 +147,11 @@ cd wxPython
--root=$RPM_BUILD_ROOT --root=$RPM_BUILD_ROOT
# Since I want this RPM to be as generic as possible I won't let # Since I want this RPM to be as generic as possible I won't let
# distutils copy the scripts, since it will mangle the #! line # distutils copy the scripts since it will mangle the #! line to use
# to use the real python pathname. Since some distros install # the real python pathname. Since some distros install python 2.2 as
# python 2.2 as python2 and others as python, then I can't let # python2 and others as python, then I can't let distutils do that
# it do that otherwise the dependencies will be fouled up. Copy # otherwise the dependencies will be fouled up. Copy them manually
# them manually instead: # instead, leaving the #!/bin/env line intact:
mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/bin
for s in \ for s in \
@@ -170,6 +165,30 @@ for s in \
done done
# Generate the filelists. For some reason the %defattr below is still
# resulting in many (but not all) files not owned by root when just
# specifying directories and wildcards to be included in each package.
# So instead we'll build some explicit filelists here and use %attr on
# each entry.
cd $WXDIR
mkdir -p $RPM_BUILD_ROOT%{pref}/share/doc
GFL="%{python} wxPython/distrib/genfilelist.py"
$GFL $RPM_BUILD_ROOT %{pref} > FILELIST
$GFL -r $RPM_BUILD_ROOT %{pref}/bin >> FILELIST
$GFL $RPM_BUILD_ROOT %{pref}/lib >> FILELIST
$GFL -r $RPM_BUILD_ROOT %{pref}/lib/python%{pyver} >> FILELIST
$GFL -r $RPM_BUILD_ROOT %{pref}/share >> FILELIST
$GFL $RPM_BUILD_ROOT %{wxpref} >> FILELIST
$GFL $RPM_BUILD_ROOT %{wxpref}/lib >> FILELIST
$GFL $RPM_BUILD_ROOT "%{wxpref}/lib/libwx*" >> FILELIST
$GFL -r $RPM_BUILD_ROOT %{wxpref}/share >> FILELIST
$GFL -r $RPM_BUILD_ROOT %{pref}/share >> FILELIST
$GFL $RPM_BUILD_ROOT %{wxpref}/include > DEVELLIST
$GFL -r $RPM_BUILD_ROOT %{wxpref}/include/wx >> DEVELLIST
$GFL -r $RPM_BUILD_ROOT %{wxpref}/lib/wx >> DEVELLIST
$GFL $RPM_BUILD_ROOT %{wxconfigname} >> DEVELLIST
$GFL $RPM_BUILD_ROOT %{wxpref}/bin/wx-config >> DEVELLIST
#---------------------------------------------------------------- #----------------------------------------------------------------
@@ -178,37 +197,15 @@ done
#---------------------------------------------------------------- #----------------------------------------------------------------
%post
/sbin/ldconfig
%files -f FILELIST
#----------------------------------------------------------------
%postun
/sbin/ldconfig
#----------------------------------------------------------------
%files
%doc docs/preamble.txt
%doc docs/licence.txt
%doc docs/readme.txt
%doc docs/changes.txt
%doc wxPython/README.txt
%doc wxPython/CHANGES.txt
%defattr(-,root,root) %defattr(-,root,root)
%{wxpref}/lib/libwx* %doc docs/preamble.txt docs/licence.txt docs/readme.txt docs/changes.txt
%{pref}/lib/python* %doc wxPython/README.txt wxPython/CHANGES.txt
%{wxpref}/share/
%{pref}/bin/*
%files devel %files -n wxPython%{port}-devel -f DEVELLIST
%defattr(-,root,root) %defattr(-,root,root)
%{wxpref}/include/wx
%{wxpref}/lib/wx
%{wxconfigname}
%{wxpref}/bin/wx-config
#---------------------------------------------------------------- #----------------------------------------------------------------