]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite.spec
- fix missing sysconfdir expand
[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  hal     # use libusb instead of HAL
8
9 Summary:        PCSC Framework for Linux
10 Summary(pl.UTF-8):      Środowisko PCSC dla Linuksa
11 Name:           pcsc-lite
12 Version:        1.6.6
13 Release:        0.4
14 License:        BSD
15 Group:          Daemons
16 # Source0Download: http://alioth.debian.org/project/showfiles.php?group_id=30105
17 Source0:        http://alioth.debian.org/download.php/3479/%{name}-%{version}.tar.bz2
18 # Source0-md5:  f80d3ecd9569b71d557f283f16295c74
19 Source1:        %{name}-pcscd.init
20 Source2:        %{name}-pcscd.sysconfig
21 Patch0:         %{name}-fhs.patch
22 Patch1:         %{name}-any.patch
23 Patch2:         noautostart.patch
24 Patch3:         debuglog-pid.patch
25 Patch4:         configure-expand.patch
26 URL:            http://www.linuxnet.com/middle.html
27 BuildRequires:  autoconf >= 2.58
28 BuildRequires:  automake >= 1:1.8
29 BuildRequires:  flex
30 %{?with_apidocs:BuildRequires:  graphviz}
31 %{?with_hal:BuildRequires:      hal-devel}
32 BuildRequires:  libtool >= 2:2.0
33 %{!?with_hal:BuildRequires:     libusb-devel >= 1.0}
34 BuildRequires:  pkgconfig
35 BuildRequires:  rpmbuild(macros) >= 1.268
36 Requires(post,preun):   /sbin/chkconfig
37 Requires(pretrans):     fileutils
38 Requires:       rc-scripts >= 0.4.1.26
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         usbdropdir      /usr/%{_lib}/pcsc/drivers
42
43 %description
44 pcscd is the daemon program for PC/SC Lite. It is a resource manager
45 that coorinates communications with Smart Card readers and Smart Cards
46 that are connected to the system. The purpose of PCSC Lite is to
47 provide a Windows(R) SCard interface in a very small form factor for
48 communicating to smartcards and readers. PCSC Lite uses the same
49 winscard api as used under Windows(R).
50
51 %description -l pl.UTF-8
52 pcscd jest demonem dla PC/SC Lite. Jest to zarządca zasobów,
53 koordynujący komunikację z czytnikami kart procesorowych podłączonymi
54 do systemu. Celem PCSC Lite jest udostępnienie interfejsu zgodnego z
55 Windows(R) SCard służącego do komunikacji z czytnikami kart chipowych.
56 Używa tego samego API winscard, które jest używane pod Microsoft(TM)
57 Windows(R).
58
59 %package libs
60 Summary:        PC/SC Lite libraries
61 Summary(pl.UTF-8):      Biblioteki PC/SC Lite
62 Group:          Libraries
63
64 %description libs
65 PC/SC Lite libraries.
66
67 %description libs -l pl.UTF-8
68 Biblioteki PC/SC Lite.
69
70 %package devel
71 Summary:        PC/SC Lite development files
72 Summary(pl.UTF-8):      Pliki dla programistów używających PC/SC Lite
73 Group:          Development/Libraries
74 Requires:       %{name}-libs = %{version}-%{release}
75
76 %description devel
77 PC/SC Lite development files.
78
79 %description devel -l pl.UTF-8
80 Pliki dla programistów używających PC/SC Lite.
81
82 %package static
83 Summary:        Static PC/SC Lite libraries
84 Summary(pl.UTF-8):      Biblioteki statyczne PC/SC Lite
85 Group:          Development/Libraries
86 Requires:       %{name}-devel = %{version}-%{release}
87
88 %description static
89 Static PC/SC Lite libraries.
90
91 %description static -l pl.UTF-8
92 Statyczne biblioteki PC/SC Lite.
93
94 %package apidocs
95 Summary:        PC/SC Lite API documentation
96 Summary(pl.UTF-8):      Dokumentacja API biblioteki PC/SC Lite
97 Group:          Documentation
98
99 %description apidocs
100 API and internal documentation for PC/SC Lite library.
101
102 %description apidocs -l pl.UTF-8
103 Dokumentacja API biblioteki PC/SC Lite.
104
105 %prep
106 %setup -q
107 %patch0 -p1
108 %patch1 -p1
109 %patch2 -p1
110 %patch3 -p1
111 %patch4 -p1
112
113 %build
114 %{__libtoolize}
115 %{__aclocal} -I m4
116 %{__autoconf}
117 %{__autoheader}
118 %{__automake}
119 # auto power down unreliable yet
120 CPPFLAGS="%{rpmcppflags} -DDISABLE_ON_DEMAND_POWER_ON"
121 %configure \
122         %{!?with_hal:--disable-libhal} \
123         --enable-ipcdir=/var/run/pcscd \
124         --enable-static \
125         --enable-usbdropdir=%{usbdropdir}
126
127 %{__make}
128
129 %if %{with apidocs}
130 doxygen doc/doxygen.conf
131 rm -f doc/api/*.{map,md5}
132 %endif
133
134 %install
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT%{usbdropdir} \
137         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
138         $RPM_BUILD_ROOT/var/run/pcscd \
139         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
140
141 %{__make} install \
142         DESTDIR=$RPM_BUILD_ROOT
143
144 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
145
146 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pcscd
147 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pcscd
148
149 cp -a doc/example/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
150
151 rm -rf $RPM_BUILD_ROOT%{_prefix}/doc
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %pretrans
157 # upgrade from pcsc-lite < 1.2.9-0.beta7
158 if [ -f /etc/reader.conf -a ! -f /etc/reader.conf.d/reader.conf ]; then
159         install -d -m755 /etc/reader.conf.d
160         cp -af /etc/reader.conf /etc/reader.conf.d/reader.conf
161 fi
162
163 %post
164 /sbin/chkconfig --add pcscd
165 %service pcscd restart "PC/SC smart card daemon"
166
167 %preun
168 if [ "$1" = "0" ]; then
169         %service pcscd stop
170         /sbin/chkconfig --del pcscd
171 fi
172
173 %post   libs -p /sbin/ldconfig
174 %postun libs -p /sbin/ldconfig
175
176 %files
177 %defattr(644,root,root,755)
178 %doc AUTHORS COPYING ChangeLog* DRIVERS HELP NEWS README SECURITY TODO doc/README.DAEMON
179 %attr(755,root,root) %{_sbindir}/pcscd
180 %dir %{_libdir}/pcsc
181 %dir %{_libdir}/pcsc/drivers
182 %dir %{_sysconfdir}/reader.conf.d
183 %attr(754,root,root) /etc/rc.d/init.d/pcscd
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pcscd
185 %{_mandir}/man5/reader.conf.5*
186 %{_mandir}/man8/pcscd.8*
187 %dir /var/run/pcscd
188
189 %files libs
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{_libdir}/libpcsclite.so.*.*.*
192 %attr(755,root,root) %ghost %{_libdir}/libpcsclite.so.1
193
194 %files devel
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_libdir}/libpcsclite.so
197 %{_libdir}/libpcsclite.la
198 %{_includedir}/PCSC
199 %{_pkgconfigdir}/libpcsclite.pc
200 %{_examplesdir}/%{name}-%{version}
201
202 %files static
203 %defattr(644,root,root,755)
204 %{_libdir}/libpcsclite.a
205
206 %if %{with apidocs}
207 %files apidocs
208 %defattr(644,root,root,755)
209 %doc doc/api/*
210 %endif
This page took 0.044022 seconds and 4 git commands to generate.