Thanks to Mohd Izhar Firdaus Ismail for the following:
- 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
This commit is contained in:
parent
4b770e6d9e
commit
7280caa3d3
7 changed files with 62 additions and 104 deletions
|
|
@ -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 @@
|
||||
[
|
||||
<!ENTITY % version SYSTEM "xml/version.xml">
|
||||
%version;
|
||||
-<!ENTITY common "../common">
|
||||
-<!ENTITY buildcommon SYSTEM "../common/build_common.xml">
|
||||
+<!ENTITY common "xml/common">
|
||||
+<!ENTITY buildcommon SYSTEM "xml/common/build_common.xml">
|
||||
--- 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 @@
|
||||
<!ENTITY common "../common">
|
||||
<!ENTITY buildcommon SYSTEM "../common/build_common.xml">
|
||||
]>
|
||||
-<project name="diveintopython" default="html" basedir=".">
|
||||
+<project name="diveintopython" default="all" basedir=".">
|
||||
|
|
|
|||
|
|
@ -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 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
-"../../common/docbook/dtd/docbookx.dtd"
|
||||
+"common/docbook/dtd/docbookx.dtd"
|
||||
[
|
||||
<!--
|
||||
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Dive Into Python - pdf
|
||||
Name=Dive Into Python
|
||||
Comment=Open Dive Into Python book
|
||||
Exec=xdg-open /usr/share/doc/diveintopython/diveintopython.pdf
|
||||
Icon=diveintopython
|
||||
Exec=xdg-open @DOCDIR@/pdf/diveintopython.pdf
|
||||
Icon=gnome-mime-application-pdf
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Application;Development;
|
||||
Binary file not shown.
|
|
@ -1,33 +1,39 @@
|
|||
Name: diveintopython
|
||||
Version: 5.4
|
||||
Release: 8%{?dist}
|
||||
Release: 10%{?dist}
|
||||
|
||||
Summary: Dive into Python - a python book
|
||||
|
||||
Group: Documentation
|
||||
License: GFDL
|
||||
URL: http://www.diveintopython.org
|
||||
Source0: http://www.diveintopython.org/download/%{name}-xml-%{version}.zip
|
||||
Source1: %{name}.png
|
||||
Source2: http://www.diveintopython.org/download/%{name}-common-%{version}.zip
|
||||
Source3: %{name}.desktop
|
||||
Patch0: make.sh.patch
|
||||
Patch1: diveintopython.xml.patch
|
||||
Patch2: diveintopython-build.xml.patch
|
||||
Patch3: diveintopython-index.xml.patch
|
||||
Source0: http://www.diveintopython.org/download/%{name}-common-%{version}.zip
|
||||
Source1: http://www.diveintopython.org/download/%{name}-xml-%{version}.zip
|
||||
Source2: %{name}.desktop.in
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildArch: noarch
|
||||
Requires: diveintopython-pdf
|
||||
Patch0: diveintopython-build.xml.patch
|
||||
|
||||
BuildRequires: desktop-file-utils, ant, htmldoc, python, w3m
|
||||
BuildRequires: desktop-file-utils, htmldoc,
|
||||
BuildRequires: python, w3m
|
||||
%if 0%{?fedora} >= 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 <mohd.izhar.firdaus@gmail.com> - 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 <marc@mwiriadi.id.au> - 5.4-8
|
||||
- Removed multiple desktop-files
|
||||
- Made the default version the pdf version
|
||||
|
|
|
|||
|
|
@ -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 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
-"../../common/docbook/dtd/docbookx.dtd"
|
||||
+"common/docbook/dtd/docbookx.dtd"
|
||||
[
|
||||
<!ENTITY % entities SYSTEM "entities.xml">
|
||||
%entities;
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue