Accepting request 291145 from security:chipcard

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/291145
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pcsc-lite?expand=0&rev=64
This commit is contained in:
Dominique Leuenberger 2015-03-19 19:43:41 +00:00 committed by Git OBS Bridge
commit 00283664f8
2 changed files with 77 additions and 83 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Mar 10 08:41:26 UTC 2015 - tchvatal@suse.com
- Cleanup with the spec-cleaner
- Reduce some conditionals
- Fix few rpmlint warnings
- Add Requires on libpcs1 for main package wrt bnc#782368
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 14 09:18:56 UTC 2014 - dimstar@opensuse.org Fri Nov 14 09:18:56 UTC 2014 - dimstar@opensuse.org

View File

@ -1,7 +1,7 @@
# #
# spec file for package pcsc-lite # spec file for package pcsc-lite
# #
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,34 +16,17 @@
# #
Name: pcsc-lite
# FIXME: Maybe we should use /usr/lib/pcsc/drivers as others do: # FIXME: Maybe we should use /usr/lib/pcsc/drivers as others do:
%define ifddir %{_libdir}/readers %define ifddir %{_libdir}/readers
BuildRequires: gcc %define USER scard
BuildRequires: libtool %define GROUP scard
BuildRequires: pkg-config Name: pcsc-lite
BuildRequires: readline-devel
%if %suse_version > 1310
BuildRequires: polkit-devel
%endif
%if %suse_version >= 1120
BuildRequires: libudev-devel
%endif
%if %suse_version <= 1110
# libusb is an inferior method of USB enumeration, as it introduces polling
BuildRequires: libusb-1_0-devel
%endif
%if %suse_version > 1140
BuildRequires: systemd
%{?systemd_requires}
%endif
Version: 1.8.13 Version: 1.8.13
Release: 0 Release: 0
Requires(pre): pwdutils
Url: http://pcsclite.alioth.debian.org/
Summary: PCSC Smart Cards Library Summary: PCSC Smart Cards Library
License: BSD-3-Clause License: BSD-3-Clause
Group: Productivity/Security Group: Productivity/Security
Url: http://pcsclite.alioth.debian.org/
Source: %{name}-%{version}.tar.bz2 Source: %{name}-%{version}.tar.bz2
Source1: %{name}.sysconfig Source1: %{name}.sysconfig
Source2: README.SUSE Source2: README.SUSE
@ -54,14 +37,29 @@ Source6: pcsc-lite-reader-conf
Source7: %{name}-%{version}.tar.bz2.asc Source7: %{name}-%{version}.tar.bz2.asc
Source8: %{name}.keyring Source8: %{name}.keyring
Patch0: systemd-service.patch Patch0: systemd-service.patch
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: readline-devel
Requires: libpcsclite1 = %{version}
Requires(post): %fillup_prereq Requires(post): %fillup_prereq
%if %suse_version < 1310 Requires(pre): pwdutils
PreReq: sysvinit(syslog)
Requires(post): %insserv_prereq
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define USER scard %if 0%{?suse_version} > 1310
%define GROUP scard BuildRequires: polkit-devel
%endif
%if 0%{?suse_version} >= 1120
BuildRequires: libudev-devel
%else
BuildRequires: libusb-1_0-devel
%endif
%if 0%{?suse_version} > 1140
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%else
Requires(post): %insserv_prereq
Requires(post): sysvinit(syslog)
%endif
%description %description
The purpose of PCSC Lite is to provide a Windows(R) SCard interface in The purpose of PCSC Lite is to provide a Windows(R) SCard interface in
@ -80,7 +78,6 @@ Memory cards will be supported through the MCT specification, which is
an APDU like manner sent normally through the SCardTransmit() function. an APDU like manner sent normally through the SCardTransmit() function.
This functionality is exercised in the driver. This functionality is exercised in the driver.
%package -n libpcsclite1 %package -n libpcsclite1
Summary: PCSC Smart Card Library Summary: PCSC Smart Card Library
License: BSD-3-Clause License: BSD-3-Clause
@ -104,7 +101,6 @@ Memory cards will be supported through the MCT specification, which is
an APDU like manner sent normally through the SCardTransmit() function. an APDU like manner sent normally through the SCardTransmit() function.
This functionality is exercised in the driver. This functionality is exercised in the driver.
%package -n libpcscspy0 %package -n libpcscspy0
Summary: PCSC Smart Card Library Summary: PCSC Smart Card Library
License: GPL-3.0+ License: GPL-3.0+
@ -113,77 +109,71 @@ Group: System/Libraries
%description -n libpcscspy0 %description -n libpcscspy0
Supporting library for the PC/SC spy tool. Supporting library for the PC/SC spy tool.
%package devel %package devel
Summary: Development package for the MUSCLE project SmartCards library Summary: Development package for the MUSCLE project SmartCards library
License: BSD-3-Clause and GPL-3.0+ License: BSD-3-Clause and GPL-3.0+
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}
Requires: glibc-devel Requires: glibc-devel
Requires: libpcsclite1 = %{version}-%{release} Requires: libpcsclite1 = %{version}
Requires: libpcscspy0 = %{version}-%{release} Requires: libpcscspy0 = %{version}
%description devel %description devel
This package contains the development files for pcsc-lite. It allows to This package contains the development files for pcsc-lite. It allows to
compile plugins for the pcsc-lite package. compile plugins for the pcsc-lite package.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
cp -a %{S:1} %{S:2} %{S:5} %{S:6} . cp -a %{SOURCE1} %{SOURCE2} %{SOURCE5} %{SOURCE6} .
%build %build
%configure\ %configure\
--docdir=%{_docdir}/%{name} \ --docdir=%{_docdir}/%{name} \
--enable-usbdropdir=%{ifddir} \ --enable-usbdropdir=%{ifddir} \
--disable-libhal \ %if 0%{?suse_version} <= 1110
%if %suse_version <= 1110
--disable-libudev \ --disable-libudev \
%endif %endif
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
--with-systemdsystemunitdir=%_unitdir \ --with-systemdsystemunitdir=%{_unitdir} \
%endif %endif
%if %suse_version > 1310 %if 0%{?suse_version} > 1310
--enable-polkit \ --enable-polkit \
%endif %endif
--disable-static --disable-static
make %{?jobs:-j%jobs} make %{?_smp_mflags}
%install %install
%makeinstall make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p $RPM_BUILD_ROOT%{ifddir} mkdir -p %{buildroot}%{ifddir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/ mkdir -p %{buildroot}%{_sysconfdir}/reader.conf.d/
sed s:@ifddir@:%{ifddir}: <pcsc-lite-reader-conf >$RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/reader.conf sed s:@ifddir@:%{ifddir}: <pcsc-lite-reader-conf >%{buildroot}%{_sysconfdir}/reader.conf.d/reader.conf
# this program is noinst in the package %if 0%{?suse_version} < 1310
#install src/.libs/testpcsc $RPM_BUILD_ROOT%{_sbindir}/ install -D -m 755 pcsc-lite-init %{buildroot}%{_initddir}/pcscd
%if %suse_version < 1310 ln -sf %{_initddir}/pcscd %{buildroot}%{_sbindir}/rcpcscd
install -D -m 755 pcsc-lite-init $RPM_BUILD_ROOT%{_initrddir}/pcscd
ln -sf %{_initrddir}/pcscd $RPM_BUILD_ROOT%{_sbindir}/rcpcscd
%else %else
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcpcscd ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcpcscd
%endif %endif
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
cp %{name}.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pcscd cp %{name}.sysconfig %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.pcscd
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name} mkdir -p %{buildroot}%{_docdir}/%{name}
cp -a AUTHORS ChangeLog ChangeLog.svn COPYING DRIVERS HELP NEWS README README.SUSE SECURITY TODO $RPM_BUILD_ROOT%{_docdir}/%{name} cp -a AUTHORS ChangeLog ChangeLog.svn COPYING DRIVERS HELP NEWS README README.SUSE SECURITY TODO %{buildroot}%{_docdir}/%{name}
# Use socket activated pcscd by default. # Use socket activated pcscd by default.
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system-preset mkdir -p %{buildroot}%{_libexecdir}/systemd/system-preset
echo -e 'enable pcscd.socket\nenable pcscd.service' >$RPM_BUILD_ROOT/usr/lib/systemd/system-preset/50-pcscd.preset echo -e 'enable pcscd.socket\nenable pcscd.service' >%{buildroot}%{_libexecdir}/systemd/system-preset/50-pcscd.preset
%endif %endif
# Remove useless la files
%clean find %{buildroot} -type f -name "*.la" -delete -print
rm -rf $RPM_BUILD_ROOT
%pre %pre
getent group %{GROUP} >/dev/null || groupadd -r %{GROUP} getent group %{GROUP} >/dev/null || groupadd -r %{GROUP}
getent passwd %{USER} >/dev/null || useradd -r -g %{GROUP} -s /usr/sbin/nologin -c "Smart Card Reader" -d /var/run/pcscd %{USER} getent passwd %{USER} >/dev/null || useradd -r -g %{GROUP} -s %{_sbindir}/nologin -c "Smart Card Reader" -d %{_localstatedir}/run/pcscd %{USER}
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
%service_add_pre pcscd.service pcscd.socket %service_add_pre pcscd.service pcscd.socket
# trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset. # trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset.
if [ $1 -gt 1 ] ; then if [ $1 -gt 1 ] ; then
if ! test -f /usr/lib/systemd/system-preset/50-pcscd.preset ; then if ! test -f %{_libexecdir}/systemd/system-preset/50-pcscd.preset ; then
echo -n "" >/run/rpm-%{name}-update-pcscd.socket-new-in-upgrade echo -n "" >/run/rpm-%{name}-update-pcscd.socket-new-in-upgrade
echo -n "" >/run/rpm-%{name}-update-pcscd.service-new-in-upgrade echo -n "" >/run/rpm-%{name}-update-pcscd.service-new-in-upgrade
fi fi
@ -191,32 +181,30 @@ fi
%endif %endif
%post %post
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
%service_add_post pcscd.service pcscd.socket %service_add_post pcscd.service pcscd.socket
%endif
%if %suse_version < 1310
%fillup_and_insserv -y -n pcscd pcscd
%else %else
%fillup_only -n pcscd %fillup_and_insserv -y -n pcscd pcscd
%endif %endif
%fillup_only -n pcscd
%preun %preun
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
%service_del_preun pcscd.service pcscd.socket %service_del_preun pcscd.service pcscd.socket
%endif %endif
%if %suse_version < 1310 %if 0%{?suse_version} < 1310
%stop_on_removal pcscd %stop_on_removal pcscd
%endif %endif
%postun %postun
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
%service_del_postun pcscd.service pcscd.socket %service_del_postun pcscd.service pcscd.socket
# make sure to reload systemd for possible downgrades # make sure to reload systemd for possible downgrades
if [ "$1" = "1" ]; then if [ "$1" = "1" ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi fi
%endif %endif
%if %suse_version < 1310 %if 0%{?suse_version} < 1310
%restart_on_update pcscd %restart_on_update pcscd
%insserv_cleanup %insserv_cleanup
%endif %endif
@ -249,17 +237,16 @@ fi
%dir %{_sysconfdir}/reader.conf.d %dir %{_sysconfdir}/reader.conf.d
%config(noreplace) %{_sysconfdir}/reader.conf.d/reader.conf %config(noreplace) %{_sysconfdir}/reader.conf.d/reader.conf
%{ifddir} %{ifddir}
%if %suse_version > 1140 %if 0%{?suse_version} > 1140
%_unitdir/* %{_unitdir}/*
/usr/lib/systemd/system-preset/ %{_libexecdir}/systemd/system-preset/
%else
%{_initddir}/pcscd
%endif %endif
%if %suse_version < 1310 %{_localstatedir}/adm/fillup-templates/sysconfig.pcscd
%{_initrddir}/pcscd
%endif
/var/adm/fillup-templates/sysconfig.pcscd
# libpcsclite.so should stay in the main package (#732911). Third party packages may need it for dlopen(). # libpcsclite.so should stay in the main package (#732911). Third party packages may need it for dlopen().
%{_libdir}/libpcsclite.so %{_libdir}/libpcsclite.so
%if %suse_version > 1310 %if 0%{?suse_version} > 1310
%{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
%endif %endif
@ -277,7 +264,6 @@ fi
%dir %{_docdir}/%{name} %dir %{_docdir}/%{name}
%{_docdir}/%{name}/Change* %{_docdir}/%{name}/Change*
%{_includedir}/* %{_includedir}/*
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so %{_libdir}/*.so
%{_bindir}/* %{_bindir}/*