Blob Blame History Raw
%global maj 0

Name:       lilv
Version:    0.5.0
Release:    3%{?dist}
Summary:    An LV2 Resource Description Framework Library

Group:      System Environment/Libraries
License:    MIT
URL:        http://drobilla.net/software/lilv/
Source0:    http://download.drobilla.net/%{name}-%{version}.tar.bz2
# correct non-deterministic node retrieval of scale points in test suite,
# and increase the size of the test float array
Patch0:     lilv-0.5.0-_lilv_test.c-from-3609-to-3610.patch
Patch1:     lilv-0.5.0-lilv_test.c-r4011.patch 
BuildRequires:  doxygen
BuildRequires:  graphviz
BuildRequires:  sord-devel >= 0.5.0
BuildRequires:  lv2core-devel >= 4.0
BuildRequires:  python2-devel
BuildRequires:  swig

%filter_setup

%description
%{name} is a library to make the use of LV2 plugins as simple as possible 
for applications. Lilv is the successor to SLV2, rewritten to be significantly 
faster and have minimal dependencies. 

%package devel
Summary:    Development libraries and headers for %{name}
Group:      Development/Libraries
Requires:   %{name}%{_isa} = %{version}-%{release}

%description devel
%{name} is a lightweight C library for Resource Description Syntax which 
supports reading and writing Turtle and NTriples.

This package contains the headers and development libraries for %{name}.

%package -n python-%{name}
Summary:    Python bindings for %{name}
Group:      Development/Libraries
Requires:   %{name}%{_isa} = %{version}-%{release}

%description -n python-%{name} 
%{name} is a lightweight C library for Resource Description Syntax which 
supports reading and writing Turtle and NTriples.

This package contains the python libraries for %{name}.

%prep
%setup -q 
%patch0 
%patch1 -p1 

# we'll run ld config
sed -i -e 's|bld.add_post_fun(autowaf.run_ldconfig)||' wscript
# for packagers sake, build the tests with debug symbols
sed -i -e "s| '-ftest-coverage' \]|\
 '-ftest-coverage' \] + '%{optflags}'.split(' ')|" wscript

%build
export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}"
./waf configure -v \
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
    --mandir=%{_mandir} \
    --datadir=%{_datadir} \
    --docdir=%{_docdir}/%{name}-devel-%{version} \
    --configdir=%{_sysconfdir} \
    --test \
    --bindings \
    --docs 
./waf build -v %{?_smp_mflags}

%install
DESTDIR=%{buildroot} ./waf install
chmod +x %{buildroot}%{_libdir}/lib%{name}-0.so.*

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%check
./build/test/lilv_test

%files
%doc AUTHORS ChangeLog README COPYING
%{_libdir}/lib%{name}-%{maj}.so.*
%{_bindir}/lilv-bench
%{_bindir}/lv2info
%{_bindir}/lv2ls
%dir %{_sysconfdir}/bash_completion.d/
%{_sysconfdir}/bash_completion.d/lilv
%{_mandir}/man1/*

%files devel
%{_libdir}/lib%{name}-%{maj}.so
%{_libdir}/pkgconfig/%{name}-%{maj}.pc
%{_includedir}/%{name}-%{maj}/
%{_docdir}/%{name}-devel-%{version}
%{_mandir}/man3/*

%files -n python-%{name}
%{python_sitelib}/%{name}.*
%{python_sitearch}/_%{name}.so

%changelog
* Wed Feb 29 2012 Brendan Jones <brendan.jones.it@gmail.com> - 0.5.0-3
- Remove redundant build requires, merge python bindings
- Move man3 pages to devel package
- Apply patch to correct scale points iteration in test suite

* Sun Feb 26 2012 Brendan Jones <brendan.jones.it@gmail.com> - 0.5.0-2
- Add python bindings, and missing build requires
- Move man pages to main package

* Fri Dec 23 2011 Brendan Jones <brendan.jones.it@gmail.com> - 0.5.0-1
- Initial build