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