]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
up to 1.9.7
[packages/pcsc-lite.git] / pcsc-lite.spec
1 # TODO
2 # - follow upstream with using /run instead of /var/run
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)
6 #
7 # Conditional build:
8 %bcond_without  polkit  # polkit support
9 %bcond_without  systemd # libsystemd support
10 %bcond_without  udev    # udev support (plain libusb if disabled)
11
12 Summary:        PCSC Framework for Linux
13 Summary(pl.UTF-8):      Środowisko PCSC dla Linuksa
14 Name:           pcsc-lite
15 Version:        1.9.7
16 Release:        1
17 License:        BSD
18 Group:          Daemons
19 Source0:        https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2
20 # Source0-md5:  6779aef882a9df282b85d6e58f041fb6
21 Source1:        %{name}-pcscd.init
22 Source2:        %{name}-pcscd.sysconfig
23 Source4:        %{name}.tmpfiles
24 Patch1:         %{name}-any.patch
25 Patch2:         debuglog-pid.patch
26 URL:            https://pcsclite.apdu.fr/
27 BuildRequires:  autoconf >= 2.69
28 BuildRequires:  autoconf-archive
29 BuildRequires:  automake >= 1:1.8
30 BuildRequires:  flex
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_systemd:BuildRequires:  systemd-devel}
38 %{?with_udev:BuildRequires:     udev-devel}
39 Requires(post,preun):   /sbin/chkconfig
40 Requires(pretrans):     fileutils
41 %{?with_polkit:Requires:        polkit >= 0.111}
42 Requires:       rc-scripts >= 0.4.3.0
43 Requires:       systemd-units >= 38
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %define         usbdropdir      /usr/%{_lib}/pcsc/drivers
47
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
54 winscard api as used under Windows(R).
55
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)
62 Windows(R).
63
64 %package libs
65 Summary:        PC/SC Lite libraries
66 Summary(pl.UTF-8):      Biblioteki PC/SC Lite
67 Group:          Libraries
68
69 %description libs
70 PC/SC Lite libraries.
71
72 %description libs -l pl.UTF-8
73 Biblioteki PC/SC Lite.
74
75 %package devel
76 Summary:        PC/SC Lite development files
77 Summary(pl.UTF-8):      Pliki dla programistów używających PC/SC Lite
78 Group:          Development/Libraries
79 Requires:       %{name}-libs = %{version}-%{release}
80
81 %description devel
82 PC/SC Lite development files.
83
84 %description devel -l pl.UTF-8
85 Pliki dla programistów używających PC/SC Lite.
86
87 %package static
88 Summary:        Static PC/SC Lite libraries
89 Summary(pl.UTF-8):      Biblioteki statyczne PC/SC Lite
90 Group:          Development/Libraries
91 Requires:       %{name}-devel = %{version}-%{release}
92
93 %description static
94 Static PC/SC Lite libraries.
95
96 %description static -l pl.UTF-8
97 Statyczne biblioteki PC/SC Lite.
98
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
110 %prep
111 %setup -q
112 %patch1 -p1
113 %patch2 -p1
114
115 %{__sed} -i -e '1s, /usr/bin/python$,%{__python3},' src/spy/pcsc-spy
116
117 %build
118 %{__libtoolize}
119 %{__aclocal} -I m4
120 %{__autoconf}
121 %{__autoheader}
122 %{__automake}
123 # auto power down unreliable yet
124 CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON"
125 %configure \
126         %{!?with_systemd:--disable-libsystemd} \
127         %{!?with_udev:--disable-libudev} \
128         --disable-silent-rules \
129         --enable-ipcdir=/var/run/pcscd \
130         %{?with_polkit:--enable-polkit} \
131         --enable-static \
132         --enable-usbdropdir=%{usbdropdir}
133
134 %{__make}
135
136 %if %{with apidocs}
137 doxygen doc/doxygen.conf
138 rm -f doc/api/*.{map,md5}
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT%{usbdropdir} \
144         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
145         $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \
146         $RPM_BUILD_ROOT/var/run/pcscd \
147         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
148         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
149
150 %{__make} install \
151         DESTDIR=$RPM_BUILD_ROOT
152
153 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
154
155 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
156 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
157 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
158
159 cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
160
161 %clean
162 rm -rf $RPM_BUILD_ROOT
163
164 %pretrans
165 # upgrade from pcsc-lite < 1.2.9-0.beta7
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
169 fi
170
171 %post
172 /sbin/chkconfig --add pcscd
173 %service pcscd restart "PC/SC smart card daemon"
174 %systemd_post pcscd.service pcscd.socket
175
176 %preun
177 if [ "$1" = "0" ]; then
178         %service pcscd stop
179         /sbin/chkconfig --del pcscd
180 fi
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
188
189 %post   libs -p /sbin/ldconfig
190 %postun libs -p /sbin/ldconfig
191
192 %files
193 %defattr(644,root,root,755)
194 %doc AUTHORS COPYING ChangeLog HELP README SECURITY TODO doc/README.polkit
195 %attr(755,root,root) %{_bindir}/pcsc-spy
196 %attr(755,root,root) %{_sbindir}/pcscd
197 %dir %{_libdir}/pcsc
198 %dir %{_libdir}/pcsc/drivers
199 %dir %{_sysconfdir}/reader.conf.d
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
202 %{_mandir}/man1/pcsc-spy.1*
203 %{_mandir}/man5/reader.conf.5*
204 %{_mandir}/man8/pcscd.8*
205 %dir /var/run/pcscd
206 %{systemdunitdir}/pcscd.service
207 %{systemdunitdir}/pcscd.socket
208 /usr/lib/tmpfiles.d/%{name}.conf
209 %if %{with polkit}
210 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
211 %endif
212
213 %files libs
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
216 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
217 %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.*
218 %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0
219
220 %files devel
221 %defattr(644,root,root,755)
222 %attr(755,root,root) %{_libdir}/libpcsclite.so
223 %attr(755,root,root) %{_libdir}/libpcscspy.so
224 %{_libdir}/libpcsclite.la
225 %{_libdir}/libpcscspy.la
226 %{_includedir}/PCSC
227 %{_pkgconfigdir}/libpcsclite.pc
228 %{_examplesdir}/%{name}-%{version}
229
230 %files static
231 %defattr(644,root,root,755)
232 %{_libdir}/libpcsclite.a
233 %{_libdir}/libpcscspy.a
234
235 %if %{with apidocs}
236 %files apidocs
237 %defattr(644,root,root,755)
238 %doc doc/api/*
239 %endif
This page took 0.094695 seconds and 3 git commands to generate.