File pm-profiler.spec of Package pm-profiler

#
# spec file for package pm-profiler
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           pm-profiler
Summary:        Managing power options on servers
Version:        0.1_git20110726
Release:        1
License:        GPL-2.0
Url:            http://www.stilltobefound.org
Group:          System/Management
Source:         %{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_prereq %fillup_prereq
BuildArch:      noarch
AutoReqProv:    on
Obsoletes:      powersave <= 0.15.20
Provides:       powersave = 0.15.20

%description
Script infrastructure to enable/disable certain power management
functions via simple configuration files. It is intended for server
use.



Authors:
--------
    Holger Macht <hmacht@suse.de>

%prep
%setup -q

%build

%install
# We introduce a link which is stale after install
# and gets valid in %pre/%post scripts. Tell the build
# service or it will stop with an error.

export NO_BRP_STALE_LINK_ERROR="yes"

%makeinstall

mkdir -p %{buildroot}/var/adm/fillup-templates
mv $RPM_BUILD_ROOT/%{_sysconfdir}/pm-profiler.conf $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pm-profiler
ln -sf /etc/sysconfig/pm-profiler $RPM_BUILD_ROOT/%{_sysconfdir}/pm-profiler.conf

%find_lang %name

%pre
if test -f /etc/pm-profiler.conf -a ! -L /etc/pm-profiler.conf; then
    grep "^PM_PROFILER_PROFILE" /etc/pm-profiler.conf > /etc/sysconfig/pm-profiler
    rm /etc/pm-profiler.conf
    ln -sf /etc/sysconfig/pm-profiler /etc/pm-profiler.conf
fi

%preun
%stop_on_removal pm-profiler

%post
%{fillup_only -n pm-profiler}

%postun
%{insserv_cleanup}

%clean
rm -rf %buildroot

%files -f %name.lang
%defattr(-,root,root)
%_docdir/pm-profiler
/usr/lib/pm-profiler
%config %_sysconfdir/pm-profiler.conf
%dir %_sysconfdir/pm-profiler
%dir %_sysconfdir/pm-profiler/balanced_low_latency
%config %_sysconfdir/pm-profiler/balanced_low_latency/config
%dir %_sysconfdir/pm-profiler/low_latency
%config %_sysconfdir/pm-profiler/low_latency/config
%dir %_sysconfdir/pm-profiler/powersaving
%config %_sysconfdir/pm-profiler/powersaving/config
%_sysconfdir/init.d/pm-profiler
%_sbindir/rcpm-profiler
%_bindir/pm-profiler
#/etc/sysconfig/pm-profiler.conf
/var/adm/fillup-templates/sysconfig.pm-profiler

%changelog
openSUSE Build Service is sponsored by