Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 7ca36ea5097fe6ef6b2e3ef3a8a81f10 > files > 3

libilbc-0.6-1mdk.src.rpm

%define	name	libilbc
%define	version	0.6
%define	rver	06

%define	major	0
%define libname	%mklibname ilbc %{major}

Summary:	Internet Low Bitrate Codec (iLBC) library
Name:		%{name}
Version:	%{version}
Release:	%mkrel 1
License:	Freeware
Group:		System/Libraries
URL:		http://www.ilbcfreeware.org/
#Source0:	http://www.ietf.org/internet-drafts/draft-ietf-avt-ilbc-codec-%{rver}.txt.bz2
Source0:	http://www.ietf.org/rfc/rfc3951.txt.bz2
Source1:	http://www.ilbcfreeware.org/documentation/extract-cfile.awk.bz2
Source2:	http://www.ilbcfreeware.org/documentation/gips_iLBClicense.pdf.bz2
BuildRequires:	gawk
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%description
iLBC (internet Low Bitrate Codec) is a FREE speech codec suitable
for robust voice communication over IP. The codec is designed for
narrow band speech and results in a payload bit rate of 13.33
kbit/s with an encoding frame length of 30 ms and 15.20 kbps with
an encoding length of 20 ms. The iLBC codec enables graceful
speech quality degradation in the case of lost frames, which
occurs in connection with lost or delayed IP packets.

%package -n	%{libname}
Summary:	Internet Low Bitrate Codec (iLBC) library
Group:          System/Libraries
Obsoletes:	%{name}
Provides:	%{name}

%description -n	%{libname}
iLBC (internet Low Bitrate Codec) is a FREE speech codec suitable
for robust voice communication over IP. The codec is designed for
narrow band speech and results in a payload bit rate of 13.33
kbit/s with an encoding frame length of 30 ms and 15.20 kbps with
an encoding length of 20 ms. The iLBC codec enables graceful
speech quality degradation in the case of lost frames, which
occurs in connection with lost or delayed IP packets.

%package -n	%{libname}-devel
Summary:	Static library and header files for the iLBC library
Group:		Development/C
Obsoletes:	%{name}-devel
Provides:	%{name}-devel
Requires:	%{libname} = %{version}

%description -n	%{libname}-devel
iLBC (internet Low Bitrate Codec) is a FREE speech codec suitable
for robust voice communication over IP. The codec is designed for
narrow band speech and results in a payload bit rate of 13.33
kbit/s with an encoding frame length of 30 ms and 15.20 kbps with
an encoding length of 20 ms. The iLBC codec enables graceful
speech quality degradation in the case of lost frames, which
occurs in connection with lost or delayed IP packets.

This package contains the static library and header files.

%prep

%setup -q -c -T -n %{name}-%{version}
bzcat %{SOURCE0} > rfc3951.txt
bzcat %{SOURCE1} > extract-cfile.awk
bzcat %{SOURCE2} > gips_iLBClicense.pdf

awk -f extract-cfile.awk rfc3951.txt

# please teach me indent someday...
perl -pi -e "s|^\ \ \ ||g" *.[ch]

%build

# construct a makefile on the fly
cat > Makefile << EOF
CC=gcc
CFLAGS+=-fPIC -D_REENTRANT
LIB=libilbc.a
SHLIB=libilbc.so

OBJS=anaFilter.o iCBSearch.o packing.o \\
        constants.o gainquant.o iLBC_decode.o StateConstructW.o \\
        createCB.o getCBvec.o iLBC_encode.o StateSearchW.o doCPLC.o \\
        helpfun.o syntFilter.o enhancer.o hpInput.o LPCdecode.o \\
        filter.o hpOutput.o LPCencode.o FrameClassify.o iCBConstruct.o lsf.o

all: shared static

shared: \$(OBJS)
	\$(CC) -Wl,-soname,\$(SHLIB).%{major} -shared \$(CFLAGS) -o \$(SHLIB).%{major}.%{version} *.o

static: \$(OBJS)
	ar cr \$(LIB) \$(OBJS)
	ranlib \$(LIB)
EOF

%make CFLAGS="%{optflags} -fPIC -DPIC -D_REENTRANT"

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_includedir}/ilbc
install -d %{buildroot}%{_libdir}

install -m0755 %{name}.so.%{major}.%{version} %{buildroot}%{_libdir}/
ln -snf %{name}.so.%{major}.%{version} %{buildroot}%{_libdir}/%{name}.so.%{major}
ln -snf %{name}.so.%{major}.%{version} %{buildroot}%{_libdir}/%{name}.so

install -m0644 %{name}.a %{buildroot}%{_libdir}/
install -m0644 *.h %{buildroot}%{_includedir}/ilbc/

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

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

%files -n %{libname}
%defattr(-,root,root)
%doc gips_iLBClicense.pdf
%{_libdir}/*.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%doc rfc3951.txt extract-cfile.awk
%{_includedir}/ilbc
%{_libdir}/*.so
%{_libdir}/*.a

%changelog
* Sun Mar 13 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.6-1mdk
- 0.6 (final rfc3951)
- use the %%mkrel macro
- new S1 and S2

* Sun Sep 26 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.5-1mdk
- initial mandrake package