]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
up to 1.9.9
[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.9
16 Release:        1
17 License:        BSD
18 Group:          Daemons
19 Source0:        https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2
20 # Source0-md5:  23db832115db702e902baccf21da13aa
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:  perl-tools-pod
35 BuildRequires:  pkgconfig
36 %{?with_polkit:BuildRequires:   polkit-devel >= 0.111}
37 BuildRequires:  rpmbuild(macros) >= 1.647
38 %{?with_systemd:BuildRequires:  systemd-devel}
39 %{?with_udev:BuildRequires:     udev-devel}
40 Requires(post,preun):   /sbin/chkconfig
41 Requires(pretrans):     fileutils
42 %{?with_polkit:Requires:        polkit >= 0.111}
43 Requires:       rc-scripts >= 0.4.3.0
44 Requires:       systemd-units >= 38
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         usbdropdir      /usr/%{_lib}/pcsc/drivers
48
49 %description
50 pcscd is the daemon program for PC/SC Lite. It is a resource manager
51 that coorinates communications with Smart Card readers and Smart Cards
52 that are connected to the system. The purpose of PCSC Lite is to
53 provide a Windows(R) SCard interface in a very small form factor for
54 communicating to smartcards and readers. PCSC Lite uses the same
55 winscard api as used under Windows(R).
56
57 %description -l pl.UTF-8
58 pcscd jest demonem dla PC/SC Lite. Jest to zarządca zasobów,
59 koordynujący komunikację z czytnikami kart procesorowych podłączonymi
60 do systemu. Celem PCSC Lite jest udostępnienie interfejsu zgodnego z
61 Windows(R) SCard służącego do komunikacji z czytnikami kart chipowych.
62 Używa tego samego API winscard, które jest używane pod Microsoft(TM)
63 Windows(R).
64
65 %package libs
66 Summary:        PC/SC Lite libraries
67 Summary(pl.UTF-8):      Biblioteki PC/SC Lite
68 Group:          Libraries
69
70 %description libs
71 PC/SC Lite libraries.
72
73 %description libs -l pl.UTF-8
74 Biblioteki PC/SC Lite.
75
76 %package devel
77 Summary:        PC/SC Lite development files
78 Summary(pl.UTF-8):      Pliki dla programistów używających PC/SC Lite
79 Group:          Development/Libraries
80 Requires:       %{name}-libs = %{version}-%{release}
81
82 %description devel
83 PC/SC Lite development files.
84
85 %description devel -l pl.UTF-8
86 Pliki dla programistów używających PC/SC Lite.
87
88 %package static
89 Summary:        Static PC/SC Lite libraries
90 Summary(pl.UTF-8):      Biblioteki statyczne PC/SC Lite
91 Group:          Development/Libraries
92 Requires:       %{name}-devel = %{version}-%{release}
93
94 %description static
95 Static PC/SC Lite libraries.
96
97 %description static -l pl.UTF-8
98 Statyczne biblioteki PC/SC Lite.
99
100 %package apidocs
101 Summary:        PC/SC Lite API documentation
102 Summary(pl.UTF-8):      Dokumentacja API biblioteki PC/SC Lite
103 Group:          Documentation
104
105 %description apidocs
106 API and internal documentation for PC/SC Lite library.
107
108 %description apidocs -l pl.UTF-8
109 Dokumentacja API biblioteki PC/SC Lite.
110
111 %prep
112 %setup -q
113 %patch1 -p1
114 %patch2 -p1
115
116 %{__sed} -i -e '1s, /usr/bin/python$,%{__python3},' src/spy/pcsc-spy
117
118 %build
119 %{__libtoolize}
120 %{__aclocal} -I m4
121 %{__autoconf}
122 %{__autoheader}
123 %{__automake}
124 # auto power down unreliable yet
125 CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON"
126 %configure \
127         %{!?with_systemd:--disable-libsystemd} \
128         %{!?with_udev:--disable-libudev} \
129         --disable-silent-rules \
130         --enable-ipcdir=/var/run/pcscd \
131         %{?with_polkit:--enable-polkit} \
132         --enable-static \
133         --enable-usbdropdir=%{usbdropdir}
134
135 %{__make}
136
137 %if %{with apidocs}
138 doxygen doc/doxygen.conf
139 rm -f doc/api/*.{map,md5}
140 %endif
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144 install -d $RPM_BUILD_ROOT%{usbdropdir} \
145         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
146         $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \
147         $RPM_BUILD_ROOT/var/run/pcscd \
148         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
149         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
150
151 %{__make} install \
152         DESTDIR=$RPM_BUILD_ROOT
153
154 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
155
156 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
157 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
158 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
159
160 cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
161
162 %clean
163 rm -rf $RPM_BUILD_ROOT
164
165 %pretrans
166 # upgrade from pcsc-lite < 1.2.9-0.beta7
167 if [ -f /etc/reader.conf -a ! -f %{_sysconfdir}/reader.conf.d/reader.conf ]; then
168         install -d -m755 %{_sysconfdir}/reader.conf.d
169         cp -af /etc/reader.conf %{_sysconfdir}/reader.conf.d/reader.conf
170 fi
171
172 %post
173 /sbin/chkconfig --add pcscd
174 %service pcscd restart "PC/SC smart card daemon"
175 %systemd_post pcscd.service pcscd.socket
176
177 %preun
178 if [ "$1" = "0" ]; then
179         %service pcscd stop
180         /sbin/chkconfig --del pcscd
181 fi
182 %systemd_preun pcscd.service pcscd.socket
183
184 %postun
185 %systemd_reload
186
187 %triggerpostun -- pcsc-lite < 1.8.3-1
188 %systemd_trigger pcscd.service pcscd.socket
189
190 %post   libs -p /sbin/ldconfig
191 %postun libs -p /sbin/ldconfig
192
193 %files
194 %defattr(644,root,root,755)
195 %doc AUTHORS COPYING ChangeLog HELP README SECURITY TODO doc/README.polkit
196 %attr(755,root,root) %{_bindir}/pcsc-spy
197 %attr(755,root,root) %{_sbindir}/pcscd
198 %dir %{_libdir}/pcsc
199 %dir %{_libdir}/pcsc/drivers
200 %dir %{_sysconfdir}/reader.conf.d
201 %attr(754,root,root) /etc/rc.d/init.d/pcscd
202 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd
203 %{_mandir}/man1/pcsc-spy.1*
204 %{_mandir}/man5/reader.conf.5*
205 %{_mandir}/man8/pcscd.8*
206 %dir /var/run/pcscd
207 %{systemdunitdir}/pcscd.service
208 %{systemdunitdir}/pcscd.socket
209 /usr/lib/tmpfiles.d/%{name}.conf
210 %if %{with polkit}
211 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
212 %endif
213
214 %files libs
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
217 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
218 %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.*
219 %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0
220
221 %files devel
222 %defattr(644,root,root,755)
223 %attr(755,root,root) %{_libdir}/libpcsclite.so
224 %attr(755,root,root) %{_libdir}/libpcscspy.so
225 %{_libdir}/libpcsclite.la
226 %{_libdir}/libpcscspy.la
227 %{_includedir}/PCSC
228 %{_pkgconfigdir}/libpcsclite.pc
229 %{_examplesdir}/%{name}-%{version}
230
231 %files static
232 %defattr(644,root,root,755)
233 %{_libdir}/libpcsclite.a
234 %{_libdir}/libpcscspy.a
235
236 %if %{with apidocs}
237 %files apidocs
238 %defattr(644,root,root,755)
239 %doc doc/api/*
240 %endif
This page took 0.083183 seconds and 3 git commands to generate.