29f79b
%global _hardened_build 1
29f79b
Name:		libwebp
29f79b
Version:	0.3.0
29f79b
Release:	5%{?dist}
29f79b
Group:		Development/Libraries
29f79b
URL:		http://webmproject.org/
29f79b
Summary:	Library and tools for the WebP graphics format
29f79b
# Additional IPR is licensed as well. See PATENTS file for details
29f79b
License:	BSD
29f79b
Source0:	http://webp.googlecode.com/files/%{name}-%{version}.tar.gz
29f79b
Source1:	libwebp_jni_example.java	
29f79b
Patch0:		libwebp-0.3.0-endian-check.patch
29f79b
Patch1:		libwebp-0.3.0-endian-check2.patch
29f79b
BuildRequires:	libjpeg-devel libpng-devel libtool swig 
29f79b
BuildRequires:  giflib-devel
29f79b
BuildRequires:  libtiff-devel
29f79b
BuildRequires:	java-devel
29f79b
BuildRequires:	jpackage-utils
29f79b
29f79b
%description
29f79b
WebP is an image format that does lossy compression of digital
29f79b
photographic images. WebP consists of a codec based on VP8, and a
29f79b
container based on RIFF. Webmasters, web developers and browser
29f79b
developers can use WebP to compress, archive and distribute digital
29f79b
images more efficiently.
29f79b
29f79b
%package tools
29f79b
Group:		Development/Tools
29f79b
Summary:	The WebP command line tools
29f79b
29f79b
%description tools
29f79b
WebP is an image format that does lossy compression of digital
29f79b
photographic images. WebP consists of a codec based on VP8, and a
29f79b
container based on RIFF. Webmasters, web developers and browser
29f79b
developers can use WebP to compress, archive and distribute digital
29f79b
images more efficiently.
29f79b
29f79b
%package devel
29f79b
Group:		Development/Libraries
29f79b
Summary:	Development files for libwebp, a library for the WebP format
29f79b
Requires:	%{name}%{?_isa} = %{version}-%{release}
29f79b
29f79b
%description devel
29f79b
WebP is an image format that does lossy compression of digital
29f79b
photographic images. WebP consists of a codec based on VP8, and a
29f79b
container based on RIFF. Webmasters, web developers and browser
29f79b
developers can use WebP to compress, archive and distribute digital
29f79b
images more efficiently.
29f79b
29f79b
%package java
29f79b
Group:		Development/Libraries
29f79b
Summary:	Java bindings for libwebp, a library for the WebP format
29f79b
Requires:	%{name}%{?_isa} = %{version}-%{release}
29f79b
Requires:	java
29f79b
Requires:	jpackage-utils
29f79b
29f79b
%description java
29f79b
Java bindings for libwebp.
29f79b
29f79b
%prep
29f79b
%setup -q
29f79b
%patch0 -p1 -b .endian
29f79b
%patch1 -p1 -b .endian2
29f79b
29f79b
%build
29f79b
mkdir -p m4
29f79b
./autogen.sh
29f79b
# enable libwebpmux since gif2webp depends on it
29f79b
%configure --disable-static --enable-libwebpmux
29f79b
make %{?_smp_mflags}
29f79b
29f79b
# swig generated Java bindings
29f79b
cp %{SOURCE1} .
29f79b
cd swig
29f79b
rm -rf libwebp.jar libwebp_java_wrap.c
29f79b
mkdir -p java/com/google/webp
29f79b
swig -ignoremissing -I../src -java \
29f79b
	-package com.google.webp  \
29f79b
	-outdir java/com/google/webp \
29f79b
	-o libwebp_java_wrap.c libwebp.i
29f79b
29f79b
gcc %{optflags} -shared \
29f79b
	-I/usr/lib/jvm/java/include \
29f79b
	-I/usr/lib/jvm/java/include/linux \
29f79b
	-I../src \
29f79b
	-L../src/.libs -lwebp libwebp_java_wrap.c \
29f79b
	-o libwebp_jni.so
29f79b
29f79b
cd java
29f79b
javac com/google/webp/libwebp.java
29f79b
jar cvf ../libwebp.jar com/google/webp/*.class
29f79b
29f79b
%install
29f79b
%make_install
29f79b
find "%{buildroot}/%{_libdir}" -type f -name "*.la" -delete
29f79b
29f79b
# swig generated Java bindings
29f79b
mkdir -p %{buildroot}/%{_libdir}/%{name}-java
29f79b
cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{name}-java/
29f79b
29f79b
%post -n %{name} -p /sbin/ldconfig
29f79b
29f79b
%postun -n %{name} -p /sbin/ldconfig
29f79b
29f79b
%files tools
29f79b
%{_bindir}/cwebp
29f79b
%{_bindir}/dwebp
29f79b
%{_bindir}/gif2webp
29f79b
%{_bindir}/webpmux
29f79b
%{_mandir}/man*/*
29f79b
29f79b
%files -n %{name}
29f79b
%doc README PATENTS COPYING NEWS AUTHORS
29f79b
%{_libdir}/%{name}*.so.*
29f79b
29f79b
%files devel
29f79b
%{_libdir}/%{name}*.so
29f79b
%{_includedir}/*
29f79b
%{_libdir}/pkgconfig/*
29f79b
29f79b
%files java
29f79b
%doc libwebp_jni_example.java
29f79b
%{_libdir}/%{name}-java/
29f79b
29f79b
%changelog
29f79b
* Mon Oct 13 2014 Jaromir Capik <jcapik@redhat.com> - 0.3.0-5
29f79b
- Removing __PPC__ macro conflicting with __BYTE_ORDER__ endian check (#1127230)
29f79b
- Resolves: rhbz#1127230
29f79b
29f79b
* Mon Aug 18 2014 Peter Robinson <pbrobinson@redhat.com> 0.3.0-4
29f79b
- Fix ppc64le build
29f79b
29f79b
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 0.3.0-3
29f79b
- Mass rebuild 2014-01-24
29f79b
29f79b
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.3.0-2
29f79b
- Mass rebuild 2013-12-27
29f79b
29f79b
* Mon May 13 2013 Rahul Sundaram <sundaram@fedoraproject.org> - 0.3.0-1
29f79b
- upstream release 0.3.0
29f79b
- enable gif2webp
29f79b
- add build requires on giflib-devel and libtiff-devel
29f79b
- use make_install and hardened macros
29f79b
- list binaries explicitly
29f79b
29f79b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
29f79b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
29f79b
29f79b
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> - 0.2.1-2
29f79b
- rebuild due to "jpeg8-ABI" feature drop
29f79b
29f79b
* Thu Dec 27 2012 Rahul Sundaram <sundaram@fedoraproject.org> - 0.2.1-1
29f79b
- new upstream release 0.2.1
29f79b
29f79b
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 0.1.3-3
29f79b
- rebuild against new libjpeg
29f79b
29f79b
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-2
29f79b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
29f79b
29f79b
* Thu Feb 02 2012 Rahul Sundaram <sundaram@fedoraproject.org> - 0.1.3-1
29f79b
- Several spec improvements by Scott Tsai <scottt.tw@gmail.com>
29f79b
29f79b
* Wed May 25 2011 Rahul Sundaram <sundaram@fedoraproject.org> - 0.1.2-1
29f79b
- Initial spec. Based on openSUSE one
29f79b