]>
Commit | Line | Data |
---|---|---|
491caebd | 1 | # TODO |
ff6aac78 | 2 | # - follow upstream with using /run instead of /var/run |
491caebd ER |
3 | # - pcscd & pcscd-lite-libs need to be exactly same version installed otherwise |
4 | # client will flood daemon so much that daemon is not usable (max 200 | |
5 | # connections reached, etc) | |
da489335 JB |
6 | # |
7 | # Conditional build: | |
58757b78 JP |
8 | %bcond_without apidocs # API documentation |
9 | %bcond_without polkit # polkit support | |
10 | %bcond_without static_libs # static libraries | |
11 | %bcond_without systemd # libsystemd support | |
12 | %bcond_without udev # udev support (plain libusb if disabled) | |
5573ec9c | 13 | |
40431be1 | 14 | Summary: PCSC Framework for Linux |
054c7a02 | 15 | Summary(pl.UTF-8): Środowisko PCSC dla Linuksa |
3dfdd265 | 16 | Name: pcsc-lite |
9d7f5863 | 17 | Version: 2.0.3 |
9d2298a5 | 18 | Release: 1 |
3dfdd265 | 19 | License: BSD |
21288c4d | 20 | Group: Daemons |
ff6aac78 | 21 | Source0: https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2 |
9d7f5863 | 22 | # Source0-md5: 4167d2d3fa2be3f8e24b2f44e38a35ee |
c866bb09 JB |
23 | Source1: %{name}-pcscd.init |
24 | Source2: %{name}-pcscd.sysconfig | |
246d0bf3 | 25 | Source4: %{name}.tmpfiles |
34b152c0 | 26 | Patch1: %{name}-any.patch |
7b78f55e | 27 | Patch2: debuglog-pid.patch |
a7506d5e | 28 | URL: https://pcsclite.apdu.fr/ |
7fbb1229 | 29 | BuildRequires: autoconf >= 2.69 |
40787fb6 | 30 | BuildRequires: autoconf-archive |
b6db0f88 | 31 | BuildRequires: automake >= 1:1.8 |
18f455e9 | 32 | BuildRequires: flex |
1cfdb7af | 33 | %{?with_apidocs:BuildRequires: doxygen} |
932ceca9 | 34 | BuildRequires: libtool >= 2:2.0 |
6534d619 | 35 | %{!?with_udev:BuildRequires: libusb-devel >= 1.0} |
6ba78e95 | 36 | BuildRequires: perl-tools-pod |
f9df8cca | 37 | BuildRequires: pkgconfig |
7fbb1229 | 38 | %{?with_polkit:BuildRequires: polkit-devel >= 0.111} |
923fe317 | 39 | BuildRequires: rpm-build >= 4.6 |
95e7e0a3 | 40 | BuildRequires: rpmbuild(macros) >= 1.647 |
1a7e5089 | 41 | %{?with_systemd:BuildRequires: systemd-devel} |
7b3ef2e4 | 42 | %{?with_udev:BuildRequires: udev-devel} |
18f455e9 | 43 | Requires(post,preun): /sbin/chkconfig |
3d6c29a8 | 44 | Requires(pretrans): fileutils |
7fbb1229 | 45 | %{?with_polkit:Requires: polkit >= 0.111} |
9ad63810 | 46 | Requires: rc-scripts >= 0.4.3.0 |
95e7e0a3 | 47 | Requires: systemd-units >= 38 |
3dfdd265 | 48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
620572bf | 50 | %define usbdropdir /usr/%{_lib}/pcsc/drivers |
ffe7e1e7 | 51 | |
3dfdd265 | 52 | %description |
53 | pcscd is the daemon program for PC/SC Lite. It is a resource manager | |
54 | that coorinates communications with Smart Card readers and Smart Cards | |
55 | that are connected to the system. The purpose of PCSC Lite is to | |
56 | provide a Windows(R) SCard interface in a very small form factor for | |
57 | communicating to smartcards and readers. PCSC Lite uses the same | |
ff6b1f18 | 58 | winscard api as used under Windows(R). |
3dfdd265 | 59 | |
efe36e15 JR |
60 | %description -l pl.UTF-8 |
61 | pcscd jest demonem dla PC/SC Lite. Jest to zarządca zasobów, | |
62 | koordynujący komunikację z czytnikami kart procesorowych podłączonymi | |
63 | do systemu. Celem PCSC Lite jest udostępnienie interfejsu zgodnego z | |
64 | Windows(R) SCard służącego do komunikacji z czytnikami kart chipowych. | |
65 | Używa tego samego API winscard, które jest używane pod Microsoft(TM) | |
21288c4d | 66 | Windows(R). |
3dfdd265 | 67 | |
b9189220 | 68 | %package libs |
ff6b1f18 | 69 | Summary: PC/SC Lite libraries |
054c7a02 | 70 | Summary(pl.UTF-8): Biblioteki PC/SC Lite |
21288c4d | 71 | Group: Libraries |
b9189220 | 72 | |
73 | %description libs | |
ff6b1f18 | 74 | PC/SC Lite libraries. |
b9189220 | 75 | |
efe36e15 | 76 | %description libs -l pl.UTF-8 |
ff6b1f18 | 77 | Biblioteki PC/SC Lite. |
b9189220 | 78 | |
21288c4d | 79 | %package devel |
ff6b1f18 | 80 | Summary: PC/SC Lite development files |
054c7a02 | 81 | Summary(pl.UTF-8): Pliki dla programistów używających PC/SC Lite |
34b152c0 | 82 | Group: Development/Libraries |
bbf93565 | 83 | Requires: %{name}-libs = %{version}-%{release} |
21288c4d JB |
84 | |
85 | %description devel | |
ff6b1f18 | 86 | PC/SC Lite development files. |
21288c4d | 87 | |
efe36e15 JR |
88 | %description devel -l pl.UTF-8 |
89 | Pliki dla programistów używających PC/SC Lite. | |
b9189220 | 90 | |
91 | %package static | |
ff6b1f18 | 92 | Summary: Static PC/SC Lite libraries |
054c7a02 | 93 | Summary(pl.UTF-8): Biblioteki statyczne PC/SC Lite |
34b152c0 | 94 | Group: Development/Libraries |
bbf93565 | 95 | Requires: %{name}-devel = %{version}-%{release} |
b9189220 | 96 | |
97 | %description static | |
ff6b1f18 | 98 | Static PC/SC Lite libraries. |
b9189220 | 99 | |
efe36e15 | 100 | %description static -l pl.UTF-8 |
ff6b1f18 | 101 | Statyczne biblioteki PC/SC Lite. |
639acbcc | 102 | |
3d6c29a8 ER |
103 | %package apidocs |
104 | Summary: PC/SC Lite API documentation | |
105 | Summary(pl.UTF-8): Dokumentacja API biblioteki PC/SC Lite | |
106 | Group: Documentation | |
923fe317 | 107 | BuildArch: noarch |
3d6c29a8 ER |
108 | |
109 | %description apidocs | |
110 | API and internal documentation for PC/SC Lite library. | |
111 | ||
112 | %description apidocs -l pl.UTF-8 | |
113 | Dokumentacja API biblioteki PC/SC Lite. | |
114 | ||
3dfdd265 | 115 | %prep |
ff6aac78 | 116 | %setup -q |
34b152c0 | 117 | %patch1 -p1 |
10f2ab78 | 118 | %patch2 -p1 |
3dfdd265 | 119 | |
02325f61 | 120 | %{__sed} -i -e '1s, /usr/bin/python$,%{__python3},' src/spy/pcsc-spy |
83defa63 | 121 | |
3dfdd265 | 122 | %build |
18f455e9 | 123 | %{__libtoolize} |
34b152c0 | 124 | %{__aclocal} -I m4 |
18f455e9 | 125 | %{__autoconf} |
ffe7e1e7 | 126 | %{__autoheader} |
18f455e9 | 127 | %{__automake} |
fc2f6bd6 ER |
128 | # auto power down unreliable yet |
129 | CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON" | |
ffe7e1e7 | 130 | %configure \ |
1a7e5089 | 131 | %{!?with_systemd:--disable-libsystemd} \ |
6534d619 | 132 | %{!?with_udev:--disable-libudev} \ |
53993780 | 133 | --disable-silent-rules \ |
65af3098 | 134 | --enable-ipcdir=/var/run/pcscd \ |
fcf8d002 | 135 | %{__enable_disable polkit} \ |
58757b78 | 136 | %{__enable_disable static_libs static} \ |
ffe7e1e7 | 137 | --enable-usbdropdir=%{usbdropdir} |
3dfdd265 | 138 | |
639acbcc | 139 | %{__make} |
140 | ||
3d6c29a8 ER |
141 | %if %{with apidocs} |
142 | doxygen doc/doxygen.conf | |
143 | rm -f doc/api/*.{map,md5} | |
144 | %endif | |
3bd03235 | 145 | |
3dfdd265 | 146 | %install |
147 | rm -rf $RPM_BUILD_ROOT | |
40431be1 | 148 | install -d $RPM_BUILD_ROOT%{usbdropdir} \ |
f26af49a | 149 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \ |
6534d619 | 150 | $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \ |
491caebd | 151 | $RPM_BUILD_ROOT/var/run/pcscd \ |
246d0bf3 JR |
152 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \ |
153 | $RPM_BUILD_ROOT/usr/lib/tmpfiles.d | |
c866bb09 JB |
154 | |
155 | %{__make} install \ | |
156 | DESTDIR=$RPM_BUILD_ROOT | |
21288c4d | 157 | |
3d6c29a8 ER |
158 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} |
159 | ||
10f2ab78 | 160 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd |
5573ec9c | 161 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd |
246d0bf3 | 162 | install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf |
3dfdd265 | 163 | |
5573ec9c | 164 | cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
ffe7e1e7 | 165 | |
3dfdd265 | 166 | %clean |
167 | rm -rf $RPM_BUILD_ROOT | |
168 | ||
0c3f79a3 | 169 | %pretrans |
34b152c0 | 170 | # upgrade from pcsc-lite < 1.2.9-0.beta7 |
6534d619 JB |
171 | if [ -f /etc/reader.conf -a ! -f %{_sysconfdir}/reader.conf.d/reader.conf ]; then |
172 | install -d -m755 %{_sysconfdir}/reader.conf.d | |
173 | cp -af /etc/reader.conf %{_sysconfdir}/reader.conf.d/reader.conf | |
34b152c0 JB |
174 | fi |
175 | ||
c866bb09 JB |
176 | %post |
177 | /sbin/chkconfig --add pcscd | |
0c3f79a3 | 178 | %service pcscd restart "PC/SC smart card daemon" |
95e7e0a3 | 179 | %systemd_post pcscd.service pcscd.socket |
c866bb09 JB |
180 | |
181 | %preun | |
182 | if [ "$1" = "0" ]; then | |
4724f046 | 183 | %service pcscd stop |
c866bb09 JB |
184 | /sbin/chkconfig --del pcscd |
185 | fi | |
95e7e0a3 JR |
186 | %systemd_preun pcscd.service pcscd.socket |
187 | ||
188 | %postun | |
189 | %systemd_reload | |
190 | ||
191 | %triggerpostun -- pcsc-lite < 1.8.3-1 | |
192 | %systemd_trigger pcscd.service pcscd.socket | |
c866bb09 | 193 | |
21288c4d JB |
194 | %post libs -p /sbin/ldconfig |
195 | %postun libs -p /sbin/ldconfig | |
196 | ||
3dfdd265 | 197 | %files |
198 | %defattr(644,root,root,755) | |
6d545375 | 199 | %doc AUTHORS COPYING ChangeLog HELP README SECURITY TODO doc/README.polkit |
13ce7484 | 200 | %attr(755,root,root) %{_bindir}/pcsc-spy |
34b152c0 | 201 | %attr(755,root,root) %{_sbindir}/pcscd |
0c3f79a3 ER |
202 | %dir %{_libdir}/pcsc |
203 | %dir %{_libdir}/pcsc/drivers | |
34b152c0 | 204 | %dir %{_sysconfdir}/reader.conf.d |
34b152c0 JB |
205 | %attr(754,root,root) /etc/rc.d/init.d/pcscd |
206 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd | |
13ce7484 | 207 | %{_mandir}/man1/pcsc-spy.1* |
34b152c0 | 208 | %{_mandir}/man5/reader.conf.5* |
21288c4d | 209 | %{_mandir}/man8/pcscd.8* |
65af3098 | 210 | %dir /var/run/pcscd |
13ce7484 JB |
211 | %{systemdunitdir}/pcscd.service |
212 | %{systemdunitdir}/pcscd.socket | |
246d0bf3 | 213 | /usr/lib/tmpfiles.d/%{name}.conf |
7fbb1229 JB |
214 | %if %{with polkit} |
215 | %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy | |
216 | %endif | |
b9189220 | 217 | |
21288c4d JB |
218 | %files libs |
219 | %defattr(644,root,root,755) | |
34b152c0 | 220 | %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.* |
1c692fd1 | 221 | %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1 |
7b78f55e JK |
222 | %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.* |
223 | %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0 | |
3dfdd265 | 224 | |
653e100a | 225 | %files devel |
21288c4d | 226 | %defattr(644,root,root,755) |
34b152c0 | 227 | %attr(755,root,root) %{_libdir}/libpcsclite.so |
7b78f55e | 228 | %attr(755,root,root) %{_libdir}/libpcscspy.so |
34b152c0 | 229 | %{_libdir}/libpcsclite.la |
7b78f55e | 230 | %{_libdir}/libpcscspy.la |
34b152c0 JB |
231 | %{_includedir}/PCSC |
232 | %{_pkgconfigdir}/libpcsclite.pc | |
ffe7e1e7 | 233 | %{_examplesdir}/%{name}-%{version} |
653e100a | 234 | |
58757b78 | 235 | %if %{with static_libs} |
b9189220 | 236 | %files static |
21288c4d | 237 | %defattr(644,root,root,755) |
34b152c0 | 238 | %{_libdir}/libpcsclite.a |
7b78f55e | 239 | %{_libdir}/libpcscspy.a |
58757b78 | 240 | %endif |
3d6c29a8 ER |
241 | |
242 | %if %{with apidocs} | |
243 | %files apidocs | |
244 | %defattr(644,root,root,755) | |
245 | %doc doc/api/* | |
246 | %endif |