Blame aaa_base.spec

Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
# spec file for package aaa_base
Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
# Copyright (c) 2022 SUSE LLC
Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
# All modifications and additions to the file contributed by third parties
Adrian Schröter c1ad91
# remain the property of their copyright owners, unless otherwise agreed
Adrian Schröter c1ad91
# upon. The license for this file, and modifications and additions to the
Adrian Schröter c1ad91
# file, is the same license as for the pristine package itself (unless the
Adrian Schröter c1ad91
# license for the pristine package is not an Open Source License, in which
Adrian Schröter c1ad91
# case the license is the MIT License). An "Open Source License" is a
Adrian Schröter c1ad91
# license that conforms to the Open Source Definition (Version 1.9)
Adrian Schröter c1ad91
# published by the Open Source Initiative.
Adrian Schröter c1ad91
Adrian Schröter c1ad91
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
# icecream 0
Adrian Schröter c1ad91
Adrian Schröter c1ad91
Adrian Schröter c1ad91
#Compat macro for new _fillupdir macro introduced in Nov 2017
Adrian Schröter c1ad91
%if ! %{defined _fillupdir}
Adrian Schröter c1ad91
  %define _fillupdir /var/adm/fillup-templates
Adrian Schröter c1ad91
%endif
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%if 0%{?_build_in_place}
Adrian Schröter c1ad91
%define git_version %(git log '-n1' '--date=format:%Y%m%d' '--no-show-signature' "--pretty=format:+git%cd.%h")
Adrian Schröter c1ad91
BuildRequires:  git-core
Adrian Schröter c1ad91
%else
Adrian Schröter c1ad91
# this is required for obs' source validator. It's
Adrian Schröter c1ad91
# 20-files-present-and-referenced ignores all conditionals. So the
Adrian Schröter c1ad91
# definition of git_version actually happens always.
Adrian Schröter c1ad91
%define git_version %{nil}
Adrian Schröter c1ad91
%endif
Adrian Schröter c1ad91
Adrian Schröter c1ad91
Name:           aaa_base
Adrian Schröter 836e43
Version:        84.87+git20220518.dc83f4e%{git_version}
Adrian Schröter c1ad91
Release:        0
Adrian Schröter c1ad91
Summary:        openSUSE Base Package
Adrian Schröter c1ad91
License:        GPL-2.0-or-later
Adrian Schröter c1ad91
Group:          System/Fhs
Adrian Schröter c1ad91
URL:            https://github.com/openSUSE/aaa_base
Adrian Schröter c1ad91
Source:         aaa_base-%{version}.tar
Adrian Schröter c1ad91
Source1:        README.packaging.txt
Adrian Schröter c1ad91
Source99:       aaa_base-rpmlintrc
Adrian Schröter c1ad91
Requires:       /bin/mktemp
Adrian Schröter c1ad91
Requires:       /usr/bin/cat
Adrian Schröter c1ad91
Requires:       /usr/bin/date
Adrian Schröter c1ad91
Requires:       /usr/bin/grep
Adrian Schröter c1ad91
Requires:       /usr/bin/mv
Adrian Schröter c1ad91
Requires:       /usr/bin/sed
Adrian Schröter c1ad91
Requires:       /usr/bin/tput
Adrian Schröter c1ad91
Requires:       /usr/bin/xz
Adrian Schröter c1ad91
Requires:       distribution-release
Adrian Schröter c1ad91
Requires:       filesystem
Adrian Schröter c1ad91
Requires(pre):  /usr/bin/rm
Adrian Schröter c1ad91
Requires(pre):  (glibc >= 2.30 if glibc)
Adrian Schröter c1ad91
Requires(post): fillup /usr/bin/chmod /usr/bin/chown
Adrian Schröter c1ad91
Recommends:     aaa_base-extras
Adrian Schröter c1ad91
Recommends:     iproute2
Adrian Schröter c1ad91
Recommends:     iputils
Adrian Schröter c1ad91
Recommends:     logrotate
Adrian Schröter c1ad91
Recommends:     netcfg
Adrian Schröter c1ad91
Recommends:     udev
Adrian Schröter c1ad91
# do not require systemd - aaa_base is in the build environment and we don't
Adrian Schröter c1ad91
# want to pull in tons of dependencies
Adrian Schröter c1ad91
Conflicts:      sysvinit-init
Adrian Schröter c1ad91
Adrian Schröter c1ad91
# run osc service mr to recreate
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%description
Adrian Schröter c1ad91
This package installs several important configuration files and central scripts.
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%package extras
Adrian Schröter c1ad91
Summary:        SUSE Linux Base Package (recommended part)
Adrian Schröter c1ad91
Group:          System/Fhs
Adrian Schröter c1ad91
Requires:       %{name} = %{version}
Adrian Schröter c1ad91
Requires:       /usr/bin/find
Adrian Schröter c1ad91
Requires:       cpio
Adrian Schröter c1ad91
Requires(post): fillup
Adrian Schröter c1ad91
Provides:       aaa_base:/etc/DIR_COLORS
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%description extras
Adrian Schröter c1ad91
The parts of aaa_base that should be installed by default but are not
Adrian Schröter c1ad91
strictly required to run a system. (bash completions and convenience hacks).
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%package malloccheck
Adrian Schröter c1ad91
Summary:        SUSE Linux Base Package (malloc checking)
Adrian Schröter c1ad91
Group:          System/Fhs
Adrian Schröter c1ad91
Requires:       %{name} = %{version}
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%description malloccheck
Adrian Schröter c1ad91
This package sets environment variables that enable stricter
Adrian Schröter c1ad91
malloc checks to catch potential heap corruptions. It's not
Adrian Schröter c1ad91
installed by default as it may degrade performance.
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%package wsl
Adrian Schröter c1ad91
Summary:        SUSE Linux Base Package (Windows Subsystem for Linux)
Adrian Schröter c1ad91
Group:          System/Fhs
Adrian Schröter c1ad91
Requires:       %{name} = %{version}
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%description wsl
Adrian Schröter c1ad91
This package includes some special settings needed on Windows Subsystem
Adrian Schröter c1ad91
for Linux. It should only be installed on WSL and not on regular Linux
Adrian Schröter c1ad91
systems.
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%prep
Adrian Schröter c1ad91
%setup -q
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%build
Adrian Schröter c1ad91
%make_build CFLAGS="%{optflags}" CC="%{__cc}"
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%install
Adrian Schröter c1ad91
%make_install
Adrian Schröter c1ad91
mkdir -p %{buildroot}/etc/sysctl.d
Adrian Schröter c1ad91
case "$RPM_ARCH" in
Adrian Schröter c1ad91
	s390*) ;;
Adrian Schröter c1ad91
	*) rm -f %{buildroot}/usr/lib/sysctl.d/50-default-s390.conf ;;
Adrian Schröter c1ad91
esac
Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
# make sure it does not creep in again
Adrian Schröter c1ad91
test -d %{buildroot}/root/.gnupg && exit 1
Adrian Schröter c1ad91
# TODO: get rid of that at some point in the future
Adrian Schröter c1ad91
mkdir -p %{buildroot}/etc/init.d
Adrian Schröter c1ad91
for i in boot.local after.local ; do
Adrian Schröter c1ad91
  install -m 755 /dev/null %{buildroot}/etc/init.d/$i
Adrian Schröter c1ad91
done
Adrian Schröter c1ad91
#
Adrian Schröter c1ad91
install -d -m 755 %buildroot%{_libexecdir}/initscripts/legacy-actions
Adrian Schröter c1ad91
# keep as ghost for migration
Adrian Schröter c1ad91
touch %buildroot/etc/inittab
Adrian Schröter c1ad91
Adrian Schröter c1ad91
# Backup directories
Adrian Schröter c1ad91
install -d -m 755 %{buildroot}/var/adm/backup/{rpmdb,sysconfig}
Adrian Schröter c1ad91
Adrian Schröter c1ad91
mkdir -p %{buildroot}%{_fillupdir}
Adrian Schröter c1ad91
%if "%{_fillupdir}" != "/var/adm/fillup-templates"
Adrian Schröter c1ad91
  for f in %{buildroot}/var/adm/fillup-templates/* ; do
Adrian Schröter c1ad91
    test -e "$f" || continue
Adrian Schröter c1ad91
    mv $f %{buildroot}%{_fillupdir}/
Adrian Schröter c1ad91
  done
Adrian Schröter c1ad91
  rm -vrf %{buildroot}/var/adm/fillup-templates
Adrian Schröter c1ad91
%endif
Adrian Schröter c1ad91
%if "%{_fillupdir}" != "/usr/share/fillup-templates"
Adrian Schröter c1ad91
  for f in %{buildroot}/usr/share/fillup-templates/* ; do
Adrian Schröter c1ad91
    test -e "$f" || continue
Adrian Schröter c1ad91
    mv $f %{buildroot}%{_fillupdir}/
Adrian Schröter c1ad91
  done
Adrian Schröter c1ad91
  rm -vrf %{buildroot}/usr/share/fillup-templates
Adrian Schröter c1ad91
%endif
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%pre -f aaa_base.pre
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%post -f aaa_base.post
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%pre extras
Adrian Schröter c1ad91
%service_add_pre backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%post extras
Adrian Schröter c1ad91
%fillup_only -n backup
Adrian Schröter c1ad91
%service_add_post backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%preun extras
Adrian Schröter c1ad91
%service_del_preun backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%postun extras
Adrian Schröter c1ad91
%service_del_postun backup-rpmdb.service backup-rpmdb.timer backup-sysconfig.service backup-sysconfig.timer check-battery.service check-battery.timer
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%files
Adrian Schröter c1ad91
%license COPYING
Adrian Schröter c1ad91
%config(noreplace) /etc/DIR_COLORS
Adrian Schröter c1ad91
%config(noreplace) /etc/sysctl.conf
Adrian Schröter c1ad91
%config /etc/bash.bashrc
Adrian Schröter c1ad91
%config /etc/csh.cshrc
Adrian Schröter c1ad91
%config /etc/csh.login
Adrian Schröter c1ad91
%config /etc/inputrc
Adrian Schröter c1ad91
%config /etc/inputrc.keys
Adrian Schröter c1ad91
%config /etc/mime.types
Adrian Schröter c1ad91
%config /etc/profile
Adrian Schröter c1ad91
/usr/etc/profile.d/alljava.csh
Adrian Schröter c1ad91
/usr/etc/profile.d/alljava.sh
Adrian Schröter c1ad91
/usr/etc/profile.d/lang.csh
Adrian Schröter c1ad91
/usr/etc/profile.d/lang.sh
Adrian Schröter c1ad91
/usr/etc/profile.d/profile.csh
Adrian Schröter c1ad91
/usr/etc/profile.d/profile.sh
Adrian Schröter c1ad91
/usr/etc/profile.d/xdg-environment.csh
Adrian Schröter c1ad91
/usr/etc/profile.d/xdg-environment.sh
Adrian Schröter c1ad91
/usr/etc/profile.d/alias.ash
Adrian Schröter c1ad91
/usr/etc/profile.d/alias.bash
Adrian Schröter c1ad91
/usr/etc/profile.d/alias.tcsh
Adrian Schröter c1ad91
/usr/etc/profile.d/ls.tcsh
Adrian Schröter c1ad91
/usr/etc/profile.d/ls.bash
Adrian Schröter c1ad91
/usr/etc/profile.d/ls.zsh
Adrian Schröter c1ad91
%config /etc/shells
Adrian Schröter c1ad91
%ghost %dir /etc/init.d
Adrian Schröter c1ad91
%ghost %config(noreplace) /etc/init.d/boot.local
Adrian Schröter c1ad91
%ghost %config(noreplace) /etc/init.d/after.local
Adrian Schröter c1ad91
%ghost %config /etc/inittab
Adrian Schröter c1ad91
# don't forget to also change aaa_base.post, boot.cleanup
Adrian Schröter c1ad91
# and /etc/permissions!
Adrian Schröter c1ad91
%ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog
Adrian Schröter c1ad91
/usr/bin/get_kernel_version
Adrian Schröter c1ad91
/usr/sbin/refresh_initrd
Adrian Schröter c1ad91
/usr/sbin/service
Adrian Schröter c1ad91
/usr/sbin/smart_agetty
Adrian Schröter c1ad91
/usr/bin/filesize
Adrian Schröter c1ad91
/usr/bin/old
Adrian Schröter c1ad91
/usr/bin/rpmlocate
Adrian Schröter c1ad91
/usr/bin/safe-rm
Adrian Schröter c1ad91
/usr/bin/safe-rmdir
Adrian Schröter c1ad91
/usr/sbin/sysconf_addword
Adrian Schröter c1ad91
/usr/share/man/man1/smart_agetty.1*
Adrian Schröter c1ad91
/usr/share/man/man5/defaultdomain.5*
Adrian Schröter c1ad91
/usr/share/man/man8/safe-rm.8*
Adrian Schröter c1ad91
/usr/share/man/man8/safe-rmdir.8*
Adrian Schröter c1ad91
/usr/share/man/man8/service.8*
Adrian Schröter c1ad91
/usr/lib/sysctl.d/*.conf
Adrian Schröter c1ad91
%dir %{_libexecdir}/initscripts
Adrian Schröter c1ad91
%dir %{_libexecdir}/initscripts/legacy-actions
Adrian Schröter c1ad91
%{_fillupdir}/sysconfig.language
Adrian Schröter c1ad91
%{_fillupdir}/sysconfig.proxy
Adrian Schröter c1ad91
%{_fillupdir}/sysconfig.windowmanager
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%files extras
Adrian Schröter c1ad91
/etc/skel/.emacs
Adrian Schröter c1ad91
/etc/skel/.inputrc
Adrian Schröter c1ad91
%dir /usr/lib/base-scripts
Adrian Schröter c1ad91
/usr/etc/profile.d/complete.bash
Adrian Schröter c1ad91
/usr/lib/base-scripts/backup-rpmdb
Adrian Schröter c1ad91
/usr/lib/base-scripts/backup-sysconfig
Adrian Schröter c1ad91
/usr/lib/base-scripts/check-battery
Adrian Schröter c1ad91
/usr/lib/systemd/system/*
Adrian Schröter c1ad91
/usr/share/man/man8/resolv+.8*
Adrian Schröter c1ad91
/var/adm/backup/rpmdb
Adrian Schröter c1ad91
/var/adm/backup/sysconfig
Adrian Schröter c1ad91
%{_fillupdir}/sysconfig.backup
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%files malloccheck
Adrian Schröter c1ad91
/usr/etc/profile.d/malloc-debug.sh
Adrian Schröter c1ad91
/usr/etc/profile.d/malloc-debug.csh
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%files wsl
Adrian Schröter c1ad91
/usr/etc/profile.d/wsl.csh
Adrian Schröter c1ad91
/usr/etc/profile.d/wsl.sh
Adrian Schröter c1ad91
Adrian Schröter c1ad91
%changelog