You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

122 lines
3.9 KiB

##
## openslp.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2019 OpenPKG Project <http://openpkg.org/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: openslp
Summary: Service Location Protocol (SLP) Client & Server
URL: http://www.openslp.org/
Vendor: Caldera, Novell
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: EVAL
Group: Networking
License: BSD-style
Version: 1.2.1
Release: 20080101
# list of sources
Source0: http://download.sourceforge.net/openslp/openslp-%{version}.tar.gz
Source1: rc.openslp
Patch0: openslp.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101
PreReq: OpenPKG, openpkg >= 20160101
BuildPreReq: openssl
PreReq: openssl
%description
OpenSLP is an open-source implementation of the Service Location
Protocol (SLP) which is an IETF standards track protocol that
provides a framework to allow networking applications to discover
the existence, location, and configuration of networked services in
enterprise networks.
%track
prog openslp = {
version = %{version}
url = http://sourceforge.net/projects/openslp/files/
regex = openslp-(\d+\.[02468]\.\d+)\.tar\.gz
}
%prep
%setup -q
%patch -p0
%build
# configure program
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--sysconfdir=%{l_prefix}/etc/openslp \
--localstatedir=%{l_prefix}/var/openslp \
--disable-shared
# build program
%{l_make} %{l_mflags -O}
%install
# install program
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
# post-adjust installation
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
%{l_shtool} subst \
-e 's/^;\(net\.slp\.interfaces =\).*$/\1 127.0.0.1/' \
$RPM_BUILD_ROOT%{l_prefix}/etc/openslp/slp.conf
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/var/openslp
# install run-command script
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.openslp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%config %{l_prefix}/etc/openslp/*'
%files -f files
%clean
%post
# after upgrade, restart service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} openslp status 2>/dev/null`
[ ".$openslp_active" = .yes ] && %{l_rc} openslp restart
exit 0
%preun
# before erase, stop service and remove run-time files
[ $1 -eq 0 ] || exit 0
%{l_rc} openslp stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/openslp/* >/dev/null 2>&1 || true
exit 0