]> git.pld-linux.org Git - packages/python-pyscard.git/blob - python-pyscard.spec
89d7dd814b470c2e09f1d3b26e47ab31100f62f1
[packages/python-pyscard.git] / python-pyscard.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  pyscard
8 Summary:        A framework for building smart card aware applications in Python 2
9 Summary(pl.UTF-8):      Szkielet do tworzenia w Pythonie 2 aplikacji wykorzystujących karty procesorowe
10 Name:           python-%{module}
11 Version:        1.9.6
12 Release:        6
13 License:        LGPL v2.1+
14 Group:          Libraries/Python
15 Source0:        https://downloads.sourceforge.net/pyscard/pyscard-%{version}.tar.gz
16 # Source0-md5:  079343dbc469330e74dee8924bc8944e
17 URL:            https://sourceforge.net/projects/pyscard/
18 BuildRequires:  pcsc-lite-devel
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 BuildRequires:  swig-python >= 2
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.6
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.3
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       python-modules
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 The pyscard smartcard library is a framework for building smart card
35 aware applications in Python. The smartcard module is built on top of
36 the PCSC API Python wrapper module.
37
38 %description -l pl.UTF-8
39 Biblioteka pyscard smartcard to szkielet do tworzenia w Pythonie
40 aplikacji wykorzystujących karty procesorowe. Moduł smartcard jest
41 zbudowany w oparciu o moduł Pythona obudowujący API PCSC.
42
43 %package -n python3-%{module}
44 Summary:        A framework for building smart card aware applications in Python 3
45 Summary(pl.UTF-8):      Szkielet do tworzenia w Pythonie 3 aplikacji wykorzystujących karty procesorowe
46 Group:          Libraries/Python
47 Requires:       python3-modules
48
49 %description -n python3-%{module}
50 The pyscard smartcard library is a framework for building smart card
51 aware applications in Python. The smartcard module is built on top of
52 the PCSC API Python wrapper module.
53
54 %description -n python3-%{module} -l pl.UTF-8
55 Biblioteka pyscard smartcard to szkielet do tworzenia w Pythonie
56 aplikacji wykorzystujących karty procesorowe. Moduł smartcard jest
57 zbudowany w oparciu o moduł Pythona obudowujący API PCSC.
58
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
72 rm -rf $RPM_BUILD_ROOT
73
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}
84 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
85 cp -a smartcard/Examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
86 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
87         | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
88 %endif
89 %if %{with python3}
90 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
91 cp -a smartcard/Examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
92 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
93         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
94 %endif
95
96 %clean
97 rm -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.059912 seconds and 2 git commands to generate.