# # 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: 2 Summary: A library that standardizes the access to kernel tunables Group: System Environment/Libraries License: LGPL URL: http://libtune.sourceforge.net Source: %{name}-%{version}-%{release}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: tunables-generic-data = %{version} Requires: tunables-distro-data = %{version} 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} Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig %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.16 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data = %{version} %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.18 Summary: Kernel-dependent tunables database Group: System Environment/Libraries Provides: tunables-generic-data = %{version} %description -n tunables-data-2.6.18 This package supplies the tunables database for kernel release 2.6.18 %package -n tunables-data-FC5-2.6.16 Summary: Distro-dependent tunables database Group: System Environment/Libraries Provides: tunables-distro-data = %{version} Requires: tunables-data-2.6.16 = %{version} %description -n tunables-data-FC5-2.6.16 This package supplies the tunables database for Fedora Core 5's 2.6.16 %package -n tunables-data-FC6-2.6.18 Summary: Distro-dependent tunables database Group: System Environment/Libraries Provides: tunables-distro-data = %{version} Requires: tunables-data-2.6.18 = %{version} %description -n tunables-data-FC6-2.6.18 This package supplies the tunables database for Fedora Core 6's 2.6.18 %prep %setup -q -n %{name}-%{version}-%{release} %build export CFLAGS="%{optflags}" make -C lib %{?_smp_mflags} make -C scripts %{?_smp_mflags} %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/%{_datadir}/libtune mkdir -p $RPM_BUILD_ROOT/%{_bindir} 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 nb_dbs=2 kreleases=("2.6.16" "2.6.18") families=("FC" "FC") freleases=(5 6) i=0 while [ ${i} -lt ${nb_dbs} ] do KVERSION=${kreleases[${i}]} FAMILY=${families[${i}]} FRELEASE=${freleases[${i}]} $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 dmanifest=files-data-${FAMILY}${FRELEASE}-${KVERSION} echo "%defattr(-,root,root)" > $dmanifest echo "%{_datadir}/libtune/base-${KVERSION}/distro-${FAMILY}_${FRELEASE}/tundb_distro" >> $dmanifest kmanifest=files-data-${KVERSION} echo "%defattr(-,root,root)" > $kmanifest echo "%{_datadir}/libtune/base-${KVERSION}/tundb_kernel" >> $kmanifest echo "%{_datadir}/libtune/base-${KVERSION}/libtuninitdb_base.h" >> \ $devel_manifest echo "%{_datadir}/libtune/base-${KVERSION}/distro-${FAMILY}_${FRELEASE}/libtuninitdb_distro.h" >> $devel_manifest clean_str="make -C db KVERSION=$KVERSION FAMILY=$FAMILY \ FRELEASE=$FRELEASE clean" i=`expr $i + 1` done make -C templates install INSTDIR=$RPM_BUILD_ROOT db/libtuncleandb $RPM_BUILD_ROOT/%{_datadir}/libtune/tundb_kernel \ $RPM_BUILD_ROOT/%{_datadir}/libtune/tundb_distro %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %post devel /sbin/chkconfig --add chtunedb /sbin/ldconfig %post -n tunables-data-2.6.16 /usr/share/libtune/bin/libtune_upgrade.sh post base-2.6.16 tundb_kernel %post -n tunables-data-2.6.18 /usr/share/libtune/bin/libtune_upgrade.sh post base-2.6.18 tundb_kernel %post -n tunables-data-FC5-2.6.16 /usr/share/libtune/bin/libtune_upgrade.sh post base-2.6.16/distro-FC_5 \ tundb_distro %post -n tunables-data-FC6-2.6.18 /usr/share/libtune/bin/libtune_upgrade.sh post base-2.6.18/distro-FC_6 \ tundb_distro %preun devel # # There's no need to chtunedb before deleting it: it is not a daemon # /sbin/chkconfig --del chtunedb %preun -n tunables-data-2.6.16 /usr/share/libtune/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-2.6.18 /usr/share/libtune/bin/libtune_upgrade.sh prekernel %preun -n tunables-data-FC5-2.6.16 /usr/share/libtune/bin/libtune_upgrade.sh predistro %preun -n tunables-data-FC6-2.6.18 /usr/share/libtune/bin/libtune_upgrade.sh predistro %postun -p /sbin/ldconfig %postun devel -p /sbin/ldconfig %files %defattr(-,root,root) %{_libdir}/libtune.la %{_libdir}/libtune.so.* %{_bindir}/get_tunedb %doc COPYING lib/LGPL ChangeLog %files devel -f files-devel %defattr(-,root,root) %{_includedir}/libtune.h %{_libdir}/libtune.a %{_libdir}/libtune.so %{_datadir}/libtune/bin/get_distro.sh %{_initrddir}/chtunedb %{_sysconfdir}/rc.d/rc3.d/S99chtunedb %{_sysconfdir}/rc.d/rc4.d/S99chtunedb %{_sysconfdir}/rc.d/rc5.d/S99chtunedb %{_datadir}/libtune/templates %{_datadir}/libtune/bin/add_distro.sh %{_datadir}/libtune/bin/add_kernel.sh %{_bindir}/add_tunable %{_datadir}/libtune/bin/add_tunable.awk %{_datadir}/libtune/bin/add_tunable.sh %{_datadir}/libtune/bin/contents_attributes %{_datadir}/libtune/bin/name_attributes %{_datadir}/libtune/bin/new_tunable.awk %{_datadir}/libtune/bin/new_tunable.sh %{_bindir}/remove_tunable %{_datadir}/libtune/bin/remove_tunable.awk %{_datadir}/libtune/bin/remove_tunable.sh %{_datadir}/libtune/bin/rpm_constants.sh %{_datadir}/libtune/bin/scripts_constants.sh %{_datadir}/libtune/bin/scripts_lib.sh %{_datadir}/libtune/bin/strategy_routines %doc %{_datadir}/libtune/doc/README %doc templates/GPL %files -n tunables-data-2.6.16 -f files-data-2.6.16 %defattr(-,root,root) %{_datadir}/libtune/bin/libtune_upgrade.sh %doc %{_datadir}/libtune/doc/README %files -n tunables-data-2.6.18 -f files-data-2.6.18 %defattr(-,root,root) %{_datadir}/libtune/bin/libtune_upgrade.sh %doc %{_datadir}/libtune/doc/README %files -n tunables-data-FC5-2.6.16 -f files-data-FC5-2.6.16 %defattr(-,root,root) %doc %{_datadir}/libtune/doc/README %files -n tunables-data-FC6-2.6.18 -f files-data-FC6-2.6.18 %defattr(-,root,root) %doc %{_datadir}/libtune/doc/README %changelog * Mon Oct 23 2006 Nadia Derbey 0.10-2 - Many fixes in the specfile (see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210007) * 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