diff --git a/diveintopython-build.xml.patch b/diveintopython-build.xml.patch index 40259c3..e3da6f5 100644 --- a/diveintopython-build.xml.patch +++ b/diveintopython-build.xml.patch @@ -1,13 +1,8 @@ ---- diveintopython-5.4/build.xml 2002-07-28 16:27:46.000000000 +0800 -+++ build.xml 2008-01-04 01:00:53.000000000 +0900 -@@ -3,10 +3,10 @@ - [ - - %version; -- -- -+ -+ +--- old/build.xml 2008-01-23 23:06:01.000000000 +0800 ++++ new/build.xml 2008-01-23 23:06:14.000000000 +0800 +@@ -6,7 +6,7 @@ + + ]> - + diff --git a/diveintopython-index.xml.patch b/diveintopython-index.xml.patch deleted file mode 100644 index 57b7b97..0000000 --- a/diveintopython-index.xml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- diveintopython-5.4/xml/index.xml 2004-05-05 11:10:00.000000000 +0800 -+++ index.xml 2008-01-04 01:01:34.000000000 +0900 -@@ -1,6 +1,6 @@ - - = 8 -BuildRequires: java-1.7.0-icedtea-devel +BuildRequires: java-1.7.0-icedtea %else -BuildRequires: java-1.5.0-gcj-devel +BuildRequires: java-1.5.0-gcj %endif %description Dive Into Python is a Python book for experienced programmers. +%package pdf +Summary: Dive into Python - a python book +Group: Documentation +%description pdf +Dive Into Python is a Python book for experienced programmers. +The PDF version + %package html Summary: Dive into Python - a python book Group: Documentation @@ -50,93 +56,76 @@ Dive Into Python is a Python book for experienced programmers. The text version %prep -%setup -q -a 2 html -mv %{name}-%{version}/common xml/ -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -rm -f make.bat +%setup -q -b 1 +%patch0 -p1 -b .build-all +mkdir build +mv xml make.sh build.xml build/ %build +pushd build /bin/sh make.sh +popd %install rm -rf $RPM_BUILD_ROOT +pushd build/dist +#cleanup unnecessary duplicates +rm -rf pdf/*.png pdf/*.html pdf/images/ +rm -rf txt/*.html -install -m 0644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/pixmaps/diveintopython.png -# Install html version -mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython-html -pushd dist/html/ -find . -type d -exec mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython-html/'{}' \; +#install the files +find . -type d -exec mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/'{}' \; for DIR in * ; do - find $DIR -type f -exec install -m 0644 '{}' $RPM_BUILD_ROOT%{_docdir}/diveintopython-html/${DIR}/ \; + find $DIR -type f -exec install -m 0644 '{}' $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/${DIR}/ \; done -install -m 0644 diveintopython.css $RPM_BUILD_ROOT%{_docdir}/diveintopython-html/diveintopython.css -install -m 0644 history.xml $RPM_BUILD_ROOT%{_docdir}/diveintopython-html/history.xml -install -m 0644 index.html $RPM_BUILD_ROOT%{_docdir}/diveintopython-html/index.html popd -# Install pdf version -pushd dist/pdf/ -mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython -find . -type d -exec mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython/'{}' \; -for DIR in * ; do - find $DIR -type f -exec install -m 0644 '{}' $RPM_BUILD_ROOT%{_docdir}/diveintopython/${DIR}/ \; -done -install -m 0644 diveintopython.html $RPM_BUILD_ROOT%{_docdir}/diveintopython/diveintopython.html -install -m 0644 diveintopython.pdf $RPM_BUILD_ROOT%{_docdir}/diveintopython/diveintopython.pdf -popd +#install desktop file +mkdir ${RPM_BUILD_ROOT}%{_datadir}/applications/ +cat %{SOURCE2}|sed "s|@DOCDIR@|%{_docdir}/%{name}-%{version}/|g" > ${RPM_BUILD_ROOT}%{_datadir}/applications/diveintopython.desktop -# Install single html page -pushd dist/htmlflat/ -mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython-single-html -find . -type d -exec mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython-single-html/'{}' \; -for DIR in * ; do - find $DIR -type f -exec install -m 0644 '{}' $RPM_BUILD_ROOT%{_docdir}/diveintopython-single-html/${DIR}/ \; -done -install -m 0644 diveintopython.html $RPM_BUILD_ROOT%{_docdir}/diveintopython-single-html/diveintopython.html -install -m 0644 diveintopython.css $RPM_BUILD_ROOT%{_docdir}/diveintopython-single-html/diveintopython.css -popd - -# Install text version -pushd dist/txt/ -mkdir -p $RPM_BUILD_ROOT%{_docdir}/diveintopython-txt -install -m 0644 diveintopython.html $RPM_BUILD_ROOT%{_docdir}/diveintopython-txt/diveintopython.html -install -m 0644 diveintopython.txt $RPM_BUILD_ROOT%{_docdir}/diveintopython-txt/diveintopython.txt -popd - -# pdf desktop file desktop-file-install --vendor="fedora" \ + --delete-original \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ --add-category="Documentation" \ - %{SOURCE3} - + ${RPM_BUILD_ROOT}%{_datadir}/applications/diveintopython.desktop %clean rm -rf $RPM_BUILD_ROOT +%files +%defattr(-,root,root,-) %files html %defattr(-,root,root,-) -%doc %{_docdir}/diveintopython-html/ +%doc %{_docdir}/%{name}-%{version}/html -%files +%files pdf %defattr(-,root,root,-) -%doc %{_docdir}/diveintopython/ +%doc %{_docdir}/%{name}-%{version}/pdf %{_datadir}/applications/fedora-diveintopython.desktop -%{_datadir}/pixmaps/diveintopython.png %files single-html %defattr(-,root,root,-) -%doc %{_docdir}/diveintopython-single-html/ +%doc %{_docdir}/%{name}-%{version}/htmlflat %files txt %defattr(-,root,root,-) -%doc %{_docdir}/diveintopython-txt/ +%doc %{_docdir}/%{name}-%{version}/txt %changelog +* Wed Jan 23 2008 Mohd Izhar Firdaus Ismail - 5.4-10 +- Major cleanup of spec to be less complex +- Made the packaging less diverted from the generated tree from upstream build script +- Changed desktop file to use pdf mimetype icon as diveintopython.png is corrupted + even in upstream zip file +- Removed unnecessary patches +- Removed builreq ant as upstream make.sh uses upstream provided jars (we might want to + use ant from fedora repo, todo: investigate possibility of patching make.sh and adding + more java buildreqs for this) +- Switched diveintopython to be a metapackage which pulls diveintopython-pdf + * Sat Jan 19 2008 Marc Wiriadisastra - 5.4-8 - Removed multiple desktop-files - Made the default version the pdf version diff --git a/diveintopython.xml.patch b/diveintopython.xml.patch deleted file mode 100644 index 0cbafc4..0000000 --- a/diveintopython.xml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- diveintopython-5.4/xml/diveintopython.xml 2004-05-05 17:24:52.000000000 +0800 -+++ diveintopython.xml 2008-01-02 18:01:08.000000000 +0900 -@@ -1,6 +1,6 @@ - - - %entities; diff --git a/make.sh.patch b/make.sh.patch deleted file mode 100644 index c4985a1..0000000 --- a/make.sh.patch +++ /dev/null @@ -1,6 +0,0 @@ ---- diveintopython-5.4/make.sh 2002-02-21 13:45:50.000000000 +0800 -+++ make.sh 2008-01-02 17:58:58.000000000 +0900 -@@ -1,2 +1,2 @@ - #! /bin/sh --java -classpath "../common/lib/ant.jar:../common/lib/optional.jar:../common/lib/NetComponents.jar:../common/lib/jaxp.jar:../common/lib/crimson.jar" org.apache.tools.ant.Main $1 $2 $3 $4 $5 $6 $7 $8 $9 -+java -classpath "xml/common/lib/ant.jar:xml/common/lib/optional.jar:xml/common/lib/NetComponents.jar:xml/common/lib/jaxp.jar:xml/common/lib/crimson.jar" org.apache.tools.ant.Main $1 $2 $3 $4 $5 $6 $7 $8 $9