File libopusenc.spec of Package libopusenc

%define realname libopusenc
%define realver  0.2.1
%define srcext   tar.gz

%define so_ver   0

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}%{?so_ver}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       BSD-3-Clause
Group:         System/Libraries
URL:           http://opus-codec.org/
Summary:       High-level API for encoding .opus files

# Build-time parameters
BuildRequires: pkg-config
BuildRequires: pkgconfig(opus) >= 1.1
# Documentation deps
BuildRequires: doxygen graphviz
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://archive.mozilla.org/pub/opus/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
The libopusenc libraries provide a high-level API for encoding .opus files.
libopusenc depends only on libopus.

# Development stuff
%package -n %{realname}-devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{name} = %{version}-%{release}
Provides:      %{name}-devel = %{version}-%{release}

%description -n %{realname}-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}

# Build step (compile/build binaries, documentation, etc)
%build
%configure \
 --docdir=%{_defaultdocdir}/%{realname}-devel \
 --disable-static \
 --disable-examples \
 CFLAGS="%{optflags} %{?gcc_lto}" \
 CXXFLAGS="%{optflags} %{?gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"
%{__make} %{?_smp_mflags}

# Install built stuff (into temporary root)
%install
%{__make} install DESTDIR=%{buildroot}

# Cleanup
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

# Library
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README.md
%{_libdir}/*.so.%{?so_ver}*

# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%docdir %{_defaultdocdir}/%{realname}-devel
%doc %{_defaultdocdir}/%{realname}-devel/*
%dir %{_includedir}/opus/
%{_includedir}/opus/opusenc.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%exclude %{_libdir}/*.la

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
openSUSE Build Service is sponsored by