File libsmf.spec of Package libsmf
%define name libsmf
%define libname %{name}0
# This fixes E: lto-no-text-in-archive (Badness: 10000) /usr/lib/libsmf.a
# https://github.com/rpm-software-management/rpmlint/issues/458
%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
Name: %{name}
Version: 1.3
Release: 1
Summary: Library for handling SMF ("*.mid") files
Group: System/Libraries
License: BSD-2-Clause
Source: %{name}-1.3.tar.xz
URL: http://sourceforge.net/projects/libsmf/files/libsmf/
#-----------------------------------
BuildRequires: glib2-devel
BuildRequires: readline-devel
BuildRequires: automake autoconf libtool
#-----------------------------------
BuildRoot: %{_tmppath}/%{name}-buildroot
%description
LibSMF is a BSD-licensed C library for handling SMF ("*.mid") files.
It transparently handles conversions between time and pulses, tempo
map handling etc. The only dependencies are C compiler and glib. Full
API documentation and examples are included.
%package -n %{libname}
Summary: Library for handling SMF ("*.mid") files
Group: System/Libraries
%description -n %{libname}
LibSMF is a BSD-licensed C library for handling SMF ("*.mid") files.
It transparently handles conversions between time and pulses, tempo
map handling etc. The only dependencies are C compiler and glib. Full
API documentation and examples are included.
This package holds the shared library files.
%package devel
Summary: Development headers for %{name}
Group: Development/Libraries
Provides: %{name}-devel = %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
%description devel
Files needed when developing with LibSMF.
%package devel-static
Summary: Static library for %{name}
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description devel-static
LibSMF as static library.
%prep
%setup -q
%build
autoreconf -fi
export CFLAGS="-DNDEBUG %optflags"
export CXXFLAGS="-DNDEBUG %optflags"
%configure
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%{__make}
%install
%makeinstall
rm -rf %{buildroot}/%{_libdir}/*.la
%clean
rm -rf %{buildroot}
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*
%files -n %{libname}
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/smf.pc
%files devel-static
%defattr(-,root,root,-)
%{_libdir}/*.a
%changelog