[python-ZODB3] - Filter out private shared library provides - Rearrage the documents - Exclude the tests from insta

cheeselee cheeselee at fedoraproject.org
Fri Sep 17 17:48:31 UTC 2010


commit d23d02fb22351a5997c9bec7e1ed699fd91e6e0d
Author: Robin Lee <robinlee.sysu at gmail.com>
Date:   Sat Sep 18 01:47:51 2010 +0800

    - Filter out private shared library provides
    - Rearrage the documents
    - Exclude the tests from installation

 python-ZODB3.spec |   51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 48 insertions(+), 3 deletions(-)
---
diff --git a/python-ZODB3.spec b/python-ZODB3.spec
index 5865e68..d4ea5f3 100644
--- a/python-ZODB3.spec
+++ b/python-ZODB3.spec
@@ -1,8 +1,13 @@
 %global prerel b6
 
+# Filter private shared library provides
+%filter_provides_in %{python_sitearch}/BTrees/.*\.so$
+%filter_provides_in %{python_sitearch}/persistent/.*\.so$
+%filter_setup
+
 Name:           python-ZODB3
 Version:        3.10.0
-Release:        0.3.%{prerel}%{?dist}
+Release:        0.4.%{prerel}%{?dist}
 Summary:        Zope Object Database: Object Database and Persistence
 Group:          Development/Libraries
 License:        ZPLv2.1
@@ -11,6 +16,8 @@ Source0:        http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-%{version}%
 
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
+# need for tests, not yet in Fedora
+#BuildRequires: python-manuel
 Requires:       python-setuptools
 Requires:       python-transaction
 Requires:       python-zc-lockfile
@@ -53,25 +60,63 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
 
 %install
 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+pushd $RPM_BUILD_ROOT%{python_sitearch}
 # remove contained source files
-find $RPM_BUILD_ROOT%{python_sitearch} \( -name '*.c' -o -name '*.h' \) -type f -print0 | xargs -0 rm -fv
+find . \( -name '*.c' -o -name '*.h' \) -type f -print0 | xargs -0 rm -fv
+
+# deal with documents
+mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/
+DOCDIR=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/
+for FILE in `find . -name '*.txt'`; do
+  DIR=${FILE%/*.*}
+  # If a file in */tests/ directory, move it to an upper one.
+  DIR=${DIR%/tests}
+  # Don't move the files in the egg info directory
+  if echo $DIR| grep -v egg-info >/dev/null; then
+     if [ $DIR != . -a ! -d $DOCDIR$DIR ]; then
+        mkdir -p $DOCDIR$DIR
+     fi
+     if [ ! -e $DOCDIR$DIR/${FILE##.*/} ]; then
+        mv $FILE $DOCDIR$DIR
+     else
+        echo "name conflicts occurs in documentation"
+        exit 1
+     fi
+  fi
+done
 
+popd
+
+cp -p COPYRIGHT.txt LICENSE.txt HISTORY.txt README.txt doc/* $DOCDIR
 
 %files
 %defattr(-,root,root,-)
-%doc COPYRIGHT.txt LICENSE.txt HISTORY.txt README.txt doc/*
+%{_docdir}/%{name}-%{version}/
 %{python_sitearch}/ZODB/
+%exclude %{python_sitearch}/ZODB/tests/
+%exclude %{python_sitearch}/ZODB/scripts/tests/
+%exclude %{python_sitearch}/ZODB/FileStorage/tests.py*
 %{python_sitearch}/ZODB3-*.egg-info
 %{_bindir}/*
 %{python_sitearch}/BTrees/
+%exclude %{python_sitearch}/BTrees/tests/
 %{python_sitearch}/persistent/
+%exclude %{python_sitearch}/persistent/tests/
 %{python_sitearch}/ZEO/
+%exclude %{python_sitearch}/ZEO/tests/
+%exclude %{python_sitearch}/ZEO/scripts/tests.py*
 
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/python?.?/ZODB3
 
 %changelog
+* Sat Sep 18 2010 Robin Lee <robinlee.sysu at gmail.com> - 3.10.0-0.4.b6
+- Filter out private shared library provides
+- Rearrage the documents
+- Exclude the tests from installation
+
 * Thu Sep  9 2010 Robin Lee <robinlee.sysu at gmail.com> - 3.10.0-0.3.b6
 - Update to 3.10.0b6
 - An unused line of comment removed


More information about the scm-commits mailing list