File aaa_base.spec of Package aaa_base.21647

#
# spec file for package aaa_base
#
# Copyright (c) 2018 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 http://bugs.opensuse.org/
#
# icecream 0


#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir /var/adm/fillup-templates
%endif

Name:           aaa_base
Version:        84.87+git20180409.04c9dae
Release:        0
Url:            https://github.com/openSUSE/aaa_base
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
Requires(post): 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
Patch1:         git-01-61c106aac03930e03935172eaf94d92c02a343bd.patch
Patch2:         git-02-4e5fe2a6ec5690b51a369d2134a1119962438fd1.patch
Patch3:         git-03-00d332a443062395957f422c89eaed9d0979ec00.patch
Patch4:         git-04-b66cf03e673e84902ce0330f88f84f4fbdc8c9e9.patch
Patch5:         git-05-ae2a49183ba0ad9dff6b8c1efd4de076bd34ab0f.patch
Patch6:         git-06-8640f848c6677f1149b9765a8c86135956604007.patch
Patch7:         git-07-82a17f1689e8957635c8ccaae7c9b3bff7f94d49.patch
Patch8:         git-08-9875dffab3ddda0c3e8399f935f059246c961f2a.patch
Patch9:         git-09-c6cd010dd8b6efddd71c30f00a923d8f2537584c.patch
Patch10:        git-10-43091e644ff54997468a215b891dcaa75173f133.patch
Patch11:        git-11-b20083a930f766939f47dddc66d089c9fee5d38a.patch
Patch12:        git-12-80d14205f913cc67a98c562f988ea700a56c369b.patch
Patch13:        git-13-14003c19eaa863ae9d80a0ebb9b5cab6273a5a9e.patch
Patch14:        git-14-12023f2e8aae5b2ac3a895301945566b9f5eb9c3.patch
Patch15:        git-15-27e2c6180a45cca63d71ffa5de7b32dec749d2cd.patch
Patch16:        git-16-ed897a1090cafb678f75dbed8802bd671d3c1921.patch
Patch17:        git-17-fe967bddbd74af9aba435900878397c0c7ea0b0b.patch
Patch18:        git-18-bb11f02d5dd940803c08d25b0cfd3650d9de7d41.patch
Patch19:        git-19-1149066a54a372b30b7cbd79cd222e11d96dc984.patch
Patch20:        git-20-6452441f2054b4b290c089ce6269889993b95fc1.patch
Patch21:        git-21-0064ecd132c30a939125acbc5b9a1c7bcd180fa0.patch
Patch22:        git-22-f5e90d70d119b6aa12d019947029f9337aec378d.patch
Patch23:        git-23-8f1fe28287466235ade9c62fa5995eba9e642660.patch
Patch24:        git-24-2de52ae391e2963eb1913183a6b0530c7e781b55.patch
Patch25:        git-25-287cf7cb851c0636fa46a610015d2d22ad36acea.patch
Patch26:        git-26-0c2f2340cc6ebb51f20b36e550adc517a6b2ae42.patch
Patch27:        git-27-abf7927eebbd4d7f47a362d49ae7856520682c49.patch
Patch28:        git-28-3351bcc9613ba022503103e7e4ffd01e7bd8e0fd.patch
Patch29:        git-29-5220a5f6ba250503ccda326e65ca069d245a5ebe.patch
Patch30:        git-30-b9dd70f33a124556f16dbbafc89585a82218ad61.patch
Patch31:        git-31-52dc403d54f2c926ee5cc892d1a8a830a45d7412.patch
Patch32:        git-32-0ee79834ea9ebf6573a7b903f374c21e53a56c14.patch
Patch33:        git-33-d12420cc66e6d26a9dff6c0e86e00de232151c82.patch
Patch34:        git-34-9a1bc15517d6da56d75182338c0f1bc4518b2b75.patch
Patch35:        git-35-91f496b1f65af29832192bad949685a7bc25da0a.patch
Patch36:        git-36-16d1cb895c2742e96a56af98111f8281bedd3188.patch
Patch37:        git-37-dfc5b8af96bec249e44a83d573af1f95a661a85c.patch
Patch38:        git-38-4c0060639f6fa854830a708a823976772afe7764.patch
Patch39:        git-39-df622b89bc92fd882a6715c5743095528a643546.patch

%description
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}
Requires(post): fillup
Provides:       aaa_base:/etc/DIR_COLORS

%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.

%package wsl
Summary:        SUSE Linux Base Package (Windows Subsystem for Linux)
Group:          System/Fhs
Requires:       %{name} = %{version}

%description wsl
This package includes some special settings needed on Windows Subsystem
for Linux. It should only be installed on WSL and not on regular Linux
systems.

%prep
%setup -q
%autopatch -p1

%build
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
	done
	find -name "*.orig" | xargs -r rm
	popd
fi

%install
#
make DESTDIR=$RPM_BUILD_ROOT install
#
mkdir -p %{buildroot}/etc/sysctl.d
case "$RPM_ARCH" in
	s390*) ;;
	*) rm -f %{buildroot}/usr/lib/sysctl.d/50-default-s390.conf ;;
esac
#
# make sure it does not creep in again
test -d $RPM_BUILD_ROOT/root/.gnupg && exit 1
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
done
#
install -d -m 755 %buildroot/usr/lib/initscripts/legacy-actions
# keep as ghost for migration
touch %buildroot/etc/inittab

# Backup directories
install -d -m 755 %{buildroot}/var/adm/backup/{rpmdb,sysconfig}

mkdir -p %{buildroot}%{_fillupdir}
%if "%{_fillupdir}" != "/var/adm/fillup-templates"
  for f in %{buildroot}/var/adm/fillup-templates/* ; do
    test -e "$f" || continue
    mv $f %{buildroot}%{_fillupdir}/
  done
  rm -vrf %{buildroot}/var/adm/fillup-templates
%endif
%if "%{_fillupdir}" != "/usr/share/fillup-templates"
  for f in %{buildroot}/usr/share/fillup-templates/* ; do
    test -e "$f" || continue
    mv $f %{buildroot}%{_fillupdir}/
  done
  rm -vrf %{buildroot}/usr/share/fillup-templates
%endif

%pre -f aaa_base.pre

%post -f aaa_base.post

%pre extras
%service_add_pre backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer

%post extras
%fillup_only -n backup
%service_add_post backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer

%preun extras
%service_del_preun backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer

%postun extras
%service_del_postun backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer

%files
%defattr(-,root,root)
%license COPYING
%config(noreplace) %ghost /etc/sysctl.conf
%config /etc/bash.bashrc
%config /etc/csh.cshrc
%config /etc/csh.login
%config /etc/inputrc
%config /etc/inputrc.keys
%config /etc/mime.types
%config /etc/profile
%config /etc/profile.d/alljava.csh
%config /etc/profile.d/alljava.sh
%config /etc/profile.d/csh.ssh
%config /etc/profile.d/lang.csh
%config /etc/profile.d/lang.sh
%config /etc/profile.d/profile.csh
%config /etc/profile.d/profile.sh
%config /etc/profile.d/sh.ssh
%config /etc/profile.d/xdg-environment.csh
%config /etc/profile.d/xdg-environment.sh
%config /etc/rc.splash
%config /etc/rc.status
%config /etc/shells
%config /etc/ttytype
%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 aaa_base.post, boot.cleanup
# and /etc/permissions!
%ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog
/etc/hushlogins
/usr/bin/chkconfig
/sbin/chkconfig
/usr/bin/get_kernel_version
/sbin/refresh_initrd
/usr/sbin/refresh_initrd
/sbin/service
/usr/sbin/service
/sbin/smart_agetty
/usr/sbin/smart_agetty
/usr/bin/filesize
/usr/bin/mkinfodir
/usr/bin/old
/usr/bin/rpmlocate
/usr/bin/safe-rm
/usr/bin/safe-rmdir
%dir /usr/lib/base-scripts
/usr/lib/base-scripts/convert_sysctl
/usr/lib/restricted/bin/hostname
/usr/sbin/sysconf_addword
/usr/share/man/man1/smart_agetty.1*
/usr/share/man/man5/defaultdomain.5*
/usr/share/man/man8/chkconfig.8*
/usr/share/man/man8/safe-rm.8*
/usr/share/man/man8/safe-rmdir.8*
/usr/share/man/man8/service.8*
/usr/lib/sysctl.d/*.conf
%dir /usr/lib/initscripts
%dir /usr/lib/initscripts/legacy-actions
%{_fillupdir}/sysconfig.language
%{_fillupdir}/sysconfig.proxy
%{_fillupdir}/sysconfig.windowmanager

%files extras
%defattr(-,root,root)
%config(noreplace) /etc/DIR_COLORS
/etc/skel/.emacs
/etc/skel/.inputrc
%config /etc/profile.d/complete.bash
%config /etc/profile.d/alias.ash
/etc/profile.d/alias.bash
/etc/profile.d/alias.tcsh
/etc/profile.d/ls.tcsh
/etc/profile.d/ls.bash
/etc/profile.d/ls.zsh
/usr/lib/base-scripts/backup-rpmdb
/usr/lib/base-scripts/backup-sysconfig
/usr/lib/base-scripts/check-battery
/usr/lib/systemd/system/*
/usr/share/man/man8/resolv+.8*
/var/adm/backup/rpmdb
/var/adm/backup/sysconfig
%{_fillupdir}/sysconfig.backup

%files malloccheck
%defattr(-,root,root)
%config /etc/profile.d/malloc-debug.sh
%config /etc/profile.d/malloc-debug.csh

%files wsl
%defattr(-,root,root)
%config /etc/profile.d/wsl.csh
%config /etc/profile.d/wsl.sh

%changelog
openSUSE Build Service is sponsored by