File aaa_base.spec of Package aaa_base

Name:           aaa_base
Version:        %(rpm -q cross-%{cross_arch}-aaa_base | cut -d - -f 4 )
Release:        0
Summary:        Foo
License:        GPL-2.0+
Group:          foo
Source0:        aaa_base-13.2+git20151221.244f2a3.tar.xz
Source1:        aaa_base-rpmlintrc
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cross-%{cross_arch}-aaa_base
#!BuildIgnore:  post-build-checks
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
PreReq:         /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup
Provides:       aaa_base-malloccheck

%description
Bootstrap package

%define gcc_target_arch %{cross_arch}-suse-linux

%define sysroot %{_prefix}/%{gcc_target_arch}/sys-root

%define cross_lib lib
%if "%{cross_arch}" == "mips64"
%define cross_lib lib64
%endif
%define cross_libdir %{_prefix}/%{cross_lib}

%prep
%setup -q

%build

%install
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
mkdir -p %{buildroot}
rpm -ql cross-%{cross_arch}-aaa_base | \
while IFS= read -r line; do
  if [ ! -d $line ]; then
    echo $line
  fi
done > aaa_base.files
tar cf - -T aaa_base.files | tar xf - --strip-components=3 -C %{buildroot}

for i in passwd group shadow gshadow; do
  touch %{buildroot}/var/adm/fillup-templates/$i.aaa_base
done
mkdir -p %{buildroot}/etc/init.d
for i in boot.local after.local halt.local ; do
  echo "#!bin/bash" > %{buildroot}/etc/init.d/$i
  chmod 755 %{buildroot}/etc/init.d/$i
done
install -d -m 755 %{buildroot}/usr/lib/initscripts/legacy-actions
touch %{buildroot}/etc/inittab

%pre -f aaa_base.pre

%post -f aaa_base.post

%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
%defattr(-,root,root)
%doc COPYING
%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/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 /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 aaa_base.post, 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
/etc/hushlogins
%dir /lib/aaa_base
/lib/aaa_base/convert_sysctl*
/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/ChangeSymlinks
/usr/bin/filesize
/usr/bin/mkinfodir
/usr/bin/old
/usr/bin/rpmlocate
/usr/bin/safe-rm
/usr/bin/safe-rmdir
/usr/bin/setJava
/usr/lib/restricted/bin/hostname
/usr/sbin/Check
/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
/var/adm/fillup-templates/sysconfig.backup
/var/adm/fillup-templates/sysconfig.language
/var/adm/fillup-templates/sysconfig.news
/var/adm/fillup-templates/sysconfig.proxy
/var/adm/fillup-templates/sysconfig.windowmanager

# extra
%config(noreplace) /etc/DIR_COLORS
/etc/cron.daily/suse.de-backup-rc.config
/etc/cron.daily/suse.de-backup-rpmdb
/etc/cron.daily/suse.de-check-battery
/etc/cron.daily/suse.de-cron-local
/etc/skel/.emacs
/etc/skel/.inputrc
/etc/java/README
%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/sbin/setDefaultJava
/usr/share/man/man7/init.d.7*
/usr/share/man/man5/route.conf.5*
/usr/share/man/man8/resolv+.8*
/usr/share/man/man8/quick_halt.8*

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


%changelog