Petr Gajdos 2014-06-09 08:37:53 +00:00 committed by Git OBS Bridge
parent 15f0aba705
commit 10c67627c8

View File

@ -17,14 +17,11 @@
Name: netcfg Name: netcfg
PreReq: coreutils aaa_base Version: 11.5
Release: 0
Summary: Network Configuration Files in /etc Summary: Network Configuration Files in /etc
License: BSD-3-Clause License: BSD-3-Clause
Group: System/Base Group: System/Base
Version: 11.5
Release: 0
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: defaultdomain Source0: defaultdomain
Source1: exports Source1: exports
Source2: ftpusers Source2: ftpusers
@ -46,37 +43,42 @@ Source100: services-compare.pl
Source101: services-compare.sh Source101: services-compare.sh
Source102: services-create.pl Source102: services-create.pl
Source103: services_UPDATING Source103: services_UPDATING
Patch: services-suse.diff Patch0: services-suse.diff
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: aaa_base
PreReq: coreutils
PreReq: permissions
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description %description
All of the basic configuration files for the network programs including All of the basic configuration files for the network programs including
/etc/aliases, /etc/protocols, and /etc/services. %{_sysconfdir}/aliases, %{_sysconfdir}/protocols, and %{_sysconfdir}/services.
These are often used by network routines in the C library and therefore These are often used by network routines in the C library and therefore
must be installed for all network programs. must be installed for all network programs.
%prep %prep
%build %build
cp %{S:16} . cp %{SOURCE16} .
%install %install
mkdir -p $RPM_BUILD_ROOT/etc mkdir -p %{buildroot}/etc
for i in hostname aliases defaultdomain exports ftpusers host.conf hosts hosts.allow hosts.deny hosts.equiv hosts.lpd netgroup networks protocols services.bz2 ethers; do for i in hostname aliases defaultdomain exports ftpusers host.conf hosts hosts.allow hosts.deny hosts.equiv hosts.lpd netgroup networks protocols services.bz2 ethers; do
install $RPM_SOURCE_DIR/$i $RPM_BUILD_ROOT/etc install $RPM_SOURCE_DIR/$i %{buildroot}/etc
done done
bunzip2 $RPM_BUILD_ROOT/etc/services.bz2 bunzip2 %{buildroot}%{_sysconfdir}/services.bz2
patch -p0 $RPM_BUILD_ROOT/etc/services < $RPM_SOURCE_DIR/services-suse.diff patch -p0 %{buildroot}%{_sysconfdir}/services < $RPM_SOURCE_DIR/services-suse.diff
rm -f $RPM_BUILD_ROOT/etc/services.orig rm -f %{buildroot}%{_sysconfdir}/services.orig
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
%pre %pre
if [ "0$1" -ge "2" ]; then if [ "0$1" -ge "2" ]; then
# If we have a /etc/netgroup.rpmsave and no /etc/netgroup, copy # If we have a /etc/netgroup.rpmsave and no /etc/netgroup, copy
# /etc/netgroup.rpmsave and use it later instead of the new one. # /etc/netgroup.rpmsave and use it later instead of the new one.
if [ -f /etc/netgroup.rpmsave -a ! -e /etc/netgroup ]; then if [ -f %{_sysconfdir}/netgroup.rpmsave -a ! -e %{_sysconfdir}/netgroup ]; then
cp /etc/netgroup.rpmsave /etc/...netgroup.new.rpmnew cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew
fi fi
fi fi
@ -90,22 +92,23 @@ exit 0
%files %files
%defattr(644,root,root,755) %defattr(644,root,root,755)
%verify(not md5 size mtime) %config(noreplace) /etc/hostname %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hostname
%verify(not md5 size mtime) %config(noreplace) /etc/aliases /etc/HOSTNAME
%verify(not md5 size mtime) %config(noreplace) /etc/defaultdomain %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/aliases
%verify(not md5 size mtime) %config(noreplace) /etc/ethers %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/defaultdomain
%verify(not md5 size mtime) %config(noreplace) /etc/exports %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ethers
%verify(not md5 size mtime) %config(noreplace) /etc/ftpusers %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/exports
%config(noreplace) /etc/host.conf %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ftpusers
%verify(not md5 size mtime) %config(noreplace) /etc/hosts %config(noreplace) %{_sysconfdir}/host.conf
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.allow %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.deny %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.allow
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.equiv %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.deny
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.lpd %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.equiv
%config(noreplace) /etc/netgroup %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.lpd
%config(noreplace) /etc/networks %config(noreplace) %{_sysconfdir}/netgroup
%config(noreplace) /etc/protocols %config(noreplace) %{_sysconfdir}/networks
%config(noreplace) /etc/services %config(noreplace) %{_sysconfdir}/protocols
%config(noreplace) %{_sysconfdir}/services
%doc COPYING %doc COPYING
%changelog %changelog