File sysconfig.spec of Package sysconfig.openSUSE_12.1_Update

#
# spec file for package sysconfig
#
# Copyright (c) 2013 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:           sysconfig
Version:        0.75.4
Release:        0
Summary:        The sysconfig scheme and traditional network scripts
License:        GPL-2.0+
Group:          System/Base
Url:            http://gitorious.org/opensuse/sysconfig
PreReq:         %fillup_prereq %insserv_prereq textutils fileutils gawk sed grep
# we may create these automatically from rpm later
Provides:       sysvinit(network)
Requires:       bridge-utils
Requires:       dbus-1
Requires:       iproute2
Requires:       procps
Requires:       tunctl
Requires:       vlan
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         %name-%version.tar.bz2
Patch1:         0001-sysconfig-nm-online-timeout-0-default.patch
Patch2:         0002-Fixed-order-of-addr-flush-and-link-down-in-ifdown.patch
Patch3:         0003-CVE-2011-4182-fixed-quoting-in-ifservices-script.patch
Patch4:         0004-Do-not-suggest-dropped-dhcp6c-client.patch
Patch5:         0005-Added-X-Systemd-RemainAfterExit-true-LSB-init-header.patch
Patch6:         0006-Fixed-ipv6-dad-link-ready-wait-time-calculation.patch
Patch7:         0007-Use-link_ready_wait-instead-of-up-flag-check-loop.patch
Patch8:         0008-Disabled-bash-posix-mode-to-allow-bash-features.patch
Patch9:         0009-Filter-out-labeled-ipv4-addresses-in-get_ipv4address.patch
Patch10:        0010-network-start-fails-under-systemd.test.patch
Patch11:        0011-Test-if-scripts-used-in-77-network.rules-exists.patch
Patch12:        0012-Corrected-IMPORT-in-hardware-81-mount.rules.patch
Patch13:        0013-Fixed-ifrenew-dhcp-to-use-built-in-dhcpcd-renew.patch
Patch14:        0014-X-Systemd-RemainAfterExit-LSB-tag-before-Description.patch
Patch15:        0015-Do-not-force-dummy-gateway-for-multicast-routes.patch
Patch16:        0016-Fixed-use-of-4-6-option-for-ip-route-bnc-745252.patch
Patch17:        0017-ifup-bridge-apply-stp-contstrains-when-STP-is-on.patch
Patch18:        0018-Fixed-to-differentiate-ib-ibchild-bond-types.patch
Patch19:        0019-Check-before-running-a-script-in-netcontrol_services.patch
Patch20:        0020-Use-dhclient-v-when-debug-is-enabled-bnc-780644.patch
Patch21:        0021-Added-DHCLIENT_WAIT_LINK-variable-instead-to-hardcod.patch
Patch22:        0022-modprobe-af_packet-early-before-link-set-up.patch
Patch23:        0023-netconfig-ntp-runtime-add-servers-do-not-try-restart.patch
Patch24:        0024-ifup-fail-early-for-too-long-interface-names.patch
Patch25:        0025-network-do-not-wait-for-virtuals-reporting-errors.patch
Patch26:        0026-ifup-check-for-valid-characters-in-interface-names.patch
Patch27:        0027-ifup-wireless-do-not-fail-on-unsupported-power-optio.patch
Patch28:        0028-rcnetwork-no-dhcp-in-background-report-to-systemd.patch
Patch29:        0029-Execute-netconfig-ntp-runtime-update-in-background.patch
Patch30:        0030-ifup-bridge-handle-1-100-sec-precision-stp-times.patch
Patch31:        0031-Updated-bridge-documentation-link-in-ifcfg-bridge.5.patch
Patch32:        0032-Fixed-to-wait-for-dhcp-ipv6-under-systemd-again.patch
Patch33:        0033-ifup-always-join-the-systemd-network.service-cgroup.patch

%description
This package provides the SuSE system configuration scheme and
the netcontrol alias ifup network scripts.

Authors:
--------
    Olaf Kirch <okir@suse.de>
    Bjoern Jacke <bjoern@j3e.de>
    Mads Martin Joergensen <mmj@suse.de>
    Peter Poeml <poeml@suse.de>
    Arvin Schnell <arvin@suse.de>
    Michal Svec <msvec@suse.cz>
    Christian Zoz <zoz@suse.de>
    Werner Fink <werner@suse.de>
    Marius Tomaschewski <mt@suse.de>

%prep
%setup -n sysconfig-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1

%build
autoreconf --force --install
CFLAGS="$RPM_OPT_FLAGS -fPIC" \
./configure --prefix=/ \
            --sbindir=/sbin \
            --libdir=/%_lib \
            --libdir=/usr/%_lib \
            --sysconfdir=%_sysconfdir \
            --mandir=%_mandir \
            --with-fillup-templatesdir=/var/adm/fillup-templates
%{__make} %{?_smp_mflags}

%check
make check

%clean
rm -rf $RPM_BUILD_ROOT

%install
make DESTDIR=$RPM_BUILD_ROOT install
touch $RPM_BUILD_ROOT/etc/sysconfig/network/config
touch $RPM_BUILD_ROOT/etc/sysconfig/network/dhcp
# install udevmountd
mkdir -p $RPM_BUILD_ROOT/lib/udev
mv $RPM_BUILD_ROOT/sbin/udevmountd $RPM_BUILD_ROOT/lib/udev
# remove template dir
rm -rf $RPM_BUILD_ROOT/etc/sysconfig/network/ifservices.template/

%files
%defattr(-,root,root)
/etc/init.d/*
%ghost /etc/sysconfig/network/config
%ghost /etc/sysconfig/network/dhcp
%config(noreplace) %attr(600,root,root) /etc/sysconfig/network/ifcfg-lo
%config(noreplace) /etc/sysconfig/network/ifroute-lo
%config(noreplace) /etc/ppp/ip-up
%config(noreplace) /etc/ppp/ip-down
%config(noreplace) /etc/ppp/ipv6-up
%config(noreplace) /etc/ppp/ipv6-down
%dir /lib/udev
/lib/udev/udevmountd
%dir /lib/udev/rules.d
/lib/udev/rules.d/77-network.rules
/lib/udev/rules.d/81-mount.rules
%dir /etc/modprobe.d
%config /etc/sysconfig/network/ifcfg.template
%config /etc/modprobe.d/50-blacklist.conf
/etc/sysconfig/network/scripts/*
/etc/sysconfig/network/if-up.d/ndp-proxy
/etc/sysconfig/network/if-down.d/ndp-proxy
/etc/netconfig.d
/etc/ppp/poll.tcpip
/etc/NetworkManager
/sbin/*
%doc /usr/share/doc/packages/sysconfig
%_mandir/*/*
/usr/share/omc/svcinfo.d/network.xml
/var/adm/fillup-templates/sysconfig.dhcp-network
/var/adm/fillup-templates/sysconfig.config-network

%pre
# package update ?
if [ ${1:-0} -gt 1 ]; then
	# update to >= 0.72.1 (-> openSUSE 11.2)
	if [ ! -f etc/sysconfig/network/scripts/move_shm_sysconfig.sh ] ; then
		touch etc/sysconfig/network/__move_shm_sysconfig__
	fi
fi

%post 
# * update to >= 0.72.1: before anything else, move state
#   files from dev/shm/sysconfig to dev/.sysconfig/network
if [ -f etc/sysconfig/network/__move_shm_sysconfig__ ] ; then
	etc/sysconfig/network/scripts/move_shm_sysconfig.sh .
	rm -f etc/sysconfig/network/__move_shm_sysconfig__
fi
#
## we provide own, improved variant of the remove_and_set suse
## rpm macro that is able to handle files in subdirs, and more
. etc/sysconfig/network/scripts/functions.rpm-utils
#
%{fillup_and_insserv -fY network}
%{fillup_and_insserv -fY network-remotefs}
%{fillup_only -dns dhcp network network}
%{fillup_only -dns config network network}
/sbin/ldconfig
echo "Removing old autogenerated device configuration files:"
#
# * update to >= 11.1 / SLE11:
#
# convert dns / modify_resolvconf to netconfig
if [ -e etc/sysconfig/network/scripts/convert_to_netconfig_dns ] ; then
    ROOT=$PWD bash etc/sysconfig/network/scripts/convert_to_netconfig_dns
fi
# convert nis / dhclient variables to netconfig
if [ -e etc/sysconfig/network/scripts/convert_to_netconfig_nis ] ; then
    ROOT=$PWD bash etc/sysconfig/network/scripts/convert_to_netconfig_nis
fi
# remove ntp variables obsoleted by netconfig (new default is "yes")
# as well as some another obsolete dhcp variables
_umask=`umask`
for file in etc/sysconfig/network/dhcp etc/sysconfig/network/ifcfg-* ; do
	name="${file##*\/ifcfg-}"
	case $name in
	(lo|""|*" "*|*~|*.old|*.rpmnew|*.rpmsave|*.scpmbackup) continue ;;
	esac
	case $file in
		(*/ifcfg-*) umask 0177 ;;
	esac
	sysconfig_remove_and_set -b "" $file \
		DHCLIENT_MODIFY_NTP_CONF     \
		DHCLIENT_ADDITIONAL_OPTIONS  \
		DHCLIENT_SCRIPT_EXE
	umask $_umask
done
# erroneous move from network/dhcp to network/config while 11.1 beta
sysconfig_remove_and_set network/config WRITE_HOSTNAME_TO_HOSTS
# be a little bit paranoid and set the correct mode even we set umask
chmod 0600 etc/sysconfig/network/ifcfg-*

%postun
%{insserv_cleanup}
/sbin/ldconfig

%preun
%{stop_on_removal network}

%changelog
openSUSE Build Service is sponsored by