3caeb8
Name:			openslp
3caeb8
Version:		2.0.0
3caeb8
Release:		7%{?dist}
3caeb8
Epoch:			1
3caeb8
Summary:		Open implementation of Service Location Protocol V2
3caeb8
3caeb8
Group:			System Environment/Libraries
3caeb8
License:		BSD
3caeb8
URL:			http://www.openslp.org
3caeb8
Source0:		http://downloads.sourceforge.net/openslp/%{name}-%{version}.tar.gz
3caeb8
# Source1,2: simple man pages (slightly modified help2man output)
3caeb8
Source1:		slpd.8.gz
3caeb8
Source2:		slptool.1.gz
3caeb8
# Source3: service file
3caeb8
Source3:		slpd.service
3caeb8
BuildRoot:		%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
3caeb8
3caeb8
# Patch0: creates script from upstream init script that sets multicast
3caeb8
#     prior to the start of the service
3caeb8
Patch0:			openslp-2.0.0-multicast-set.patch
3caeb8
# Patch1: fixes buffer overflow, rhbz#1181474
3caeb8
Patch1:			openslp-2.0.0-fortify-source-buffer-overflow.patch
3caeb8
# Patch2: fixes heap memory corruption in slpd/slpd_process.c, which allows
3caeb8
#   denial of service or potentially code execution,
3caeb8
#   backported form upstream, CVE-2017-17833
3caeb8
Patch2:  openslp-2.0.0-cve-2017-17833.patch
3caeb8
3caeb8
BuildRequires:		bison flex openssl-devel doxygen
3caeb8
BuildRequires:		automake libtool
3caeb8
BuildRequires:		systemd-units
3caeb8
3caeb8
%description
3caeb8
Service Location Protocol is an IETF standards track protocol that
3caeb8
provides a framework to allow networking applications to discover the
3caeb8
existence, location, and configuration of networked services in
3caeb8
enterprise networks.
3caeb8
3caeb8
OpenSLP is an open source implementation of the SLPv2 protocol as defined
3caeb8
by RFC 2608 and RFC 2614.
3caeb8
3caeb8
%package server
3caeb8
Summary:		OpenSLP server daemon
3caeb8
Group:			System Environment/Daemons
3caeb8
Requires:		%{name} = %{epoch}:%{version}-%{release}
3caeb8
Requires:		/bin/netstat
3caeb8
Requires(preun):	chkconfig, /sbin/service
3caeb8
Requires(post):		chkconfig
3caeb8
Requires(postun):	/sbin/service
3caeb8
3caeb8
%description server
3caeb8
Service Location Protocol is an IETF standards track protocol that
3caeb8
provides a framework that allows networking applications to discover
3caeb8
the existence, location, and configuration of networked services in
3caeb8
enterprise networks.
3caeb8
3caeb8
This package contains the SLP server. Every system, which provides any
3caeb8
services that should be used via an SLP client must run this server and
3caeb8
register the service.
3caeb8
3caeb8
%package devel
3caeb8
Summary:		OpenSLP headers and libraries
3caeb8
Group:			Development/Libraries
3caeb8
Requires:		%{name} = %{epoch}:%{version}-%{release}
3caeb8
3caeb8
%description devel
3caeb8
Service Location Protocol is an IETF standards track protocol that
3caeb8
provides a framework that allows networking applications to discover
3caeb8
the existence, location, and configuration of networked services in
3caeb8
enterprise networks.
3caeb8
3caeb8
This package contains header and library files to compile applications
3caeb8
with SLP support. It also contains developer documentation to develop
3caeb8
such applications.
3caeb8
3caeb8
%prep
3caeb8
%setup -q
3caeb8
%patch0 -p1 -b .multicast-set
3caeb8
%patch1 -p1 -b .fortify-source-buffer-overflow
3caeb8
%patch2 -p1 -b .cve-2017-17833
3caeb8
3caeb8
3caeb8
%build
3caeb8
export CFLAGS="-fPIC -fno-strict-aliasing -fPIE -DPIE $RPM_OPT_FLAGS"
3caeb8
export LDFLAGS="-pie -Wl,-z,now"
3caeb8
%configure \
3caeb8
  --prefix=%{_prefix} \
3caeb8
  --libdir=%{_libdir} \
3caeb8
  --sysconfdir=%{_sysconfdir} \
3caeb8
  --enable-async-api \
3caeb8
  --disable-rpath \
3caeb8
  --enable-slpv2-security \
3caeb8
  --localstatedir=/var
3caeb8
make %{?_smp_mflags}
3caeb8
3caeb8
3caeb8
%install
3caeb8
rm -rf $RPM_BUILD_ROOT
3caeb8
make install DESTDIR=$RPM_BUILD_ROOT
3caeb8
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/slp.reg.d
3caeb8
# install script that sets multicast
3caeb8
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/%{name}-server
3caeb8
install -m 0755 etc/slpd.all_init ${RPM_BUILD_ROOT}/usr/lib/%{name}-server/slp-multicast-set.sh
3caeb8
# install service file
3caeb8
mkdir -p ${RPM_BUILD_ROOT}/%{_unitdir}
3caeb8
install -p -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}/%{_unitdir}/slpd.service
3caeb8
# install man page
3caeb8
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man8/
3caeb8
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man1/
3caeb8
cp %SOURCE1 ${RPM_BUILD_ROOT}/%{_mandir}/man8/
3caeb8
cp %SOURCE2 ${RPM_BUILD_ROOT}/%{_mandir}/man1/
3caeb8
rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.a
3caeb8
rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.la
3caeb8
3caeb8
3caeb8
%clean
3caeb8
rm -rf $RPM_BUILD_ROOT
3caeb8
3caeb8
3caeb8
%post -p /sbin/ldconfig
3caeb8
3caeb8
%postun -p /sbin/ldconfig
3caeb8
3caeb8
%post server
3caeb8
%systemd_post slpd.service
3caeb8
3caeb8
%postun server
3caeb8
%systemd_postun_with_restart slpd.service
3caeb8
3caeb8
%preun server
3caeb8
%systemd_preun slpd.service
3caeb8
3caeb8
3caeb8
%files
3caeb8
%defattr(-,root,root,-)
3caeb8
%doc AUTHORS COPYING ChangeLog NEWS README
3caeb8
%doc doc/doc/*
3caeb8
%{_libdir}/libslp.so.*
3caeb8
%{_bindir}/slptool
3caeb8
%config(noreplace) %{_sysconfdir}/slp.conf
3caeb8
%config(noreplace) %{_sysconfdir}/slp.spi
3caeb8
%{_mandir}/man1/*
3caeb8
3caeb8
%files server
3caeb8
%defattr(-,root,root,-)
3caeb8
%dir /%{_sysconfdir}/slp.reg.d/
3caeb8
%dir /usr/lib/%{name}-server
3caeb8
/usr/lib/%{name}-server/slp-multicast-set.sh
3caeb8
%{_sbindir}/slpd
3caeb8
%config(noreplace) %{_sysconfdir}/slp.reg
3caeb8
%{_unitdir}/slpd.service
3caeb8
%{_mandir}/man8/*
3caeb8
3caeb8
%files devel
3caeb8
%defattr(-,root,root,-)
3caeb8
%{_includedir}/slp.h
3caeb8
%{_libdir}/libslp.so
3caeb8
3caeb8
3caeb8
%changelog
3caeb8
* Tue Jul 03 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-7
3caeb8
- Fix possible heap memory corruption, CVE-2017-17833
3caeb8
  Resolves: #1575698
3caeb8
3caeb8
* Tue Jun 28 2016 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-6
3caeb8
- Fix buffer overflow termination of slpd with -D_FORTIFY_SOURCE=2
3caeb8
  Resolves: #1181474
3caeb8
3caeb8
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1:2.0.0-5
3caeb8
- Mass rebuild 2014-01-24
3caeb8
3caeb8
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1:2.0.0-4
3caeb8
- Mass rebuild 2013-12-27
3caeb8
3caeb8
* Wed Oct 16 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-3
3caeb8
- Fix full relro
3caeb8
  Resolves: #881226
3caeb8
3caeb8
* Mon Jul 15 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-2
3caeb8
- Fix -devel requires
3caeb8
3caeb8
* Tue Jun 25 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-1
3caeb8
- Update to openslp-2.0.0
3caeb8
- Add systemd support
3caeb8
- Require /bin/netstat
3caeb8
3caeb8
* Wed May 15 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.3.beta2
3caeb8
- Add man pages for slptool and slpd
3caeb8
- Add CFLAGS and LDFLAGS for full relro
3caeb8
3caeb8
* Thu Jul 28 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.2.beta2
3caeb8
- Build with -fno-strict-aliasing
3caeb8
3caeb8
* Wed Jul 20 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.1.beta2
3caeb8
- Fix N-V-R
3caeb8
3caeb8
* Wed Jul 20 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.beta2-2
3caeb8
- Build
3caeb8
3caeb8
* Tue Jul 19 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.beta2-1
3caeb8
- Initial support