#
# Conditional build:
-%bcond_without gomp # OpenMP support
-%bcond_without gpl2 # GPL v2+ demosaic pack
-%bcond_without gpl3 # GPL v3+ demosaic pack
+%bcond_without openmp # OpenMP support
+%bcond_without zlib # ZLIB for deflated DNG format support
#
-%if %{without gpl2}
-%undefine gpl3
-%endif
Summary: LibRaw - a library for reading RAW files
Summary(pl.UTF-8): LibRaw - biblioteka do odczytu plików RAW
Name: libraw
-Version: 0.15.4
+Version: 0.21.2
Release: 1
-%if %{with gpl3}
-License: GPL v3+
-%else
-%if %{with gpl2}
-License: GPL v2+
-%else
-License: LGPL v2.1 or CDDL v1.0 or LibRaw Software License
-%endif
-%endif
+License: LGPL v2.1 or CDDL v1.0
Group: Libraries
#Source0Download: http://www.libraw.org/download#stable
-Source0: http://www.libraw.org/data/LibRaw-%{version}.tar.gz
-# Source0-md5: 1f4388f66ae3657818fdbfb311be7766
-Source1: http://www.libraw.org/data/LibRaw-demosaic-pack-GPL2-%{version}.tar.gz
-# Source1-md5: f6cd95013a47e1cef7a6ef1995c61ded
-Source2: http://www.libraw.org/data/LibRaw-demosaic-pack-GPL3-%{version}.tar.gz
-# Source2-md5: 729895293f375d76eb96b00e399f3e05
-URL: http://www.libraw.org/
-%{?with_gomp:BuildRequires: gcc >= 6:4.2}
+Source0: https://www.libraw.org/data/LibRaw-%{version}.tar.gz
+# Source0-md5: 0533724bad17c0fde22e642e4594e45d
+Patch0: int64.patch
+URL: https://www.libraw.org/
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake
+%{?with_openmp:BuildRequires: gcc >= 6:4.2}
BuildRequires: jasper-devel
-BuildRequires: lcms2-devel
-%{?with_gomp:BuildRequires: libgomp-devel}
-BuildRequires: libjpeg-devel
+BuildRequires: lcms2-devel >= 2
+%{?with_openmp:BuildRequires: libgomp-devel}
+BuildRequires: libjpeg-devel >= 8
BuildRequires: libstdc++-devel
+BuildRequires: libtool
BuildRequires: pkgconfig
+# zlib with pkgconfig support
+%{?with_zlib:BuildRequires: zlib-devel >= 1.2.3.3}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: jasper-devel
-Requires: lcms2-devel
-%{?with_gomp:Requires: libgomp-devel}
-Requires: libjpeg-devel
+Requires: lcms2-devel >= 2
+%{?with_openmp:Requires: libgomp-devel}
+Requires: libjpeg-devel >= 8
Requires: libstdc++-devel
+%{?with_zlib:Requires: zlib-devel >= 1.2.3.3}
%description devel
Header files for LibRaw.
Statyczna biblioteka LibRaw.
%prep
-%setup -q -n LibRaw-%{version} %{?with_gpl2:-a1} %{?with_gpl3:-a2}
-
-%if %{with gpl2}
-for f in LibRaw-demosaic-pack-GPL2-%{version}/{COPYRIGHT,Changelog,README} ; do
- cp -p $f $(basename $f).demosaic-pack-GPL2
-done
-%endif
-%if %{with gpl3}
-for f in LibRaw-demosaic-pack-GPL3-%{version}/{COPYRIGHT,Changelog,README} ; do
- cp -p $f $(basename $f).demosaic-pack-GPL3
-done
-%endif
+%setup -q -n LibRaw-%{version}
+%patch0 -p1
%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__automake}
%configure \
- %{!?with_gomp:--disable-openmp}
+ %{!?with_openmp:--disable-openmp} \
+ %{?with_zlib:--enable-zlib}
-%{__make} \
- %{?with_gomp:lib_libraw_la_LIBADD=-lgomp lib_libraw_r_la_LIBADD=-lgomp}
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libraw*.la
+
# packaged as %doc
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
%files
%defattr(644,root,root,755)
-%doc COPYRIGHT Changelog.txt LICENSE.LibRaw.pdf README README.demosaic-packs %{?with_gpl2:*.demosaic-pack-GPL2} %{?with_gpl3:*.demosaic-pack-GPL3}
-%lang(ru) %doc Changelog.rus README.demosaic-packs.rus
-%attr(755,root,root) %ghost %{_libdir}/libraw.so.?
-%attr(755,root,root) %{_libdir}/libraw.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/libraw_r.so.?
-%attr(755,root,root) %{_libdir}/libraw_r.so.*.*
+%doc COPYRIGHT Changelog.txt README.md LICENSE.CDDL LICENSE.LGPL
+%attr(755,root,root) %{_libdir}/libraw.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libraw.so.23
+%attr(755,root,root) %{_libdir}/libraw_r.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libraw_r.so.23
%files samples
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/multirender_test
%attr(755,root,root) %{_bindir}/postprocessing_benchmark
%attr(755,root,root) %{_bindir}/raw-identify
+%attr(755,root,root) %{_bindir}/rawtextdump
%attr(755,root,root) %{_bindir}/simple_dcraw
%attr(755,root,root) %{_bindir}/unprocessed_raw
%files devel
%defattr(644,root,root,755)
-%doc doc/{index.html,*-eng.html}
-%lang(ru) %doc doc/*-rus.html
+%doc doc/*.html
%attr(755,root,root) %{_libdir}/libraw.so
%attr(755,root,root) %{_libdir}/libraw_r.so
-%{_libdir}/libraw.la
-%{_libdir}/libraw_r.la
%{_includedir}/libraw
%{_pkgconfigdir}/libraw.pc
%{_pkgconfigdir}/libraw_r.pc