File libfreeaptx.spec of Package libfreeaptx

%define realname libfreeaptx
%define srcext   tar.bz2

%define so_ver   0

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

# Common info
Name:          %{realname}%{?so_ver}
Version:       0
Release:       wiz%{?extraver:0.}1%{?dist}
License:       LGPL-2.1
Group:         System/Libraries
URL:           https://github.com/iamthehorker/libfreeaptx
Summary:       Free implementation of Audio Processing Technology codec (aptX)

# Install-time parameters

# Build-time parameters
BuildRequires: pkg-config
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

%description
libfreeaptx is based on version 0.2.0 of libopenaptx with the intent of continuing
under a free license without the additional license restriction added to 0.2.1.

It provides dynamic linked shared library libfreeaptx.so and simple command line
utilities freeaptxenc and freeaptxdec for encoding and decoding operations.
Documentation for shared library is provided in C header file freeaptx.h.

There is support for aptX and aptX HD codec variants. Both variants operates on
a raw 24 bit signed stereo audio samples. aptX provides fixed compress ratio 6:1
and aptX HD fixed compress ratio 4:1.

%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}-%{version}%{?extraver}

%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%{__make} %{?_smp_mflags} \
  CC=gcc \
  CFLAGS="$_CFLAGS" \
  LDFLAGS="$_LDFLAGS" \
  PREFIX=%{_prefix} \
  LIBDIR=%{_lib}

%install
%{__make} install DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_lib}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%license COPYING
%doc README
%{_bindir}/freeaptx*
%{_libdir}/*.so.%{?so_ver}*

# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/%{realname}.pc
%{_includedir}/freeaptx.h
%{_libdir}/*.so

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

%changelog
openSUSE Build Service is sponsored by