# # libtune.spec - "spec" file for the libtune library # # Copyright (C) 2005 Bull S.A. # Written by Nadia Derbey # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Name: libtune Version: 0.10 Release: 1 Summary: A library that standardizes the access to kernel tunables Group: System Environment/Libraries License: LGPL URL: http://libtune.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: tunables-generic-data, tunables-distro-data BuildRequires: bison >= 1.75 BuildRequires: flex >= 2.5.3 BuildRequires: libtool gcc %description The libtune library aims at providing a standard API to unify the various ways Linux developers have to access kernel tunables, system information and resource consumptions. This API is built on top of the existing mechanisms (in order not to break backward compatibility), and can be used by the applications to manipulate the information and tunables from the kernel. Using a single interface you can get the value of a tunable wherever it is located (sysfs or procfs), whether its value is the unique content of a file or a field within a file. This is also true for setting a tunable value. This package supplies only the library. %package devel Summary: Libtune development Group: System Environment/Libraries Requires: %{name} = %{version} %description devel This package supplies the header files to use with the library, as well as the header files used to generate the tunables databases. It also supplies the scripts needed for manipulating the tunables databases. %package -n tunables-data-2.6.5 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data %description -n tunables-data-2.6.5 This package supplies the tunables database for kernel release 2.6.5 %package -n tunables-data-2.6.9 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data %description -n tunables-data-2.6.9 This package supplies the tunables database for kernel release 2.6.9 %package -n tunables-data-2.6.11 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data %description -n tunables-data-2.6.11 This package supplies the tunables database for kernel release 2.6.11 %package -n tunables-data-2.6.16 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data %description -n tunables-data-2.6.16 This package supplies the tunables database for kernel release 2.6.16 %package -n tunables-data-2.6.17 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data %description -n tunables-data-2.6.17 This package supplies the tunables database for kernel release 2.6.17 %package -n tunables-data-FC2-2.6.5 Summary: Distro-dependent tunables database Group: System Environment/Libraries Provides: tunables-distro-data Requires: tunables-data-2.6.5 %description -n tunables-data-FC2-2.6.5 This package supplies the tunables database for Fedora Core 5's 2.6.5 %package -n tunables-data-SLES9-2.6.5 Summary: Distro-dependent tunables database Group: System Environment/Libraries Provides: tunables-distro-data Requires: tunables-data-2.6.5 %description -n tunables-data-SLES9-2.6.5 This package supplies the tunables database for SuSE Linux Enterprise Server 9's 2.6.5 %package -n tunables-data-FC3-2.6.9 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.9 Provides: tunables-distro-data %description -n tunables-data-FC3-2.6.9 This package supplies the tunables database for Fedora Core 3's 2.6.9 %package -n tunables-data-RHEL4-2.6.9 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.9 Provides: tunables-distro-data %description -n tunables-data-RHEL4-2.6.9 This package supplies the tunables database for Red Hat Enterprise Linux 4's 2.6.9 %package -n tunables-data-FC4-2.6.11 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.11 Provides: tunables-distro-data %description -n tunables-data-FC4-2.6.11 This package supplies the tunables database for Fedora Core 4's 2.6.11 %package -n tunables-data-SL9.3-2.6.11 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.11 Provides: tunables-distro-data %description -n tunables-data-SL9.3-2.6.11 This package supplies the tunables database for SuSE Linux 9.3's 2.6.11 %package -n tunables-data-SLES10-2.6.16 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.16 Provides: tunables-distro-data %description -n tunables-data-SLES10-2.6.16 This package supplies the tunables database for SuSE Linux Enterprise Server 10's 2.6.16 %package -n tunables-data-RHEL5-2.6.17 Summary: Distro-dependent tunables database Group: System Environment/Libraries Requires: tunables-data-2.6.17 Provides: tunables-distro-data %description -n tunables-data-RHEL5-2.6.17 This package supplies the tunables database for Red Hat Enterprise Server 5's 2.6.17 %prep %setup -q %build make -C lib make -C scripts %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_includedir} make -C include install INSTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_libdir} make -C lib install INSTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_var}/%{_lib}/tundb mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} make -C scripts install INSTDIR=$RPM_BUILD_ROOT # # Build the databases and install them # clean_str="" devel_manifest=files-devel echo "%defattr(-,root,root)" > $devel_manifest for k in `find db/include -maxdepth 1 -name base-* | sort -n` do KVERSION=`basename $k | sed "s/^base-//"` for d in `find $k -maxdepth 1 -name distro-*` do FAMILY=`basename $d | sed "s/distro-//" | \ awk -F"_" '{print $1}'` FRELEASE=`basename $d | sed "s/distro-//" | \ awk -F"_" '{print $2}'` $clean_str make -C db KVERSION=$KVERSION \ FAMILY=$FAMILY \ FRELEASE=$FRELEASE make -C db KVERSION=$KVERSION \ FAMILY=$FAMILY \ FRELEASE=$FRELEASE \ INSTDIR=$RPM_BUILD_ROOT install manifest=files-data-${FAMILY}${FRELEASE}-${KVERSION} echo "%defattr(-,root,root)" > $manifest echo "%{_var}/%{_lib}/tundb/base-${KVERSION}/distro-${FAMILY}_${FRELEASE}/tundb_distro" >> $manifest echo "%{_var}/%{_lib}/tundb/base-${KVERSION}/distro-${FAMILY}_${FRELEASE}/libtuninitdb_distro.h" >> $devel_manifest clean_str="make -C db KVERSION=$KVERSION FAMILY=$FAMILY \ FRELEASE=$FRELEASE clean" done manifest=files-data-${KVERSION} echo "%defattr(-,root,root)" > $manifest echo "%{_var}/%{_lib}/tundb/base-${KVERSION}/tundb_kernel" >> $manifest echo "%{_var}/%{_lib}/tundb/base-${KVERSION}/libtuninitdb_base.h" >> $devel_manifest done make -C templates install INSTDIR=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig -n %{_libdir} %post devel /sbin/chkconfig --add chtunedb /sbin/ldconfig %post -n tunables-data-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.5 tundb_kernel %post -n tunables-data-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.9 tundb_kernel %post -n tunables-data-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.11 tundb_kernel %post -n tunables-data-2.6.16 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.16 tundb_kernel %post -n tunables-data-2.6.17 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.17 tundb_kernel %post -n tunables-data-FC2-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.5/distro-FC_2 tundb_distro %post -n tunables-data-SLES9-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.5/distro-SLES_9 \ tundb_distro %post -n tunables-data-FC3-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.9/distro-FC_3 \ tundb_distro %post -n tunables-data-RHEL4-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.9/distro-RHEL_4 \ tundb_distro %post -n tunables-data-FC4-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.11/distro-FC_4 \ tundb_distro %post -n tunables-data-SL9.3-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.11/distro-SL_9.3 \ tundb_distro %post -n tunables-data-SLES10-2.6.16 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.16/distro-SLES_10 \ tundb_distro %post -n tunables-data-RHEL5-2.6.17 /var/lib/tundb/bin/libtune_upgrade.sh post base-2.6.17/distro-RHEL_5 \ tundb_distro %preun devel /sbin/chkconfig --del chtunedb %preun -n tunables-data-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-2.6.16 /var/lib/tundb/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-2.6.17 /var/lib/tundb/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-FC2-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-SLES9-2.6.5 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-FC3-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-RHEL4-2.6.9 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-FC4-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-SL9.3-2.6.11 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-SLES10-2.6.16 /var/lib/tundb/bin/libtune_upgrade.sh predistro %preun -n tunables-data-RHEL5-2.6.17 /var/lib/tundb/bin/libtune_upgrade.sh predistro %postun -p /sbin/ldconfig %files %defattr(-,root,root) %{_libdir}/libtune.la %{_libdir}/libtune.so.0 %{_libdir}/libtune.so.0.0.0 %{_var}/%{_lib}/tundb/bin/get_tunedb %doc COPYING lib/LGPL ChangeLog %files devel -f files-devel %defattr(-,root,root) %{_includedir}/libtune.h %{_libdir}/libtune.a %{_libdir}/libtune.so %{_var}/%{_lib}/tundb/bin/get_distro.sh %{_initrddir}/chtunedb %{_sysconfdir}/rc.d/rc3.d/S99chtunedb %{_sysconfdir}/rc.d/rc4.d/S99chtunedb %{_sysconfdir}/rc.d/rc5.d/S99chtunedb %{_var}/%{_lib}/tundb/templates %{_var}/%{_lib}/tundb/bin/add_distro.sh %{_var}/%{_lib}/tundb/bin/add_kernel.sh %{_var}/%{_lib}/tundb/bin/add_tunable %{_var}/%{_lib}/tundb/bin/add_tunable.awk %{_var}/%{_lib}/tundb/bin/add_tunable.sh %{_var}/%{_lib}/tundb/bin/contents_attributes %{_var}/%{_lib}/tundb/bin/name_attributes %{_var}/%{_lib}/tundb/bin/new_tunable.awk %{_var}/%{_lib}/tundb/bin/new_tunable.sh %{_var}/%{_lib}/tundb/bin/remove_tunable %{_var}/%{_lib}/tundb/bin/remove_tunable.awk %{_var}/%{_lib}/tundb/bin/remove_tunable.sh %{_var}/%{_lib}/tundb/bin/rpm_constants.sh %{_var}/%{_lib}/tundb/bin/scripts_constants.sh %{_var}/%{_lib}/tundb/bin/scripts_lib.sh %{_var}/%{_lib}/tundb/bin/strategy_routines %doc %{_var}/%{_lib}/tundb/doc/README %doc templates/GPL %files -n tunables-data-2.6.5 -f files-data-2.6.5 %defattr(-,root,root) %{_var}/%{_lib}/tundb/bin/libtune_upgrade.sh %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-2.6.9 -f files-data-2.6.9 %defattr(-,root,root) %{_var}/%{_lib}/tundb/bin/libtune_upgrade.sh %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-2.6.11 -f files-data-2.6.11 %defattr(-,root,root) %{_var}/%{_lib}/tundb/bin/libtune_upgrade.sh %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-2.6.16 -f files-data-2.6.16 %defattr(-,root,root) %{_var}/%{_lib}/tundb/bin/libtune_upgrade.sh %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-2.6.17 -f files-data-2.6.17 %defattr(-,root,root) %{_var}/%{_lib}/tundb/bin/libtune_upgrade.sh %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-FC2-2.6.5 -f files-data-FC2-2.6.5 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-SLES9-2.6.5 -f files-data-SLES9-2.6.5 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-FC3-2.6.9 -f files-data-FC3-2.6.9 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-RHEL4-2.6.9 -f files-data-RHEL4-2.6.9 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-FC4-2.6.11 -f files-data-FC4-2.6.11 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-SL9.3-2.6.11 -f files-data-SL9.3-2.6.11 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-SLES10-2.6.16 -f files-data-SLES10-2.6.16 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %files -n tunables-data-RHEL5-2.6.17 -f files-data-RHEL5-2.6.17 %defattr(-,root,root) %doc %{_var}/%{_lib}/tundb/doc/README %changelog * Mon Sep 18 2006 Nadia Derbey 0.10-1 - The tunables DB is now a shared object (mapped file) - The original package is now delivered in several packages * Mon Jun 05 2006 Nadia Derbey 0.9-1 - Added support for some new tunables - Enhanced add_support.sh script