File ypserv.spec of Package ypserv

#
# spec file for package ypserv
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           ypserv
BuildRequires:  gdbm-devel
BuildRequires:  openslp-devel
Requires:       gawk
Requires:       make
Requires:       portmap
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Version:        2.28
Release:        0
Url:            http://www.linux-nis.org/nis/ypserv/
Summary:        YP - (NIS)-Server
License:        GPL-2.0
Group:          Productivity/Networking/NIS
PreReq:         %insserv_prereq %fillup_prereq
Source:         ypserv-%{version}.tar.bz2
Source1:        ypserv.init
Source2:        yppasswdd.init
Source3:        ypxfrd.init
Source4:        sysconfig.ypserv
Source5:        SuSEfirewall2.ypserv
Patch:          ypserv-%{version}.diff

%description
Configure your Linux PC as a YP server (NIS) using this package.



%prep
%setup -q
%patch

%build
export CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{_prefix} --enable-fqdn --mandir=%{_mandir}
make

%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
DOCDIR=%{_defaultdocdir}/yp
install -d -m 755 $RPM_BUILD_ROOT${DOCDIR}
install -d -m 755 $RPM_BUILD_ROOT${DOCDIR}/ypserv
make install DESTDIR=$RPM_BUILD_ROOT
#install contrib/ypslave $RPM_BUILD_ROOT/usr/sbin/
install -m 644 etc/ypserv.conf $RPM_BUILD_ROOT/etc/
install -m 644 etc/securenets $RPM_BUILD_ROOT/var/yp
install -m 755 %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/ypserv
install -m 755 %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/yppasswdd
install -m 755 %SOURCE3 $RPM_BUILD_ROOT/etc/init.d/ypxfrd
# install sysconfig.ypserv
install -m 644 %SOURCE4 $RPM_BUILD_ROOT/var/adm/fillup-templates/
ln -sf ../../etc/init.d/yppasswdd	$RPM_BUILD_ROOT/usr/sbin/rcyppasswdd
ln -sf ../../etc/init.d/ypxfrd		$RPM_BUILD_ROOT/usr/sbin/rcypxfrd
ln -sf ../../etc/init.d/ypserv   	$RPM_BUILD_ROOT/usr/sbin/rcypserv
# install SuSEfirewall2 service script
install -m 644 %SOURCE5 $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/ypserv
# Remove files which should not be included:
rm $RPM_BUILD_ROOT/usr/lib/yp/match_printcap

%clean
rm -rf $RPM_BUILD_ROOT

%post
%{fillup_and_insserv ypserv ypxfrd yppasswdd}

%preun
%stop_on_removal ypserv ypxfrd yppasswdd

%postun
%restart_on_update ypserv ypxfrd yppasswdd
%insserv_cleanup

%files
%defattr(-,root,root)
%doc NEWS README TODO COPYING ChangeLog
/var/adm/fillup-templates/sysconfig.ypserv
%config /etc/init.d/yppasswdd
%config /etc/init.d/ypserv
%config /etc/init.d/ypxfrd
%config(noreplace) /var/yp/Makefile
%config(noreplace) /var/yp/securenets
%config(noreplace) /etc/ypserv.conf
%config /etc/sysconfig/SuSEfirewall2.d/services/ypserv
%dir /usr/lib/yp
%dir /var/yp
%doc %{_mandir}/man5/netgroup.5.gz
%doc %{_mandir}/man5/ypserv.conf.5.gz
%doc %{_mandir}/man8/makedbm.8.gz
%doc %{_mandir}/man8/mknetid.8.gz
%doc %{_mandir}/man8/pwupdate.8.gz
%doc %{_mandir}/man8/revnetgroup.8.gz
%doc %{_mandir}/man8/rpc.yppasswdd.8.gz
%doc %{_mandir}/man8/rpc.ypxfrd.8.gz
%doc %{_mandir}/man8/yphelper.8.gz
%doc %{_mandir}/man8/ypinit.8.gz
%doc %{_mandir}/man8/yppasswdd.8.gz
%doc %{_mandir}/man8/yppush.8.gz
%doc %{_mandir}/man8/ypserv.8.gz
%doc %{_mandir}/man8/ypxfr.8.gz
%doc %{_mandir}/man8/ypxfrd.8.gz
/usr/include/rpcsvc/ypxfrd.x
/usr/lib/yp/makedbm
/usr/lib/yp/create_printcap
/usr/lib/yp/mknetid
/usr/lib/yp/pwupdate
/usr/lib/yp/revnetgroup
/usr/lib/yp/yphelper
/usr/lib/yp/ypinit
/usr/lib/yp/ypxfr
/usr/lib/yp/ypxfr_*
/usr/sbin/rcyppasswdd
/usr/sbin/rcypserv
/usr/sbin/rcypxfrd
/usr/sbin/rpc.ypxfrd
/usr/sbin/rpc.yppasswdd
/usr/sbin/yppush
/usr/sbin/ypserv
#/usr/sbin/ypslave

%changelog
openSUSE Build Service is sponsored by