2 # - pcscd & pcscd-lite-libs need to be exactly same version installed otherwise
3 # client will flood daemon so much that daemon is not usable (max 200
4 # connections reached, etc)
7 %bcond_without polkit # polkit support
8 %bcond_without udev # udev support (plain libusb if disabled)
10 Summary: PCSC Framework for Linux
11 Summary(pl.UTF-8): Środowisko PCSC dla Linuksa
17 # TODO: switch to release tarballs
18 #Source0: https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2
19 # Source0Download: https://salsa.debian.org/rousseau/PCSC/tags
20 Source0: https://salsa.debian.org/rousseau/PCSC/-/archive/pcsc-%{version}/PCSC-pcsc-%{version}.tar.bz2
21 # Source0-md5: d104b1c779c15c1da28294095ae0014e
22 Source1: %{name}-pcscd.init
23 Source2: %{name}-pcscd.sysconfig
24 Patch1: %{name}-any.patch
25 Patch2: debuglog-pid.patch
26 Patch3: configure-expand.patch
27 URL: https://pcsclite.apdu.fr/
28 BuildRequires: autoconf >= 2.69
29 BuildRequires: automake >= 1:1.8
31 %{?with_apidocs:BuildRequires: graphviz}
32 BuildRequires: libtool >= 2:2.0
33 %{!?with_udev:BuildRequires: libusb-devel >= 1.0}
34 BuildRequires: pkgconfig
35 %{?with_polkit:BuildRequires: polkit-devel >= 0.111}
36 BuildRequires: rpmbuild(macros) >= 1.647
37 %{?with_udev:BuildRequires: udev-devel}
38 Requires(post,preun): /sbin/chkconfig
39 Requires(pretrans): fileutils
40 %{?with_polkit:Requires: polkit >= 0.111}
41 Requires: rc-scripts >= 0.4.3.0
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define usbdropdir /usr/%{_lib}/pcsc/drivers
47 pcscd is the daemon program for PC/SC Lite. It is a resource manager
48 that coorinates communications with Smart Card readers and Smart Cards
49 that are connected to the system. The purpose of PCSC Lite is to
50 provide a Windows(R) SCard interface in a very small form factor for
51 communicating to smartcards and readers. PCSC Lite uses the same
52 winscard api as used under Windows(R).
54 %description -l pl.UTF-8
55 pcscd jest demonem dla PC/SC Lite. Jest to zarządca zasobów,
56 koordynujący komunikację z czytnikami kart procesorowych podłączonymi
57 do systemu. Celem PCSC Lite jest udostępnienie interfejsu zgodnego z
58 Windows(R) SCard służącego do komunikacji z czytnikami kart chipowych.
59 Używa tego samego API winscard, które jest używane pod Microsoft(TM)
63 Summary: PC/SC Lite libraries
64 Summary(pl.UTF-8): Biblioteki PC/SC Lite
70 %description libs -l pl.UTF-8
71 Biblioteki PC/SC Lite.
74 Summary: PC/SC Lite development files
75 Summary(pl.UTF-8): Pliki dla programistów używających PC/SC Lite
76 Group: Development/Libraries
77 Requires: %{name}-libs = %{version}-%{release}
80 PC/SC Lite development files.
82 %description devel -l pl.UTF-8
83 Pliki dla programistów używających PC/SC Lite.
86 Summary: Static PC/SC Lite libraries
87 Summary(pl.UTF-8): Biblioteki statyczne PC/SC Lite
88 Group: Development/Libraries
89 Requires: %{name}-devel = %{version}-%{release}
92 Static PC/SC Lite libraries.
94 %description static -l pl.UTF-8
95 Statyczne biblioteki PC/SC Lite.
98 Summary: PC/SC Lite API documentation
99 Summary(pl.UTF-8): Dokumentacja API biblioteki PC/SC Lite
103 API and internal documentation for PC/SC Lite library.
105 %description apidocs -l pl.UTF-8
106 Dokumentacja API biblioteki PC/SC Lite.
109 %setup -q -n PCSC-pcsc-%{version}
120 # auto power down unreliable yet
121 CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON"
123 --disable-libsystemd \
124 %{!?with_udev:--disable-libudev} \
125 --disable-silent-rules \
126 --enable-ipcdir=/var/run/pcscd \
127 %{?with_polkit:--enable-polkit} \
129 --enable-usbdropdir=%{usbdropdir}
134 doxygen doc/doxygen.conf
135 rm -f doc/api/*.{map,md5}
139 rm -rf $RPM_BUILD_ROOT
140 install -d $RPM_BUILD_ROOT%{usbdropdir} \
141 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
142 $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \
143 $RPM_BUILD_ROOT/var/run/pcscd \
144 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
147 DESTDIR=$RPM_BUILD_ROOT
149 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
151 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
152 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
154 cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
157 rm -rf $RPM_BUILD_ROOT
160 # upgrade from pcsc-lite < 1.2.9-0.beta7
161 if [ -f /etc/reader.conf -a ! -f %{_sysconfdir}/reader.conf.d/reader.conf ]; then
162 install -d -m755 %{_sysconfdir}/reader.conf.d
163 cp -af /etc/reader.conf %{_sysconfdir}/reader.conf.d/reader.conf
167 /sbin/chkconfig --add pcscd
168 %service pcscd restart "PC/SC smart card daemon"
171 if [ "$1" = "0" ]; then
173 /sbin/chkconfig --del pcscd
176 %post libs -p /sbin/ldconfig
177 %postun libs -p /sbin/ldconfig
180 %defattr(644,root,root,755)
181 %doc AUTHORS COPYING ChangeLog HELP README SECURITY TODO doc/README.{DAEMON,polkit}
182 %attr(755,root,root) %{_bindir}/pcsc-spy
183 %attr(755,root,root) %{_sbindir}/pcscd
185 %dir %{_libdir}/pcsc/drivers
186 %dir %{_sysconfdir}/reader.conf.d
187 %attr(754,root,root) /etc/rc.d/init.d/pcscd
188 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd
189 %{_mandir}/man1/pcsc-spy.1*
190 %{_mandir}/man5/reader.conf.5*
191 %{_mandir}/man8/pcscd.8*
194 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
201 %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.*
202 %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_libdir}/libpcsclite.so
207 %attr(755,root,root) %{_libdir}/libpcscspy.so
208 %{_libdir}/libpcsclite.la
209 %{_libdir}/libpcscspy.la
211 %{_pkgconfigdir}/libpcsclite.pc
212 %{_examplesdir}/%{name}-%{version}
215 %defattr(644,root,root,755)
216 %{_libdir}/libpcsclite.a
217 %{_libdir}/libpcscspy.a
221 %defattr(644,root,root,755)