File sysconfig.spec of Package sysconfig

# spec file for package sysconfig
# 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

Name:           sysconfig
Version:        0.76.4
Release:        0
Summary:        The sysconfig scheme and traditional network scripts
License:        GPL-2.0+
Group:          System/Base
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
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         %name-%version.tar.bz2

This package provides the SuSE system configuration scheme and the
traditional "ifup" alias "netcontrol" network scripts.

    Olaf Kirch <>
    Bjoern Jacke <>
    Mads Martin Joergensen <>
    Peter Poeml <>
    Arvin Schnell <>
    Michal Svec <>
    Christian Zoz <>
    Werner Fink <>
    Marius Tomaschewski <>

%setup -n sysconfig-%{version}

autoreconf --force --install
./configure --prefix=/ \
            --sbindir=/sbin \
            --libdir=/%_lib \
            --libdir=/usr/%_lib \
            --sysconfdir=%_sysconfdir \
            --mandir=%_mandir \
%{__make} %{?_smp_mflags}

make check


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/

%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
%dir /lib/udev/rules.d
%dir /etc/modprobe.d
%config /etc/sysconfig/network/ifcfg.template
%config /etc/modprobe.d/50-blacklist.conf
%doc /usr/share/doc/packages/sysconfig

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

# * 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/ .
	rm -f etc/sysconfig/network/__move_shm_sysconfig__
## 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}
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
# 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
# remove ntp variables obsoleted by netconfig (new default is "yes")
# as well as some another obsolete dhcp variables
for file in etc/sysconfig/network/dhcp etc/sysconfig/network/ifcfg-* ; do
	case $name in
	(lo|""|*" "*|*~|*.old|*.rpmnew|*.rpmsave|*.scpmbackup) continue ;;
	case $file in
		(*/ifcfg-*) umask 0177 ;;
	sysconfig_remove_and_set -b "" $file \
	umask $_umask
# 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-*


%{stop_on_removal network}

openSUSE Build Service is sponsored by