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