Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 3356dbf8aaa2515e5150afae5c37892c > files > 4

sysfsutils-2.1.0-16.mga3.src.rpm

%define fname sysfs
%define lib_name_orig lib%{fname}
%define lib_major 2
%define lib_name %mklibname %{fname} %{lib_major}
%define develname %mklibname %{fname} -d
%define staticdevelname %mklibname %{fname} -d -s

%bcond_without	diet
%bcond_without	uclibc

Name: 		sysfsutils
Version: 	2.1.0
Release: 	%mkrel 16
URL:		http://linux-diag.sourceforge.net/
Source0: 	http://prdownloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.bz2
License: 	GPL
Group: 		System/Kernel and hardware
Summary: 	Utility suite to enjoy sysfs
Patch2:		sysfsutils-2.1.0-srcdir-include.patch
Patch3:		sysfsutils-2.1.0-automake-1.13.patch
%if %{with diet}
BuildRequires:	dietlibc-devel
%endif
%if %{with uclibc}
BuildRequires:	uClibc-devel
%endif

%description
This package's purpose is to provide a set of utilities for interfacing
with sysfs, a virtual filesystem in Linux kernel versions 2.5+ that
provides a tree of system devices. While a filesystem is a very useful
interface, we've decided to provide a stable programming interface
that will hopefully make it easier for applications to query system devices
and their attributes.

This package currently includes:

- libsysfs: a library for accessing system devices.
- systool: an application to view system device information by bus, class,
        and topology.

%package -n	%{lib_name}
Summary:	Main library for %{name}
Group:		System/Libraries
Provides:	%{lib_name_orig} = %{version}-%{release}

%description -n	%{lib_name}
This package contains the library needed to run programs dynamically
linked with %{name}. The libsysfs library enables to access system devices.

%package -n	%develname
Summary:	Headers for developing programs that will use %{name}
Group:		Development/C
Requires:	%{lib_name} = %{version}
Provides:	%{lib_name_orig}-devel = %{version}-%{release}
Provides:	%{lib_name_orig}%{lib_major}-devel = %{version}-%{release}
# for Turbolinux compatibility:
Provides:	sysfsutils-devel = %{version}-%{release}
Obsoletes:  %mklibname %{fname} 2 -d
Conflicts:	%{_lib}sysfs1-devel < 2.1.0

%description -n	%develname
This package contains the headers that programmers will need to develop
applications which will use %{name}.

%package -n	%staticdevelname
Summary:	Static library for developing programs that will use %{name}
Group:		Development/C
Requires:	%{lib_name} = %{version} %develname = %{version} 
Provides:	%{lib_name_orig}-static-devel = %{version}-%{release}
Provides:	%{lib_name_orig}%{lib_major}-static-devel = %{version}-%{release}
Obsoletes:  %mklibname %{fname} 2 -d -s

%description -n	%staticdevelname
This package contains the static library that programmers will need to develop
applications which will use %{name}.


%prep
%setup -q
%apply_patches
autoreconf -fi -Im4

%build
%if %{with diet}
mkdir diet
pushd diet
CC="diet gcc" ../configure --enable-static --disable-shared
%make V=1 LD="diet ld" CC="diet cc" CFLAGS="-Os -g"
popd
%endif

%if %{with uclibc}
mkdir uclibc
pushd uclibc
CC="%{uclibc_cc}" CFLAGS="%{uclibc_cflags}" ../configure --enable-static --disable-shared
make V=1
popd
%endif

%configure2_5x --libdir=/%{_lib} --disable-static
%make

%install
%{makeinstall_std}

rm -f %{buildroot}/%{_lib}/*.la

# internal test utility, not useful in package
rm -f %{buildroot}%{_bindir}/dlist_test

install -d %{buildroot}%{_libdir}
#mv %{buildroot}/%{_lib}/*.{so,a} %{buildroot}%{_libdir}
#pushd %{buildroot}%{_libdir}
#ln -sf ../../%{_lib}/libsysfs.so.%{major}.* libsysfs.so
#popd

%if %{with diet}
install -m644 ./diet/lib/.libs/libsysfs.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libsysfs.a
%endif

%if %{with uclibc}
install -m644 ./uclibc/lib/.libs/libsysfs.a -D %{buildroot}%{_prefix}/uclibc/%{_libdir}/libsysfs.a
%endif


%files
%doc AUTHORS README NEWS 
%{_bindir}/systool
%{_bindir}/get_device
%{_bindir}/get_driver
%{_bindir}/get_module
%{_mandir}/man1/*

%files -n %{lib_name}
/%{_lib}/libsysfs.so.%{lib_major}*

%files -n %develname
%doc docs/libsysfs.txt
/%{_lib}/libsysfs.so
%{_includedir}/sysfs/libsysfs.h
%{_includedir}/sysfs/dlist.h
%if %{with diet}
%{_prefix}/lib/dietlibc/lib-%{_arch}/libsysfs.a
%endif
%if %{with uclibc}
%{_prefix}/uclibc/%{_libdir}/libsysfs.a
%endif


%changelog

* Mon Jan 14 2013 umeabot <umeabot> 2.1.0-16.mga3
+ Revision: 383939
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Thu Jan 03 2013 cjw <cjw> 2.1.0-15.mga3
+ Revision: 337919
- patch3: fix build with automake 1.13

* Fri Jun 01 2012 tv <tv> 2.1.0-14.1.mga3
+ Revision: 252921
- add dietlibc & uclibc builds

* Thu Jan 26 2012 fwang <fwang> 2.1.0-14.mga2
+ Revision: 201853
- drop correct .la file
- drop .la file

* Sat Dec 31 2011 blino <blino> 2.1.0-13.mga2
+ Revision: 189288
- do not package dlist_test (#3962)

* Sat Dec 31 2011 blino <blino> 2.1.0-12.mga2
+ Revision: 189283
- update description, use the one from README and drop lsbus mention
  since it has been removed (#3962)

* Wed Jan 12 2011 blino <blino> 2.1.0-11.mga1
+ Revision: 6699
- we are not part of Manbo
- remove old ldconfig scriptlets
- imported package sysfsutils