xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #683: python-rencode.spec

File python-rencode.spec, 3.6 KB (added by Antoine Martin, 7 years ago)

specfile for the source above

Line 
1# Remove private provides from .so files in the python_sitearch directory
2%global __provides_exclude_from ^%{python_sitearch}/.*\\.so$
3
4#this spec file is for both Fedora and CentOS
5#only Fedora has Python3 at present:
6%if 0%{?fedora} == 0
7%define with_python3 1
8%endif
9
10Name:           python-rencode
11Version:        1.0.3
12Release:        1%{?dist}
13Summary:        Web safe object pickling/unpickling
14License:        GPLv3+ and BSD
15URL:            http://code.google.com/p/rencode/
16Source0:        rencode-%{version}.tar.xz
17
18BuildRequires:  python2-devel
19BuildRequires:  Cython
20%if 0%{?with_python3} == 0
21BuildRequires:  python3-devel
22BuildRequires:  python3-Cython
23%endif
24
25%description
26The rencode module is a modified version of bencode from the
27BitTorrent project.  For complex, heterogeneous data structures with
28many small elements, r-encodings take up significantly less space than
29b-encodings.
30
31%if 0%{?with_python3} == 0
32%package -n python3-rencode
33Summary:    Web safe object pickling/unpickling
34
35%description -n python3-rencode
36The rencode module is a modified version of bencode from the
37BitTorrent project.  For complex, heterogeneous data structures with
38many small elements, r-encodings take up significantly less space than
39b-encodings.
40%endif
41
42%prep
43%setup -qn rencode-%{version}
44
45%if 0%{?with_python3} == 0
46rm -rf %{py3dir}
47cp -a . %{py3dir}
48find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
49%endif
50
51find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
52
53%build
54CFLAGS="%{optflags}" %{__python} setup.py build
55
56%if 0%{?with_python3} == 0
57pushd %{py3dir}
58CFLAGS="%{optflags}" %{__python3} setup.py build
59popd
60%endif
61
62%install
63%if 0%{?with_python3} == 0
64pushd %{py3dir}
65%{__python3} setup.py install --skip-build --root %{buildroot}
66popd
67%endif
68
69%{__python} setup.py install -O1 --skip-build --root %{buildroot}
70
71#fix permissions on shared objects
72chmod 0755 %{buildroot}%{python_sitearch}/rencode/_rencode.so
73%if 0%{?with_python3} == 0
74chmod 0755 %{buildroot}%{python3_sitearch}/rencode/_rencode.cpython-*.so
75%endif
76
77%check
78pushd tests
79ln -sf %{buildroot}%{python_sitearch}/rencode rencode
80%{__python} test_rencode.py
81%{__python} timetest.py
82popd
83
84%if 0%{?with_python3} == 0
85pushd %{py3dir}/tests
86ln -sf %{buildroot}%{python3_sitearch}/rencode rencode
87%{__python3} test_rencode.py
88%{__python3} timetest.py
89popd
90%endif
91
92%files
93%{python_sitearch}/rencode
94%{python_sitearch}/rencode*.egg-info
95%doc COPYING README
96
97%if 0%{?with_python3} == 0
98%files -n python3-rencode
99%{python3_sitearch}/rencode
100%{python3_sitearch}/rencode*.egg-info
101%doc COPYING README
102%endif
103
104%changelog
105* Wed Sep 17 2014 Antoine Martin <antoine@devloop.org.uk> 1.0.3-1
106- Preparing for xpra unbundling.
107
108* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-6.20121209svn33
109- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
110
111* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-5.20121209svn33
112- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
113
114* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.2-4.20121209svn33
115- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
116
117* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-3.20121209svn33
118- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
119
120* Mon May 06 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.2-2.20121209svn33
121- use macros consistently
122- fix permissions on shared objects
123- drop useless setuptools copypasta
124- fix License tag
125
126* Thu Apr 18 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.2-1.20121209svn33
127- initial package