Implement update-alternatives in preparation for python 3 version OBS-URL: https://build.opensuse.org/request/show/338122 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Twisted?expand=0&rev=40
220 lines
8.9 KiB
RPMSpec
220 lines
8.9 KiB
RPMSpec
#
|
|
# spec file for package python-Twisted
|
|
#
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: python-Twisted
|
|
Version: 15.4.0
|
|
Release: 0
|
|
Url: http://twistedmatrix.com/
|
|
Summary: An asynchronous networking framework written in Python
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
Source: http://pypi.python.org/packages/source/T/Twisted/Twisted-%{version}.tar.bz2
|
|
# PATCH-FIX-UPSTREAM -- https://twistedmatrix.com/trac/ticket/6280
|
|
Patch0: lp1102685.diff
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: python-devel
|
|
BuildRequires: python-pam
|
|
BuildRequires: python-pyOpenSSL
|
|
BuildRequires: python-pyserial
|
|
BuildRequires: python-setuptools
|
|
BuildRequires: python-zope.interface
|
|
Requires: python-pam
|
|
Requires: python-pyOpenSSL
|
|
Requires: python-pyasn1
|
|
Requires: python-pycrypto
|
|
Requires: python-pyserial
|
|
Requires: python-zope.interface
|
|
Provides: python-twisted = %{version}
|
|
Obsoletes: python-twisted < %{version}
|
|
Provides: python-twisted-core = %{version}
|
|
Obsoletes: python-twisted-core < %{version}
|
|
Provides: python-twisted-conch = %{version}
|
|
Obsoletes: python-twisted-conch < %{version}
|
|
Provides: python-twisted-lore < %{version}
|
|
Obsoletes: python-twisted-lore < %{version}
|
|
Provides: python-twisted-mail = %{version}
|
|
Obsoletes: python-twisted-mail < %{version}
|
|
Provides: python-twisted-names = %{version}
|
|
Obsoletes: python-twisted-names < %{version}
|
|
Provides: python-twisted-news = %{version}
|
|
Obsoletes: python-twisted-news < %{version}
|
|
Provides: python-twisted-runner = %{version}
|
|
Obsoletes: python-twisted-runner < %{version}
|
|
Provides: python-twisted-web = %{version}
|
|
Obsoletes: python-twisted-web < %{version}
|
|
Provides: python-twisted-words = %{version}
|
|
Obsoletes: python-twisted-words < %{version}
|
|
Provides: python-twisted-xish = %{version}
|
|
Obsoletes: python-twisted-xish < %{version}
|
|
Requires(post): update-alternatives
|
|
Requires(postun): update-alternatives
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
|
%endif
|
|
%description
|
|
An extensible framework for Python programming, with special focus
|
|
on event-based network programming and multiprotocol integration.
|
|
|
|
%package doc
|
|
Summary: An asynchronous networking framework written in Python - Documentation
|
|
Group: Development/Languages/Python
|
|
|
|
%description doc
|
|
An extensible framework for Python programming, with special focus
|
|
on event-based network programming and multiprotocol integration.
|
|
|
|
This package contains the documentation for python-Twisted
|
|
|
|
%prep
|
|
%setup -q -n Twisted-%{version}
|
|
%patch0 -p1
|
|
sed -i "1d" twisted/{mail/test/pop3testserver,trial/test/scripttest}.py
|
|
|
|
%build
|
|
CFLAGS="%{optflags}" python setup.py build
|
|
|
|
%install
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
|
find %{buildroot} -regex '.*\.[ch]' -exec rm {} ";" # Remove leftover C sources
|
|
install -dm0755 %{buildroot}/%{_mandir}/man1/
|
|
install -m0644 doc/*/man/*.1 %{buildroot}/%{_mandir}/man1/ # Install man pages
|
|
find doc -type f -print0 | xargs -0 chmod a-x # Fix doc-file dependency by removing x flags
|
|
sed -i "s/\r//" doc/_downloads/{MulticastClient,MulticastServer}.py
|
|
|
|
# Prepare for update-alternatives usage
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
for p in cftp ckeygen conch mailmail manhole pyhtmlizer tap2deb tap2rpm tkconch trial twistd ; do
|
|
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
|
|
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
|
|
# create a dummy target for /etc/alternatives/$p
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/$p
|
|
|
|
gzip %{buildroot}%{_mandir}/man1/$p.1
|
|
mv %{buildroot}%{_mandir}/man1/$p.1.gz %{buildroot}%{_mandir}/man1/$p-%{py_ver}.1.gz
|
|
ln -s -f %{_sysconfdir}/alternatives/$p.1.gz %{buildroot}%{_mandir}/man1/$p.1.gz
|
|
# create a dummy target for /etc/alternatives/$p.1.gz
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/$p.1.gz
|
|
done
|
|
|
|
%post
|
|
%_sbindir/update-alternatives \
|
|
--install %{_bindir}/twistd twistd %{_bindir}/twistd-%{py_ver} 30 \
|
|
--slave %{_bindir}/cftp cftp %{_bindir}/cftp-%{py_ver} \
|
|
--slave %{_bindir}/ckeygen ckeygen %{_bindir}/ckeygen-%{py_ver} \
|
|
--slave %{_bindir}/conch conch %{_bindir}/conch-%{py_ver} \
|
|
--slave %{_bindir}/mailmail mailmail %{_bindir}/mailmail-%{py_ver} \
|
|
--slave %{_bindir}/manhole manhole %{_bindir}/manhole-%{py_ver} \
|
|
--slave %{_bindir}/pyhtmlizer pyhtmlizer %{_bindir}/pyhtmlizer-%{py_ver} \
|
|
--slave %{_bindir}/tap2deb tap2deb %{_bindir}/tap2deb-%{py_ver} \
|
|
--slave %{_bindir}/tap2rpm tap2rpm %{_bindir}/tap2rpm-%{py_ver} \
|
|
--slave %{_bindir}/tkconch tkconch %{_bindir}/tkconch-%{py_ver} \
|
|
--slave %{_bindir}/trial trial %{_bindir}/trial-%{py_ver} \
|
|
--slave %{_mandir}/man1/twistd.1.gz twistd.1.gz %{_mandir}/man1/twistd-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/cftp.1.gz cftp.1.gz %{_mandir}/man1/cftp-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/ckeygen.1.gz ckeygen.1.gz %{_mandir}/man1/ckeygen-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/conch.1.gz conch.1.gz %{_mandir}/man1/conch-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/mailmail.1.gz mailmail.1.gz %{_mandir}/man1/mailmail-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/manhole.1.gz manhole.1.gz %{_mandir}/man1/manhole-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/pyhtmlizer.1.gz pyhtmlizer.1.gz %{_mandir}/man1/pyhtmlizer-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/tap2deb.1.gz tap2deb.1.gz %{_mandir}/man1/tap2deb-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/tap2rpm.1.gz tap2rpm.1.gz %{_mandir}/man1/tap2rpm-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/tkconch.1.gz tkconch.1.gz %{_mandir}/man1/ctkconchftp-%{py_ver}.1.gz \
|
|
--slave %{_mandir}/man1/trial.1.gz trial.1.gz %{_mandir}/man1/trial-%{py_ver}.1.gz
|
|
|
|
%postun
|
|
if [ $1 -eq 0 ] ; then
|
|
%_sbindir/update-alternatives --remove twistd %{_bindir}/twistd-%{py_ver}
|
|
fi
|
|
|
|
%files doc
|
|
%defattr(-,root,root,-)
|
|
%doc doc/*
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc LICENSE NEWS README
|
|
%{_bindir}/cftp
|
|
%{_bindir}/ckeygen
|
|
%{_bindir}/conch
|
|
%{_bindir}/mailmail
|
|
%{_bindir}/manhole
|
|
%{_bindir}/pyhtmlizer
|
|
%{_bindir}/tap2deb
|
|
%{_bindir}/tap2rpm
|
|
%{_bindir}/tkconch
|
|
%{_bindir}/trial
|
|
%{_bindir}/twistd
|
|
%{_bindir}/cftp-%{py_ver}
|
|
%{_bindir}/ckeygen-%{py_ver}
|
|
%{_bindir}/conch-%{py_ver}
|
|
%{_bindir}/mailmail-%{py_ver}
|
|
%{_bindir}/manhole-%{py_ver}
|
|
%{_bindir}/pyhtmlizer-%{py_ver}
|
|
%{_bindir}/tap2deb-%{py_ver}
|
|
%{_bindir}/tap2rpm-%{py_ver}
|
|
%{_bindir}/tkconch-%{py_ver}
|
|
%{_bindir}/trial-%{py_ver}
|
|
%{_bindir}/twistd-%{py_ver}
|
|
%{_mandir}/man1/cftp.1.gz
|
|
%{_mandir}/man1/ckeygen.1.gz
|
|
%{_mandir}/man1/conch.1.gz
|
|
%{_mandir}/man1/mailmail.1.gz
|
|
%{_mandir}/man1/manhole.1.gz
|
|
%{_mandir}/man1/pyhtmlizer.1.gz
|
|
%{_mandir}/man1/tap2deb.1.gz
|
|
%{_mandir}/man1/tap2rpm.1.gz
|
|
%{_mandir}/man1/tkconch.1.gz
|
|
%{_mandir}/man1/trial.1.gz
|
|
%{_mandir}/man1/twistd.1.gz
|
|
%{_mandir}/man1/cftp-%{py_ver}.1.gz
|
|
%{_mandir}/man1/ckeygen-%{py_ver}.1.gz
|
|
%{_mandir}/man1/conch-%{py_ver}.1.gz
|
|
%{_mandir}/man1/mailmail-%{py_ver}.1.gz
|
|
%{_mandir}/man1/manhole-%{py_ver}.1.gz
|
|
%{_mandir}/man1/pyhtmlizer-%{py_ver}.1.gz
|
|
%{_mandir}/man1/tap2deb-%{py_ver}.1.gz
|
|
%{_mandir}/man1/tap2rpm-%{py_ver}.1.gz
|
|
%{_mandir}/man1/tkconch-%{py_ver}.1.gz
|
|
%{_mandir}/man1/trial-%{py_ver}.1.gz
|
|
%{_mandir}/man1/twistd-%{py_ver}.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/cftp
|
|
%ghost %{_sysconfdir}/alternatives/ckeygen
|
|
%ghost %{_sysconfdir}/alternatives/conch
|
|
%ghost %{_sysconfdir}/alternatives/mailmail
|
|
%ghost %{_sysconfdir}/alternatives/manhole
|
|
%ghost %{_sysconfdir}/alternatives/pyhtmlizer
|
|
%ghost %{_sysconfdir}/alternatives/tap2deb
|
|
%ghost %{_sysconfdir}/alternatives/tap2rpm
|
|
%ghost %{_sysconfdir}/alternatives/tkconch
|
|
%ghost %{_sysconfdir}/alternatives/trial
|
|
%ghost %{_sysconfdir}/alternatives/twistd
|
|
%ghost %{_sysconfdir}/alternatives/cftp.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/ckeygen.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/conch.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/mailmail.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/manhole.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/pyhtmlizer.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/tap2deb.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/tap2rpm.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/tkconch.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/trial.1.gz
|
|
%ghost %{_sysconfdir}/alternatives/twistd.1.gz
|
|
%{python_sitearch}/*
|
|
|
|
%changelog
|