]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
- updated to 1.8.15
[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.15
14 Release:        1
15 License:        BSD
16 Group:          Daemons
17 # Source0Download: https://alioth.debian.org/frs/?group_id=30105
18 Source0:        https://alioth.debian.org/frs/download.php/file/4157/%{name}-%{version}.tar.bz2
19 # Source0-md5:  ded5cf2f78d26293934cefd0dbc58a43
20 Source1:        %{name}-pcscd.init
21 Source2:        %{name}-pcscd.sysconfig
22 Source4:        %{name}.tmpfiles
23 Patch0:         %{name}-fhs.patch
24 Patch1:         %{name}-any.patch
25 Patch2:         debuglog-pid.patch
26 Patch3:         configure-expand.patch
27 URL:            https://alioth.debian.org/projects/pcsclite/
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 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 %patch0 -p1
112 %patch1 -p1
113 %patch2 -p1
114 %patch3 -p1
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_udev:--disable-libudev} \
126         --disable-silent-rules \
127         --enable-ipcdir=/var/run/pcscd \
128         %{?with_polkit:--enable-polkit} \
129         --enable-static \
130         --enable-usbdropdir=%{usbdropdir}
131
132 %{__make}
133
134 %if %{with apidocs}
135 doxygen doc/doxygen.conf
136 rm -f doc/api/*.{map,md5}
137 %endif
138
139 %install
140 rm -rf $RPM_BUILD_ROOT
141 install -d $RPM_BUILD_ROOT%{usbdropdir} \
142         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
143         $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d \
144         $RPM_BUILD_ROOT/var/run/pcscd \
145         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
146         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
147
148 %{__make} install \
149         DESTDIR=$RPM_BUILD_ROOT
150
151 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
152
153 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
154 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
155 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
156
157 cp -p doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
158
159 %clean
160 rm -rf $RPM_BUILD_ROOT
161
162 %pretrans
163 # upgrade from pcsc-lite < 1.2.9-0.beta7
164 if [ -f /etc/reader.conf -a ! -f %{_sysconfdir}/reader.conf.d/reader.conf ]; then
165         install -d -m755 %{_sysconfdir}/reader.conf.d
166         cp -af /etc/reader.conf %{_sysconfdir}/reader.conf.d/reader.conf
167 fi
168
169 %post
170 /sbin/chkconfig --add pcscd
171 %service pcscd restart "PC/SC smart card daemon"
172 %systemd_post pcscd.service pcscd.socket
173
174 %preun
175 if [ "$1" = "0" ]; then
176         %service pcscd stop
177         /sbin/chkconfig --del pcscd
178 fi
179 %systemd_preun pcscd.service pcscd.socket
180
181 %postun
182 %systemd_reload
183
184 %triggerpostun -- pcsc-lite < 1.8.3-1
185 %systemd_trigger pcscd.service pcscd.socket
186
187 %post   libs -p /sbin/ldconfig
188 %postun libs -p /sbin/ldconfig
189
190 %files
191 %defattr(644,root,root,755)
192 %doc AUTHORS COPYING ChangeLog* DRIVERS HELP NEWS README SECURITY TODO doc/README.{DAEMON,polkit}
193 %attr(755,root,root) %{_bindir}/pcsc-spy
194 %attr(755,root,root) %{_sbindir}/pcscd
195 %dir %{_libdir}/pcsc
196 %dir %{_libdir}/pcsc/drivers
197 %dir %{_sysconfdir}/reader.conf.d
198 %attr(754,root,root) /etc/rc.d/init.d/pcscd
199 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd
200 %{_mandir}/man1/pcsc-spy.1*
201 %{_mandir}/man5/reader.conf.5*
202 %{_mandir}/man8/pcscd.8*
203 %dir /var/run/pcscd
204 %{systemdunitdir}/pcscd.service
205 %{systemdunitdir}/pcscd.socket
206 /usr/lib/tmpfiles.d/%{name}.conf
207 %if %{with polkit}
208 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
209 %endif
210
211 %files libs
212 %defattr(644,root,root,755)
213 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
214 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
215 %attr(755,root,root) %{_libdir}/libpcscspy.so.*.*.*
216 %attr(755,root,root) %ghost %{_libdir}/libpcscspy.so.0
217
218 %files devel
219 %defattr(644,root,root,755)
220 %attr(755,root,root) %{_libdir}/libpcsclite.so
221 %attr(755,root,root) %{_libdir}/libpcscspy.so
222 %{_libdir}/libpcsclite.la
223 %{_libdir}/libpcscspy.la
224 %{_includedir}/PCSC
225 %{_pkgconfigdir}/libpcsclite.pc
226 %{_examplesdir}/%{name}-%{version}
227
228 %files static
229 %defattr(644,root,root,755)
230 %{_libdir}/libpcsclite.a
231 %{_libdir}/libpcscspy.a
232
233 %if %{with apidocs}
234 %files apidocs
235 %defattr(644,root,root,755)
236 %doc doc/api/*
237 %endif
This page took 0.104519 seconds and 3 git commands to generate.