File aaa_base.spec of Package aaa_base

# spec file for package aaa_base
# Copyright (c) 2016 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
# icecream 0

Name:           aaa_base
Version:        13.2+git20160601.ed9debf
Release:        0
Provides:       aaa_skel = %{version}-%{release}
Provides:       bin
Provides:       bootutls
Provides:       etc
Provides:       skeleng
Provides:       skelger
Obsoletes:      aaa_skel < %{version}
# do not require systemd - aaa_base is in the build environment and we don't want 
# to pull in tons of dependencies
Conflicts:      sysvinit-init
Requires:       /bin/login
Requires:       /bin/mktemp
Requires:       /usr/bin/find
Requires:       /usr/bin/tput
Requires:       /usr/bin/xargs
Requires:       cpio
Requires:       distribution-release
Requires:       filesystem
# for symlink check to /bin/hostname
BuildRequires:  net-tools
BuildRequires:  xz
Recommends:     logrotate netcfg udev net-tools aaa_base-extras
PreReq:         /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup
Summary:        openSUSE Base Package
License:        GPL-2.0+
Group:          System/Fhs
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# run osc service dr to recreate
Source:         aaa_base-%{version}.tar.xz
# Read README.packaging.txt before making any changes to this
# package
Source1:        README.packaging.txt
Source99:       aaa_base-rpmlintrc

This package installs several important configuration files and central scripts.

%package extras
Summary:        SUSE Linux Base Package (recommended part)
Group:          System/Fhs
Requires:       %{name} = %{version}
Provides:       aaa_base:/etc/DIR_COLORS
Recommends:     cron

%description extras
The parts of aaa_base that should be installed by default but are not
strictly required to run a system. (Shell aliases, bash completions
and convenience hacks).

%package malloccheck
Summary:        SUSE Linux Base Package (malloc checking)
Group:          System/Fhs
Requires:       %{name} = %{version}

%description malloccheck
This package sets environment variables that enable stricter
malloc checks to catch potential heap corruptions. It's not
installed by default as it may degrade performance.

%setup -q

make CFLAGS="$RPM_OPT_FLAGS" CC="%{__cc}" %{?_smp_mflags}
if test -d patches/$RPM_ARCH; then
	pushd files
	for file in ../patches/$RPM_ARCH/*; do
		patch -p0 --input=$file
	find -name "*.orig" | xargs -r rm

mkdir -p %{buildroot}/etc/sysctl.d
case "$RPM_ARCH" in
	s390*) ;;
	*) rm -f %{buildroot}/usr/lib/sysctl.d/50-default-s390.conf ;;
# make sure it does not creep in again
test -d $RPM_BUILD_ROOT/root/.gnupg && exit 1
# mark these as ghost
for i in passwd group shadow gshadow ; do
  touch $RPM_BUILD_ROOT/var/adm/fillup-templates/$i.aaa_base
mkdir -p $RPM_BUILD_ROOT/etc/init.d
for i in boot.local after.local halt.local ; do
  echo "#!bin/bash" > $RPM_BUILD_ROOT/etc/init.d/$i
  chmod 755 $RPM_BUILD_ROOT/etc/init.d/$i
install -d -m 755 %buildroot/usr/lib/initscripts/legacy-actions
# keep as ghost for migration
touch %buildroot/etc/inittab

%pre -f aaa_base.pre

%post -f

%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
rm -f /root/.gnupg/secring.gpg.aaa_save

%config(noreplace) %ghost /etc/sysctl.conf
%config /etc/bash.bashrc
%config /etc/csh.cshrc
%config /etc/csh.login
%config /etc/inputrc
%config /etc/mime.types
%config /etc/profile
%config /etc/profile.d/alljava.csh
%config /etc/profile.d/
%config /etc/profile.d/csh.ssh
%config /etc/profile.d/lang.csh
%config /etc/profile.d/
%config /etc/profile.d/profile.csh
%config /etc/profile.d/
%config /etc/profile.d/sh.ssh
%config /etc/profile.d/xdg-environment.csh
%config /etc/profile.d/
%config /etc/rc.splash
%config /etc/rc.status
%config /etc/shells
%config /etc/ttytype
%ghost /var/adm/fillup-templates/passwd.aaa_base
%ghost /var/adm/fillup-templates/group.aaa_base
%ghost /var/adm/fillup-templates/gshadow.aaa_base
%ghost /var/adm/fillup-templates/shadow.aaa_base
%ghost /etc/init.d/boot.local
%ghost /etc/init.d/after.local
%ghost /etc/init.d/halt.local
%ghost %config /etc/inittab
# don't forget to also change, boot.cleanup
# and /etc/permissions!
%ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog
%ghost %attr(0600,root,root) %verify(not md5 size mtime) /var/log/faillog
%ghost %attr(0664,root,utmp) %verify(not md5 size mtime) /var/log/wtmp
%ghost %attr(0600,root,root) %verify(not md5 size mtime) /var/log/btmp
%ghost %attr(0664,root,utmp) %verify(not md5 size mtime) /run/utmp
%dir /lib/aaa_base
%dir /usr/lib/initscripts
%dir /usr/lib/initscripts/legacy-actions

%files extras
%config(noreplace) /etc/DIR_COLORS
%config /etc/profile.d/complete.bash
%config /etc/profile.d/alias.ash

%files malloccheck
%config /etc/profile.d/
%config /etc/profile.d/malloc-debug.csh

openSUSE Build Service is sponsored by