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