]> git.pld-linux.org Git - packages/python-pyscard.git/blame - python-pyscard.spec
rebuild with python 3.10
[packages/python-pyscard.git] / python-pyscard.spec
CommitLineData
87c410af 1#
de6998d2 2# Conditional build:
87c410af 3%bcond_without tests # unit tests
de6998d2
AM
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module pyscard
87c410af
JB
8Summary: A framework for building smart card aware applications in Python 2
9Summary(pl.UTF-8): Szkielet do tworzenia w Pythonie 2 aplikacji wykorzystujących karty procesorowe
de6998d2 10Name: python-%{module}
87c410af 11Version: 1.9.6
44c8195a 12Release: 7
87c410af 13License: LGPL v2.1+
de6998d2 14Group: Libraries/Python
87c410af
JB
15Source0: https://downloads.sourceforge.net/pyscard/pyscard-%{version}.tar.gz
16# Source0-md5: 079343dbc469330e74dee8924bc8944e
de6998d2
AM
17URL: https://sourceforge.net/projects/pyscard/
18BuildRequires: pcsc-lite-devel
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
87c410af 21BuildRequires: swig-python >= 2
de6998d2 22%if %{with python2}
87c410af
JB
23BuildRequires: python-devel >= 1:2.6
24BuildRequires: python-setuptools
de6998d2
AM
25%endif
26%if %{with python3}
87c410af
JB
27BuildRequires: python3-devel >= 1:3.3
28BuildRequires: python3-setuptools
de6998d2
AM
29%endif
30Requires: python-modules
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34The pyscard smartcard library is a framework for building smart card
35aware applications in Python. The smartcard module is built on top of
36the PCSC API Python wrapper module.
37
87c410af
JB
38%description -l pl.UTF-8
39Biblioteka pyscard smartcard to szkielet do tworzenia w Pythonie
40aplikacji wykorzystujących karty procesorowe. Moduł smartcard jest
41zbudowany w oparciu o moduł Pythona obudowujący API PCSC.
42
de6998d2 43%package -n python3-%{module}
87c410af
JB
44Summary: A framework for building smart card aware applications in Python 3
45Summary(pl.UTF-8): Szkielet do tworzenia w Pythonie 3 aplikacji wykorzystujących karty procesorowe
de6998d2
AM
46Group: Libraries/Python
47Requires: python3-modules
48
49%description -n python3-%{module}
50The pyscard smartcard library is a framework for building smart card
51aware applications in Python. The smartcard module is built on top of
52the PCSC API Python wrapper module.
53
87c410af
JB
54%description -n python3-%{module} -l pl.UTF-8
55Biblioteka pyscard smartcard to szkielet do tworzenia w Pythonie
56aplikacji wykorzystujących karty procesorowe. Moduł smartcard jest
57zbudowany w oparciu o moduł Pythona obudowujący API PCSC.
58
de6998d2
AM
59%prep
60%setup -q -n %{module}-%{version}
61
62%build
63%if %{with python2}
64%py_build %{?with_tests:test}
65%endif
66
67%if %{with python3}
68%py3_build %{?with_tests:test}
69%endif
70
71%install
72rm -rf $RPM_BUILD_ROOT
87c410af 73
de6998d2
AM
74%if %{with python2}
75%py_install
76%py_postclean
77%endif
78
79%if %{with python3}
80%py3_install
81%endif
82
83%if %{with python2}
84install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
85cp -a smartcard/Examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
86find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
87 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
88%endif
89%if %{with python3}
90install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
91cp -a smartcard/Examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
92find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
93 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
94%endif
95
96%clean
97rm -rf $RPM_BUILD_ROOT
98
99%if %{with python2}
100%files
101%defattr(644,root,root,755)
102%doc ACKS ChangeLog README* TODO
103%dir %{py_sitedir}/smartcard
104%{py_sitedir}/smartcard/*.py[co]
105%dir %{py_sitedir}/smartcard/scard
106%attr(755,root,root) %{py_sitedir}/smartcard/scard/*.so
107%{py_sitedir}/smartcard/scard/*.py[co]
108%dir %{py_sitedir}/smartcard/pcsc
109%{py_sitedir}/smartcard/pcsc/*.py[co]
110%dir %{py_sitedir}/smartcard/pyro
111%{py_sitedir}/smartcard/pyro/*.py[co]
112%dir %{py_sitedir}/smartcard/reader
113%{py_sitedir}/smartcard/reader/*.py[co]
114%dir %{py_sitedir}/smartcard/sw
115%{py_sitedir}/smartcard/sw/*.py[co]
116%dir %{py_sitedir}/smartcard/util
117%{py_sitedir}/smartcard/util/*.py[co]
118%dir %{py_sitedir}/smartcard/wx
119%{py_sitedir}/smartcard/wx/*.py[co]
120%{py_sitedir}/%{module}-%{version}-py*.egg-info
121%{_examplesdir}/%{name}-%{version}
122%endif
123
124%if %{with python3}
125%files -n python3-%{module}
126%defattr(644,root,root,755)
127%doc ACKS ChangeLog README* TODO
128%dir %{py3_sitedir}/smartcard
129%{py3_sitedir}/smartcard/*.py
130%{py3_sitedir}/smartcard/__pycache__
131%dir %{py3_sitedir}/smartcard/pcsc
132%{py3_sitedir}/smartcard/pcsc/*.py
133%{py3_sitedir}/smartcard/pcsc/__pycache__
134%dir %{py3_sitedir}/smartcard/pyro
135%{py3_sitedir}/smartcard/pyro/*.py
136%{py3_sitedir}/smartcard/pyro/__pycache__
137%dir %{py3_sitedir}/smartcard/reader
138%{py3_sitedir}/smartcard/reader/*.py
139%{py3_sitedir}/smartcard/reader/__pycache__
140%dir %{py3_sitedir}/smartcard/scard
141%attr(755,root,root) %{py3_sitedir}/smartcard/scard/_scard.*.so
142%{py3_sitedir}/smartcard/scard/*.py
143%{py3_sitedir}/smartcard/scard/__pycache__
144%dir %{py3_sitedir}/smartcard/sw
145%{py3_sitedir}/smartcard/sw/*.py
146%{py3_sitedir}/smartcard/sw/__pycache__
147%dir %{py3_sitedir}/smartcard/util
148%{py3_sitedir}/smartcard/util/*.py
149%{py3_sitedir}/smartcard/util/__pycache__
150%dir %{py3_sitedir}/smartcard/wx
151%{py3_sitedir}/smartcard/wx/*.py
152%{py3_sitedir}/smartcard/wx/__pycache__
153%{py3_sitedir}/%{module}-%{version}-py*.egg-info
154%{_examplesdir}/python3-%{module}-%{version}
155%endif
This page took 0.094029 seconds and 4 git commands to generate.