]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
- updated to 1.9.5
[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.5
16 Release:        1
17 License:        BSD
18 Group:          Daemons
19 Source0:        https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2
20 # Source0-md5:  67fe439397aee0eb3ceaad03280a26a1
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:  automake >= 1:1.8
29 BuildRequires:  flex
30 %{?with_apidocs:BuildRequires:  graphviz}
31 BuildRequires:  libtool >= 2:2.0
32 %{!?with_udev:BuildRequires:    libusb-devel >= 1.0}
33 BuildRequires:  pkgconfig
34 %{?with_polkit:BuildRequires:   polkit-devel >= 0.111}
35 BuildRequires:  rpmbuild(macros) >= 1.647
36 %{?with_systemd:BuildRequires:  systemd-devel}
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 Requires:       systemd-units >= 38
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         usbdropdir      /usr/%{_lib}/pcsc/drivers
46
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
53 winscard api as used under Windows(R).
54
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)
61 Windows(R).
62
63 %package libs
64 Summary:        PC/SC Lite libraries
65 Summary(pl.UTF-8):      Biblioteki PC/SC Lite
66 Group:          Libraries
67
68 %description libs
69 PC/SC Lite libraries.
70
71 %description libs -l pl.UTF-8
72 Biblioteki PC/SC Lite.
73
74 %package devel
75 Summary:        PC/SC Lite development files
76 Summary(pl.UTF-8):      Pliki dla programistów używających PC/SC Lite
77 Group:          Development/Libraries
78 Requires:       %{name}-libs = %{version}-%{release}
79
80 %description devel
81 PC/SC Lite development files.
82
83 %description devel -l pl.UTF-8
84 Pliki dla programistów używających PC/SC Lite.
85
86 %package static
87 Summary:        Static PC/SC Lite libraries
88 Summary(pl.UTF-8):      Biblioteki statyczne PC/SC Lite
89 Group:          Development/Libraries
90 Requires:       %{name}-devel = %{version}-%{release}
91
92 %description static
93 Static PC/SC Lite libraries.
94
95 %description static -l pl.UTF-8
96 Statyczne biblioteki PC/SC Lite.
97
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
109 %prep
110 %setup -q
111 %patch1 -p1
112 %patch2 -p1
113
114 %{__sed} -i -e '1s, /usr/bin/python$,%{__python3},' src/spy/pcsc-spy
115
116 %build
117 %{__libtoolize}
118 %{__aclocal} -I m4
119 %{__autoconf}
120 %{__autoheader}
121 %{__automake}
122 # auto power down unreliable yet
123 CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON"
124 %configure \
125         %{!?with_systemd:--disable-libsystemd} \
126         %{!?with_udev:--disable-libudev} \
127         --disable-silent-rules \
128         --enable-ipcdir=/var/run/pcscd \
129         %{?with_polkit:--enable-polkit} \
130         --enable-static \
131         --enable-usbdropdir=%{usbdropdir}
132
133 %{__make}
134
135 %if %{with apidocs}
136 doxygen doc/doxygen.conf
137 rm -f doc/api/*.{map,md5}
138 %endif
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT%{usbdropdir} \
143         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
144         $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \
145         $RPM_BUILD_ROOT/var/run/pcscd \
146         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
147         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
148
149 %{__make} install \
150         DESTDIR=$RPM_BUILD_ROOT
151
152 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
153
154 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
155 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
156 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
157
158 cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
159
160 %clean
161 rm -rf $RPM_BUILD_ROOT
162
163 %pretrans
164 # upgrade from pcsc-lite < 1.2.9-0.beta7
165 if [ -f /etc/reader.conf -a ! -f %{_sysconfdir}/reader.conf.d/reader.conf ]; then
166         install -d -m755 %{_sysconfdir}/reader.conf.d
167         cp -af /etc/reader.conf %{_sysconfdir}/reader.conf.d/reader.conf
168 fi
169
170 %post
171 /sbin/chkconfig --add pcscd
172 %service pcscd restart "PC/SC smart card daemon"
173 %systemd_post pcscd.service pcscd.socket
174
175 %preun
176 if [ "$1" = "0" ]; then
177         %service pcscd stop
178         /sbin/chkconfig --del pcscd
179 fi
180 %systemd_preun pcscd.service pcscd.socket
181
182 %postun
183 %systemd_reload
184
185 %triggerpostun -- pcsc-lite < 1.8.3-1
186 %systemd_trigger pcscd.service pcscd.socket
187
188 %post   libs -p /sbin/ldconfig
189 %postun libs -p /sbin/ldconfig
190
191 %files
192 %defattr(644,root,root,755)
193 %doc AUTHORS COPYING ChangeLog HELP README SECURITY TODO doc/README.polkit
194 %attr(755,root,root) %{_bindir}/pcsc-spy
195 %attr(755,root,root) %{_sbindir}/pcscd
196 %dir %{_libdir}/pcsc
197 %dir %{_libdir}/pcsc/drivers
198 %dir %{_sysconfdir}/reader.conf.d
199 %attr(754,root,root) /etc/rc.d/init.d/pcscd
200 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd
201 %{_mandir}/man1/pcsc-spy.1*
202 %{_mandir}/man5/reader.conf.5*
203 %{_mandir}/man8/pcscd.8*
204 %dir /var/run/pcscd
205 %{systemdunitdir}/pcscd.service
206 %{systemdunitdir}/pcscd.socket
207 /usr/lib/tmpfiles.d/%{name}.conf
208 %if %{with polkit}
209 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
210 %endif
211
212 %files libs
213 %defattr(644,root,root,755)
214 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
215 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
216 %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.*
217 %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0
218
219 %files devel
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/libpcsclite.so
222 %attr(755,root,root) %{_libdir}/libpcscspy.so
223 %{_libdir}/libpcsclite.la
224 %{_libdir}/libpcscspy.la
225 %{_includedir}/PCSC
226 %{_pkgconfigdir}/libpcsclite.pc
227 %{_examplesdir}/%{name}-%{version}
228
229 %files static
230 %defattr(644,root,root,755)
231 %{_libdir}/libpcsclite.a
232 %{_libdir}/libpcscspy.a
233
234 %if %{with apidocs}
235 %files apidocs
236 %defattr(644,root,root,755)
237 %doc doc/api/*
238 %endif
This page took 0.119915 seconds and 3 git commands to generate.