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