File ibmrtpkgs.spec of Package ibmrtpkgs

#
# spec file for package ibmrtpkgs
#
# Copyright (c) 2014 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/
#


Name:           ibmrtpkgs
Version:        2
Release:        0
Summary:        IBM Utilities for SLERT
License:        GPL-3.0
Group:          System/Management
Url:            http://www10.software.ibm.com/developerworks/opensource/linux390
PreReq:         %insserv_prereq %fillup_prereq
Source:         ibmrtpkgs-%{version}.tar.gz
Patch1:         kthreadprio_defaults-bnc415750.diff
Patch2:         kthreadprio_autostart-bnc412439.diff
Patch3:         update_rtcheck_to_0_7_4-bnc431066.diff
Patch4:         update_rtcheck_to_0_7_5-bnc431066.diff
Patch5:         ibm-prtm_for_ls22-bnc443830.diff
Patch6:         set_nfs_to_rt_per_ibm_testing.diff
Patch7:         make_init_lsb.diff
Patch8:         fix_rtcheck_patch.diff
Patch9:         config_run_on_install.diff
Patch10:        ibm-prtm_blacklist_k8_edac.diff
Patch11:        ibm-prtmd-in-usr_sbin.diff
Patch12:        ibm-prtmd-ls21-reorder.diff
Patch13:        correct-nice-for-realtime-bnc464343.patch
Patch14:        bnc481626_ibm-prtm-patch_edac.diff
Patch15:        bug-531508_rtcheck_slert_fix_for_2.6.31.patch
Patch16:        bnc533813_update_to_ibm-prtmd.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A collection of utilities supplied by IBM to create a real time
environment primarily for RT WebSphere applications deployed on SLERT. 
Also contains a utility called ibm-prtm that removes latencies seen
when running SLERT on IBM hardware due to SMI interrupts.



Authors:
--------
    IBM

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1

%build
export OPT_FLAGS="$RPM_OPT_FLAGS"
cd $RPM_BUILD_DIR/ibmrtpkgs-2
make %{?_smp_mflags}

%install
mkdir -p $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/etc/init.d $RPM_BUILD_ROOT/etc/modprobe.d $RPM_BUILD_ROOT/sbin $RPM_BUILD_ROOT/usr/sbin
install $RPM_BUILD_DIR/ibmrtpkgs-2/config/config.sh $RPM_BUILD_ROOT/usr/sbin/ibmconfig
install $RPM_BUILD_DIR/ibmrtpkgs-2/dslimit/dslimit $RPM_BUILD_ROOT/usr/bin
install $RPM_BUILD_DIR/ibmrtpkgs-2/ibm-prtm/ibm-prtmd $RPM_BUILD_ROOT/usr/sbin
install $RPM_BUILD_DIR/ibmrtpkgs-2/ibm-prtm/modprobe.ibm-amd $RPM_BUILD_ROOT/etc/modprobe.d/ibm-amd
install $RPM_BUILD_DIR/ibmrtpkgs-2/ibm-prtm/ibm-prtm $RPM_BUILD_ROOT/etc/init.d/ibm-prtm
(cd $RPM_BUILD_ROOT/usr/sbin ; ln -s ../../etc/init.d/ibm-prtm rcibm-prtm)
install $RPM_BUILD_DIR/ibmrtpkgs-2/irqbindall/irqbindall $RPM_BUILD_ROOT/etc/init.d/irqbindall
(cd $RPM_BUILD_ROOT/usr/sbin ; ln -s ../../etc/init.d/irqbindall rcirqbindall)
install $RPM_BUILD_DIR/ibmrtpkgs-2/rtcheck/rtcheck $RPM_BUILD_ROOT/usr/bin
install $RPM_BUILD_DIR/ibmrtpkgs-2/rtcheck/rtcheck.init.suse $RPM_BUILD_ROOT/etc/init.d/rtcheck
(cd $RPM_BUILD_ROOT/usr/sbin ; ln -s ../../etc/init.d/rtcheck rcrtcheck)
install $RPM_BUILD_DIR/ibmrtpkgs-2/rt-watchdog/rt-watchdog $RPM_BUILD_ROOT/usr/bin
install $RPM_BUILD_DIR/ibmrtpkgs-2/rt-sshd/rt-sshd $RPM_BUILD_ROOT/etc/init.d/rt-sshd
(cd $RPM_BUILD_ROOT/usr/sbin ; ln -s ../../etc/init.d/rt-sshd rcrt-sshd)
install $RPM_BUILD_DIR/ibmrtpkgs-2/set_kthread_prio/set_kthread_prio.conf $RPM_BUILD_ROOT/etc/set_kthread_prio.conf
install $RPM_BUILD_DIR/ibmrtpkgs-2/set_kthread_prio/set_kthread_prio $RPM_BUILD_ROOT/etc/init.d/set_kthread_prio
(cd $RPM_BUILD_ROOT/usr/sbin ; ln -s ../../etc/init.d/set_kthread_prio rcset_kthread_prio)
for i in `( cd $RPM_BUILD_ROOT ; find * | sort )` ; do
        if ! test -d $RPM_BUILD_ROOT/$i ; then
            echo "/$i"
        fi
done > %{_builddir}/%{name}.list

%post
%{fillup_and_insserv -fy ibm-prtm}
%{fillup_and_insserv -fy irqbindall}
%{fillup_and_insserv -fy rtcheck}
%{fillup_and_insserv -fy set_kthread_prio}
if test ! -e /.buildenv; then
    /usr/sbin/rcibm-prtm start
    /usr/sbin/rcirqbindall start
    /usr/sbin/rcrtcheck start
    /usr/sbin/rcset_kthread_prio start
    /usr/sbin/ibmconfig
fi

%postun
%{restart_on_update ibm-prtm irqbindall rtcheck set_kthread_prio}
%{insserv_cleanup}

%files -f %{_builddir}/%{name}.list
%defattr(-,root,root)
%doc COPYING README
%dir /etc/modprobe.d

%changelog
openSUSE Build Service is sponsored by