]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
258cf4987a1137e3311b3a97c237906fc6d93218
[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.0
16 Release:        1
17 License:        BSD
18 Group:          Daemons
19 Source0:        https://pcsclite.apdu.fr/files/%{name}-%{version}.tar.bz2
20 # Source0-md5:  eb595f2d398ff229207a6ec09fbc4e98
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 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_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 %patch3 -p1
115
116 %{__sed} -i -e '1s, /usr/bin/python$,%{__python},' 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.{DAEMON,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.818201 seconds and 2 git commands to generate.