File netcfg.spec of Package netcfg.4368

# spec file for package netcfg
# Copyright (c) 2017 SUSE LINUX 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

Name:           netcfg
Version:        11.5
Release:        0
Summary:        Network Configuration Files in /etc
License:        BSD-3-Clause
Group:          System/Base
Source0:        defaultdomain
Source1:        exports
Source2:        ftpusers
Source3:        host.conf
Source4:        hosts
Source5:        hosts.allow
Source6:        hosts.deny
Source7:        hosts.equiv
Source8:        hosts.lpd
Source9:        networks
Source10:       protocols
Source11:       services.bz2
Source12:       hostname
Source13:       aliases
Source14:       ethers
Source15:       netgroup
Source16:       COPYING
Source103:      services_UPDATING
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

All of the basic configuration files for the network programs including
%{_sysconfdir}/aliases, %{_sysconfdir}/protocols, and %{_sysconfdir}/services.

These are often used by network routines in the C library and therefore
must be installed for all network programs.


cp %{SOURCE16} .

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
  install $RPM_SOURCE_DIR/$i %{buildroot}/etc
bunzip2 %{buildroot}%{_sysconfdir}/services.bz2
patch -p0 %{buildroot}%{_sysconfdir}/services < $RPM_SOURCE_DIR/services-suse.diff
rm -f %{buildroot}%{_sysconfdir}/services.orig
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME

if [ "0$1" -ge "2" ]; then
# If we have a /etc/netgroup.rpmsave and no /etc/netgroup, copy
# /etc/netgroup.rpmsave and use it later instead of the new one.
   if [ -f %{_sysconfdir}/netgroup.rpmsave -a ! -e %{_sysconfdir}/netgroup ]; then
      cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/
#/etc/HOSTNAME renamed to /etc/hostname [bnc#858908]
#On Tue, Jun 10, 2014 at 03:23:00PM +0200, Frederic Crozat wrote:
#> So, it means netcfg should have a %pre which check if /etc/HOSTNAME is a
#> filename (and not a symlink) and in that case, rename the file
#> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created
#> by RPM.
if [ "0$1" -ge "2" ]; then
  if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then
    if [ -f /etc/hostname ]; then
      mv /etc/hostname /etc/hostname.rpmsave
    ln -f /etc/HOSTNAME /etc/HOSTNAME.rpmsave
    rm /etc/HOSTNAME

test -f etc/defaultdomain.rpmnew -a ! -s etc/defaultdomain.rpmnew && rm -f etc/defaultdomain.rpmnew
if [ -f etc/ ]; then
  test ! -f etc/netgroup.rpmnew && cp etc/netgroup etc/netgroup.rpmnew
  mv etc/ etc/netgroup
if [ -f /etc/HOSTNAME.rpmsave -a ! -L /etc/HOSTNAME.rpmsave ]; then
  cp -a /etc/HOSTNAME.rpmsave /etc/hostname
exit 0

%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hostname
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/aliases
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/defaultdomain
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ethers
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/exports
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ftpusers
%config(noreplace) %{_sysconfdir}/host.conf
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.allow
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.deny
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.equiv
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.lpd
%config(noreplace) %{_sysconfdir}/netgroup
%config(noreplace) %{_sysconfdir}/networks
%config(noreplace) %{_sysconfdir}/protocols
%config(noreplace) %{_sysconfdir}/services

openSUSE Build Service is sponsored by