forked from pool/python-pyramid
Accepting request 283948 from home:TheBlackCat:branches:devel:languages:python
+- Update year +- Implement update-alternatives for compatibility with an unpcoming + python 3 version +- Removed dependencies that are not longer needed. OBS-URL: https://build.opensuse.org/request/show/283948 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyramid?expand=0&rev=17
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pyramid
|
||||
#
|
||||
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@@ -26,8 +26,6 @@ License: BSD-4-Clause and ZPL-2.1 and MIT
|
||||
Group: Development/Languages/Python
|
||||
Source: http://pypi.python.org/packages/source/p/pyramid/pyramid-%{version}.tar.gz
|
||||
Patch1: fix_mimetype_tests.patch
|
||||
Requires: python-Chameleon >= 1.2.3
|
||||
Requires: python-Mako >= 0.3.6
|
||||
Requires: python-PasteDeploy >= 1.5.0
|
||||
Requires: python-WebOb >= 1.3.1
|
||||
Requires: python-repoze.lru >= 0.4
|
||||
@@ -36,8 +34,6 @@ Requires: python-venusian >= 1.0a3
|
||||
Requires: python-zope.deprecation >= 3.5.0
|
||||
Requires: python-zope.interface >= 3.8.0
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-Chameleon >= 1.2.3
|
||||
BuildRequires: python-Mako >= 0.3.6
|
||||
BuildRequires: python-PasteDeploy >= 1.5.0
|
||||
BuildRequires: python-WebOb >= 1.3.1
|
||||
BuildRequires: python-repoze.lru >= 0.4
|
||||
@@ -57,7 +53,8 @@ BuildRequires: python-coverage
|
||||
BuildRequires: python-nose
|
||||
BuildRequires: python-zope.component >= 3.11.0
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
BuildRequires: python-ordereddict
|
||||
@@ -97,20 +94,81 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
rm -rf %{buildroot}%{python_sitelib}/pyramid/tests # Big, hidden files, fdupes -> don't package
|
||||
%fdupes %{buildroot}%{python_sitelib}
|
||||
|
||||
# move executables to python-specific names
|
||||
mv %{buildroot}%{_bindir}/pcreate %{buildroot}%{_bindir}/pcreate-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/pdistreport %{buildroot}%{_bindir}/pdistreport-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/prequest %{buildroot}%{_bindir}/prequest-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/proutes %{buildroot}%{_bindir}/proutes-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/pserve %{buildroot}%{_bindir}/pserve-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/pshell %{buildroot}%{_bindir}/pshell-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/ptweens %{buildroot}%{_bindir}/ptweens-%{py_ver}
|
||||
mv %{buildroot}%{_bindir}/pviews %{buildroot}%{_bindir}/pviews-%{py_ver}
|
||||
|
||||
# Prepare for update-alternatives usage
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/pcreate
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/pdistreport
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/prequest
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/proutes
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/pserve
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/pshell
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/ptweens
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/pviews
|
||||
ln -s -f %{_sysconfdir}/alternatives/pcreate %{buildroot}%{_bindir}/pcreate
|
||||
ln -s -f %{_sysconfdir}/alternatives/pdistreport %{buildroot}%{_bindir}/pdistreport
|
||||
ln -s -f %{_sysconfdir}/alternatives/prequest %{buildroot}%{_bindir}/prequest
|
||||
ln -s -f %{_sysconfdir}/alternatives/proutes %{buildroot}%{_bindir}/proutes
|
||||
ln -s -f %{_sysconfdir}/alternatives/pserve %{buildroot}%{_bindir}/pserve
|
||||
ln -s -f %{_sysconfdir}/alternatives/pshell %{buildroot}%{_bindir}/pshell
|
||||
ln -s -f %{_sysconfdir}/alternatives/ptweens %{buildroot}%{_bindir}/ptweens
|
||||
ln -s -f %{_sysconfdir}/alternatives/pviews %{buildroot}%{_bindir}/pviews
|
||||
|
||||
%check
|
||||
LANG=en_US.UTF-8 python setup.py nosetests --with-coverage -vvv
|
||||
|
||||
%post
|
||||
update-alternatives \
|
||||
--install %{_bindir}/pcreate pcreate %{_bindir}/pcreate-%{py_ver} 30 \
|
||||
--slave %{_bindir}/pdistreport pdistreport %{_bindir}/pdistreport-%{py_ver} \
|
||||
--slave %{_bindir}/prequest prequest %{_bindir}/prequest-%{py_ver} \
|
||||
--slave %{_bindir}/proutes proutes %{_bindir}/proutes-%{py_ver} \
|
||||
--slave %{_bindir}/pserve pserve %{_bindir}/pserve-%{py_ver} \
|
||||
--slave %{_bindir}/pshell pshell %{_bindir}/pshell-%{py_ver} \
|
||||
--slave %{_bindir}/ptweens ptweens %{_bindir}/ptweens-%{py_ver} \
|
||||
--slave %{_bindir}/pviews pviews %{_bindir}/pviews-%{py_ver}
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
update-alternatives --remove pcreate %{_bindir}/pcreate-%{py_ver}
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc *.txt *.rst
|
||||
%{_bindir}/pcreate
|
||||
%{_bindir}/pdistreport
|
||||
%{_bindir}/prequest
|
||||
%{_bindir}/proutes
|
||||
%{_bindir}/pserve
|
||||
%{_bindir}/pshell
|
||||
%{_bindir}/ptweens
|
||||
%{_bindir}/pviews
|
||||
%{_bindir}/pdistreport
|
||||
%{_bindir}/pcreate-%{py_ver}
|
||||
%{_bindir}/pdistreport-%{py_ver}
|
||||
%{_bindir}/prequest-%{py_ver}
|
||||
%{_bindir}/proutes-%{py_ver}
|
||||
%{_bindir}/pserve-%{py_ver}
|
||||
%{_bindir}/pshell-%{py_ver}
|
||||
%{_bindir}/ptweens-%{py_ver}
|
||||
%{_bindir}/pviews-%{py_ver}
|
||||
%ghost %{_sysconfdir}/alternatives/pcreate
|
||||
%ghost %{_sysconfdir}/alternatives/pdistreport
|
||||
%ghost %{_sysconfdir}/alternatives/prequest
|
||||
%ghost %{_sysconfdir}/alternatives/proutes
|
||||
%ghost %{_sysconfdir}/alternatives/pserve
|
||||
%ghost %{_sysconfdir}/alternatives/pshell
|
||||
%ghost %{_sysconfdir}/alternatives/ptweens
|
||||
%ghost %{_sysconfdir}/alternatives/pviews
|
||||
%{python_sitelib}/*
|
||||
|
||||
%files doc
|
||||
|
Reference in New Issue
Block a user