From 93f2babbcc5790ceeddee3e0b524c392f0e18d32 Mon Sep 17 00:00:00 2001 From: Toshio くらとみ Date: Apr 12 2010 19:25:44 +0000 Subject: - Fixes so this spec file will also build on EL-5 - define => global --- diff --git a/bzr-old-sphinx.patch b/bzr-old-sphinx.patch new file mode 100644 index 0000000..055d87f --- /dev/null +++ b/bzr-old-sphinx.patch @@ -0,0 +1,95 @@ +=== modified file 'doc/en/Makefile' +--- doc/en/Makefile 2009-09-08 12:33:30 +0000 ++++ doc/en/Makefile 2010-03-25 10:09:32 +0000 +@@ -11,6 +11,22 @@ + PAPEROPT_letter = -D latex_paper_size=letter + ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + ++# Note that this assumes name of the output dir is same as name of the rule. ++define make_output_dirs ++# Create output directory (only needed for sphinx < 0.5) ++[ -d _build ] || mkdir _build ++[ -d "_build/$@" ] || mkdir "_build/$@" ++# Workaround for a bug in sphinx < 0.5 where it tries to delete ++# nonexistent static dirs and does not catch the exception. This was ++# fixed in svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x ++# at r65551 and merged as 280b62246342 in hg branch released as 0.5. ++[ -d "_build/$@/_static" ] || mkdir "_build/$@/_static" ++for fn in _static/*; do \ ++ [ ! -d "$$fn" ] && continue; \ ++ [ -d "_build/$@/$$fn" ] || mkdir "_build/$@/$$fn"; \ ++done ++endef ++ + .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + + help: +@@ -30,32 +46,38 @@ + -rm -rf _build/* + + html: ++ $(make_output_dirs) + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html + @echo + @echo "Build finished. The HTML pages are in _build/html." + + dirhtml: ++ $(make_output_dirs) + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml + @echo + @echo "Build finished. The HTML pages are in _build/dirhtml." + + pickle: ++ $(make_output_dirs) + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle + @echo + @echo "Build finished; now you can process the pickle files." + + json: ++ $(make_output_dirs) + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json + @echo + @echo "Build finished; now you can process the JSON files." + + htmlhelp: ++ $(make_output_dirs) + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in _build/htmlhelp." + + qthelp: ++ $(make_output_dirs) + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ +@@ -65,6 +87,7 @@ + @echo "# assistant -collectionFile _build/qthelp/Bazaar.qhc" + + latex: ++ $(make_output_dirs) + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex + @echo + @echo "Build finished; the LaTeX files are in _build/latex." +@@ -72,17 +95,20 @@ + "run these through (pdf)latex." + + changes: ++ $(make_output_dirs) + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes + @echo + @echo "The overview file is in _build/changes." + + linkcheck: ++ $(make_output_dirs) + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in _build/linkcheck/output.txt." + + doctest: ++ $(make_output_dirs) + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in _build/doctest/output.txt." + diff --git a/bzr.spec b/bzr.spec index f53c2ec..15dc18f 100644 --- a/bzr.spec +++ b/bzr.spec @@ -1,4 +1,8 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +# It's not strictly necessary to conditionalize this but it's a reminder of +# when it can go away +%if 0%{?fedora} < 13 && 0%{?rhel} < 6 +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%endif # All package versioning is found here: # the actual version is composed from these below, including leading 0 for release candidates @@ -6,13 +10,13 @@ # Version: bzr version, add subrelease version here # bzrrc: release candidate version, if any, line starts with % for rc, # for stable releas (no %). # release: rpm subrelease (0.N for rc candidates, N for stable releases) -%define bzrmajor 2.2 -#define bzrminor .0 -%define bzrrc b1 -%define release 0.2 +%global bzrmajor 2.2 +#global bzrminor .0 +%global bzrrc b1 +%global release 0.2 # Magics to get the dots in Release string correct per the above -%define subrelease %{?bzrrc:.}%{?bzrrc} +%global subrelease %{?bzrrc:.}%{?bzrrc} Name: bzr Version: %{bzrmajor}%{?bzrminor} @@ -24,6 +28,7 @@ License: GPLv2+ URL: http://www.bazaar-vcs.org/ Source0: https://launchpad.net/%{name}/%{bzrmajor}/%{version}%{?bzrrc}/+download/%{name}-%{version}%{?bzrrc}.tar.gz Source1: https://launchpad.net/%{name}/%{bzrmajor}/%{version}%{?bzrrc}/+download/%{name}-%{version}%{?bzrrc}.tar.gz.sig +Patch0: bzr-old-sphinx.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel zlib-devel @@ -35,6 +40,12 @@ BuildRequires: python-sphinx Requires: python-paramiko # Workaround Bug #230223 otherwise this would be a soft dependency Requires: python-pycurl +# ElementTree is part of python2.5 on FC7+ +# This is also needed for EL-5 +%if 0%{?fedora} <= 6 +BuildRequires: python-elementtree +Requires: python-elementtree +%endif %description Bazaar is a distributed revision control system that is powerful, friendly, @@ -54,6 +65,8 @@ This package contains the documentation for the Bazaar version control system. %prep %setup -q -n %{name}-%{version}%{?bzrrc} +%patch0 -p0 -b .oldsphinx + sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/_patiencediff_py.py sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/weave.py @@ -69,8 +82,7 @@ make docs-sphinx %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install --skip-build --install-data %{_datadir} --root $RPM_BUILD_ROOT -chmod 0644 contrib/bzr_access -chmod 0644 contrib/bzr_ssh_path_limiter +chmod -R a+rX contrib chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/bzrlib/*.so install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/ @@ -92,9 +104,9 @@ for dir in *; do cp -R $dir/_build/html $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir rm -f $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir/.buildinfo rm -f $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir/_static/$dir/Makefile - find $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir -name '*.pdf' | while read pdf; do - ln $pdf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/pdf/ - done + find $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir -name '*.pdf' | while read pdf; do + ln $pdf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/pdf/ + done fi done cd .. @@ -110,13 +122,20 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %{python_sitearch}/bzrlib/ %{_sysconfdir}/bash_completion.d/ + +%if 0%{?fedora} > 8 || 0%{?rhel} > 5 %{python_sitearch}/*.egg-info +%endif %files doc %defattr(-,root,root,-) %doc %{_defaultdocdir}/%{name}-doc-%{version}/* %changelog +* Mon Apr 12 2010 Toshio Kuratomi - 2.2-0.2.b1 +- Fixes so this spec file will also build on EL-5 +- define => global + * Thu Apr 01 2010 Henrik Nordstrom - 2.2-0.1.b1 - Upstream 2.2b1 beta release