#
# spec file for package aaa_base (Version 11.2)
#
# Copyright (c) 2009 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:           aaa_base
License:        GPL v2 or later
Group:          System/Fhs
Provides:       bin bootutls etc skeleng skelger aaa_skel
Obsoletes:      aaa_skel
Requires:       filesystem distribution-release /bin/mktemp /usr/bin/find /usr/bin/tput /usr/bin/xargs mingetty /bin/login cpio psmisc
Recommends:     cron logrotate netcfg udev net-tools
PreReq:         /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup /sbin/insserv
AutoReqProv:    on
Version:        11.2
Release:        47
Summary:        SUSE Linux Base Package
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         aaa_base.tar.bz2
Source3:        aaa_base.specialfilelist
Source5:        arch_special.tar.bz2
Source7:        sysconfig_parts.tar.bz2
Source8:        get_kernel_version.c
Source20:       aaa_base-rpmlintrc
Source21:       aaa_base.pre
Source22:       aaa_base.post
# %ifarch x86_64
# Obsoletes:      tpctl <= 4.17
# %endif

%description
This package installs several important configuration files. Central
scripts like SuSEconfig are also in this package.



Authors:
--------
    Werner Fink <werner@suse.de>
    R�diger Oertel <ro@suse.de>
    Burchard Steinbild
    Florian La Roche
    Martin Scherbaum

%prep
%setup -n aaa_base -b 5 -b 7
cd ..
mkdir -p scripts
cp -v %{SOURCE21} scripts
cp -v %{SOURCE22} scripts

%build
gcc $RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 $RPM_SOURCE_DIR/get_kernel_version.c -o $RPM_SOURCE_DIR/get_kernel_version

%install
install -d -m 700 root
# make sure it does not creep in again
test -d ../aaa_base/root/.gnupg && exit 1
cp -a ../aaa_base/* $RPM_BUILD_ROOT
cp $RPM_SOURCE_DIR/get_kernel_version $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
for i in $RPM_BUILD_DIR/sysconfig_parts/sysconfig.* ; do
  cp $i $RPM_BUILD_ROOT/var/adm/fillup-templates/
done
#
## do arch specific patches BEGIN
#
pushd $RPM_BUILD_ROOT
test -d $RPM_BUILD_DIR/arch_special/$RPM_ARCH && \
  {
    for file in $RPM_BUILD_DIR/arch_special/$RPM_ARCH/* ; do
        patch -p0 --input=$file
    done
  }
#
# delete .orig files
#
find $RPM_BUILD_ROOT -name "*.orig" | xargs -r rm
popd
#
## do arch specific patches END
#
#
# generate README from init-manpage
#
test -s $RPM_BUILD_ROOT/usr/share/man/man7/init.d.7 || exit 1
cat $RPM_BUILD_ROOT/usr/share/man/man7/init.d.7 | \
    troff -Tlatin1 -t -mandoc | grotty -cbou > \
    $RPM_BUILD_ROOT/etc/init.d/README
cp  $RPM_BUILD_ROOT/etc/init.d/README $RPM_BUILD_ROOT/sbin/init.d.README
#
#
# mark these as ghost
for i in passwd group shadow gshadow ; do
  touch $RPM_BUILD_ROOT/var/adm/fillup-templates/$i.aaa_base
done
#
# generate the file-list with config-files et al.
#
test -x /usr/sbin/Check && /usr/sbin/Check
#
for i in `( cd $RPM_BUILD_ROOT ; find * | sort )` ; do
    if ! grep -E "^.* /$i\$" %{S:3} ; then
	if ! test -d $RPM_BUILD_ROOT/$i ; then
	    echo "/$i"
	fi
    fi
done > aaa_base.files

%pre -f ../scripts/aaa_base.pre

%post -f ../scripts/aaa_base.post

%postun
%insserv_cleanup

%triggerpostun -- aaa_base
if test -f /root/.gnupg/secring.gpg.aaa_save -a ! -f /root/.gnupg/secring.gpg ; then
   mv /root/.gnupg/secring.gpg.aaa_save /root/.gnupg/secring.gpg
fi
rm -f /root/.gnupg/secring.gpg.aaa_save

%files -f aaa_base.files
%defattr(-,root,root)

%changelog