File ypbind.spec of Package ypbind

#
# spec file for package ypbind
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           ypbind
BuildRequires:  dbus-1-devel openslp-devel pkgconfig
%if %{suse_version} > 1010
BuildRequires:  dbus-1-glib-devel
%endif
License:        GPLv2
Group:          Productivity/Networking/NIS
Requires:       portmap yp-tools
AutoReqProv:    on
PreReq:         %insserv_prereq %fillup_prereq
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Version:        1.33
Release:        1
Url:            http://www.linux-nis.org/nis/ypbind-mt
Summary:        NIS client daemon
Source:         ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
Source1:        SuSEfirewall.ypbind
#Patch:          ypbind-mt-%{version}.diff
Patch1:         ypbind-mt-update-networkmanager-interface-to-use-new-nm_state

%description
This package provides the ypbind daemon. The ypbind daemon binds NIS
clients to an NIS domain and searches a new NIS server if the old one
goes down.

Ypbind must be running on any machines which are running NIS client
programs.



Authors:
--------
    Thorsten Kukuk <kukuk@suse.de>

%prep
%setup -q -n ypbind-mt-%{version}
#%patch
%patch1 -p1

%build
export CFLAGS=$RPM_OPT_FLAGS
./configure --mandir=%{_mandir} --enable-dbus-nm
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/var/adm/fillup-templates
mkdir -p $RPM_BUILD_ROOT/var/yp/binding
make install DESTDIR=$RPM_BUILD_ROOT
# Install init script
install -m 755 etc/ypbind.init $RPM_BUILD_ROOT/etc/init.d/ypbind
# Install SuSEfirewall2 service file
install -m 644 %SOURCE1 $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/ypbind
# Install rc.config add-on
install -m 644 etc/sysconfig.ypbind $RPM_BUILD_ROOT/var/adm/fillup-templates/
# Install SuSEconfig.ypclient
ln -sf /etc/init.d/ypbind $RPM_BUILD_ROOT/usr/sbin/rcypbind
# Create dummy yp.conf
touch $RPM_BUILD_ROOT/etc/yp.conf
# Create filelist with translatins
%{find_lang} ypbind-mt

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%post
%{fillup_and_insserv ypbind}

%preun
%stop_on_removal ypbind
if [ "$1" = "0" ]; then
   rm -f var/yp/binding/*
fi
exit 0

%postun
%restart_on_update ypbind
%insserv_cleanup
exit 0

%files -f ypbind-mt.lang
%defattr(-,root,root)
%doc AUTHORS NEWS README THANKS
%ghost %config(noreplace) /etc/yp.conf
%config /etc/init.d/ypbind
%config /etc/sysconfig/SuSEfirewall2.d/services/ypbind
/var/adm/fillup-templates/sysconfig.ypbind
%doc %{_mandir}/man5/yp.conf.5.gz
%doc %{_mandir}/man8/ypbind.8.gz
/usr/sbin/rcypbind
/usr/sbin/ypbind
#%dir /usr/share/locale/de
#%dir /usr/share/locale/de/LC_MESSAGES
#/usr/share/locale/de/LC_MESSAGES/ypbind-mt.mo
%dir /var/yp
%dir /var/yp/binding

%changelog
openSUSE Build Service is sponsored by