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