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