Accepting request 419496 from home:TheBlackCat:branches:devel:languages:python
Fix update-alternatives implementation. OBS-URL: https://build.opensuse.org/request/show/419496 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=33
This commit is contained in:
parent
dab137dc49
commit
fbedd339a7
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com
|
||||
|
||||
- Fix update-alternatives implementation.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 29 02:14:00 UTC 2014 - Led <ledest@gmail.com>
|
||||
|
||||
|
@ -37,7 +37,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Requires(preun): update-alternatives
|
||||
|
||||
%description
|
||||
Docutils is a modular system for processing documentation into useful formats,
|
||||
@ -60,25 +60,19 @@ python setup.py build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
|
||||
# Prepare for update-alternatives usage
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
binaries="rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html"
|
||||
for i in $binaries; do
|
||||
ln -s %{_bindir}/${i}-%{py_ver} %{buildroot}%{_bindir}/${i}
|
||||
for p in $binaries ; do
|
||||
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
|
||||
done
|
||||
|
||||
%check
|
||||
nosetests
|
||||
|
||||
%pre
|
||||
# Since binaries became ghosted to be used with update-alternatives,
|
||||
# we have to get rid of the old binary resulting from the
|
||||
# non-update-alternativies-ified package.
|
||||
for i in rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html; do
|
||||
[ -L %_bindir/$i ] || rm -f %_bindir/$i
|
||||
done
|
||||
exit 0
|
||||
|
||||
%post
|
||||
update-alternatives \
|
||||
%_sbindir/update-alternatives \
|
||||
--install %{_bindir}/rst2html rst2html %{_bindir}/rst2html-%{py_ver} 20 \
|
||||
--slave %{_bindir}/rst2latex rst2latex %{_bindir}/rst2latex-%{py_ver} \
|
||||
--slave %{_bindir}/rst2man rst2man %{_bindir}/rst2man-%{py_ver} \
|
||||
@ -92,23 +86,42 @@ update-alternatives \
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
update-alternatives --remove rst2html %{_bindir}/rst2html-%{py_ver}
|
||||
%_sbindir/update-alternatives --remove rst2html %{_bindir}/rst2html-%{py_ver}
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* licenses
|
||||
%ghost %{_bindir}/rst2html
|
||||
%ghost %{_bindir}/rst2latex
|
||||
%ghost %{_bindir}/rst2man
|
||||
%ghost %{_bindir}/rst2odt
|
||||
%ghost %{_bindir}/rst2odt_prepstyles
|
||||
%ghost %{_bindir}/rst2pseudoxml
|
||||
%ghost %{_bindir}/rst2s5
|
||||
%ghost %{_bindir}/rst2xetex
|
||||
%ghost %{_bindir}/rst2xml
|
||||
%ghost %{_bindir}/rstpep2html
|
||||
%{_bindir}/rst*-%{py_ver}
|
||||
%{_bindir}/rst2html
|
||||
%{_bindir}/rst2latex
|
||||
%{_bindir}/rst2man
|
||||
%{_bindir}/rst2odt
|
||||
%{_bindir}/rst2odt_prepstyles
|
||||
%{_bindir}/rst2pseudoxml
|
||||
%{_bindir}/rst2s5
|
||||
%{_bindir}/rst2xetex
|
||||
%{_bindir}/rst2xml
|
||||
%{_bindir}/rstpep2html
|
||||
%{_bindir}/rst2html-%{py_ver}
|
||||
%{_bindir}/rst2latex-%{py_ver}
|
||||
%{_bindir}/rst2man-%{py_ver}
|
||||
%{_bindir}/rst2odt-%{py_ver}
|
||||
%{_bindir}/rst2odt_prepstyles-%{py_ver}
|
||||
%{_bindir}/rst2pseudoxml-%{py_ver}
|
||||
%{_bindir}/rst2s5-%{py_ver}
|
||||
%{_bindir}/rst2xetex-%{py_ver}
|
||||
%{_bindir}/rst2xml-%{py_ver}
|
||||
%{_bindir}/rstpep2html-%{py_ver}
|
||||
%ghost %{_sysconfdir}/alternatives/rst2html
|
||||
%ghost %{_sysconfdir}/alternatives/rst2latex
|
||||
%ghost %{_sysconfdir}/alternatives/rst2man
|
||||
%ghost %{_sysconfdir}/alternatives/rst2odt
|
||||
%ghost %{_sysconfdir}/alternatives/rst2odt_prepstyles
|
||||
%ghost %{_sysconfdir}/alternatives/rst2pseudoxml
|
||||
%ghost %{_sysconfdir}/alternatives/rst2s5
|
||||
%ghost %{_sysconfdir}/alternatives/rst2xetex
|
||||
%ghost %{_sysconfdir}/alternatives/rst2xml
|
||||
%ghost %{_sysconfdir}/alternatives/rstpep2html
|
||||
%{python_sitelib}/docutils/
|
||||
%{python_sitelib}/docutils-%{version}-py%{py_ver}.egg-info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user