9fa5f4
%if 0%{?rhel}
9fa5f4
%bcond_with workshop
9fa5f4
%else
9fa5f4
%bcond_without workshop
9fa5f4
%endif
9fa5f4
9fa5f4
# skip all tests
9fa5f4
%global skip_all_checks 1
9fa5f4
# skip tests known to be problematic in a specific version
9fa5f4
%global skip_checks_version 0.2.0
9fa5f4
# for some reason or other comparing generated to reference images segfaults in
9fa5f4
# two test cases
9fa5f4
# Well, now it is all of them, not just two. :/
9fa5f4
%global skip_checks compositions/run-*.xml.sh
9fa5f4
9fa5f4
Summary:    A graph based image processing framework
9fa5f4
Name:       gegl
9fa5f4
Version:    0.2.0
9fa5f4
Release:    19%{?dist}
9fa5f4
9fa5f4
# Compute some version related macros
9fa5f4
# Ugly hack, you need to get your quoting backslashes/percent signs straight
9fa5f4
%global major %(ver=%version; echo ${ver%%%%.*})
9fa5f4
%global minor %(ver=%version; ver=${ver#%major.}; echo ${ver%%%%.*})
9fa5f4
%global micro %(ver=%version; ver=${ver#%major.%minor.}; echo ${ver%%%%.*})
9fa5f4
%global apiver %major.%minor
9fa5f4
9fa5f4
# The binary is under the GPL, while the libs are under LGPL
9fa5f4
License:    LGPLv3+ and GPLv3+
9fa5f4
Group:      System Environment/Libraries
9fa5f4
URL:        http://www.gegl.org/
9fa5f4
Source0:    ftp://ftp.gimp.org/pub/gegl/%{apiver}/%{name}-%{version}.tar.bz2
9fa5f4
Patch0:     gegl-0.2.0-lua-5.2.patch
9fa5f4
Patch1:     gegl-0.2.0-CVE-2012-4433.patch
9fa5f4
Patch2:     gegl-0.2.0-remove-src-over-op.patch
9fa5f4
BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9fa5f4
BuildRequires:  asciidoc
9fa5f4
BuildRequires:  babl-devel >= 0.1.10
9fa5f4
BuildRequires:  cairo-devel
9fa5f4
BuildRequires:  enscript
9fa5f4
BuildRequires:  exiv2-devel
9fa5f4
BuildRequires:  gdk-pixbuf2-devel >= 2.18.0
9fa5f4
BuildRequires:  glib2-devel >= 2.28.0
9fa5f4
BuildRequires:  graphviz
9fa5f4
BuildRequires:  gtk2-devel >= 2.18.0
9fa5f4
BuildRequires:  intltool >= 0.40.1
9fa5f4
BuildRequires:  jasper-devel >= 1.900.1
9fa5f4
%if %{with workshop}
9fa5f4
BuildRequires:  lensfun-devel >= 0.2.5
9fa5f4
%endif
9fa5f4
BuildRequires:  libjpeg-devel
9fa5f4
BuildRequires:  libopenraw-devel >= 0.0.5
9fa5f4
BuildRequires:  libpng-devel
9fa5f4
BuildRequires:  librsvg2-devel >= 2.14.0
9fa5f4
BuildRequires:  libspiro-devel
9fa5f4
BuildRequires:  libv4l-devel
9fa5f4
BuildRequires:  lua-devel >= 5.1.0
9fa5f4
BuildRequires:  OpenEXR-devel
9fa5f4
BuildRequires:  pango-devel
9fa5f4
BuildRequires:  perl-devel
9fa5f4
BuildRequires:  pkgconfig
9fa5f4
BuildRequires:  ruby
9fa5f4
BuildRequires:  SDL-devel
9fa5f4
BuildRequires:  suitesparse-devel
9fa5f4
Requires:       babl%{?_isa} >= 0.1.10
9fa5f4
Requires:	dcraw
9fa5f4
9fa5f4
%description
9fa5f4
GEGL (Generic Graphics Library) is a graph based image processing framework. 
9fa5f4
GEGLs original design was made to scratch GIMPs itches for a new
9fa5f4
compositing and processing core. This core is being designed to have
9fa5f4
minimal dependencies. and a simple well defined API.
9fa5f4
9fa5f4
%if %{with workshop}
9fa5f4
%package operations-workshop
9fa5f4
Summary:    Experimental operations for GEGL
9fa5f4
Group:      System Environment/Libraries
9fa5f4
Requires:   %{name}%{_isa} = %{version}-%{release}
9fa5f4
9fa5f4
%description operations-workshop
9fa5f4
This package contains experimental operations for GEGL. If used they may yield
9fa5f4
unwanted results, or even crash. You're warned!
9fa5f4
%endif
9fa5f4
9fa5f4
%package devel
9fa5f4
Summary:    Headers for developing programs that will use %{name}
9fa5f4
Group:      Development/Libraries
9fa5f4
Requires:   %{name}%{_isa} = %{version}-%{release}
9fa5f4
Requires:   pkgconfig
9fa5f4
Requires:   babl-devel%{_isa}
9fa5f4
Requires:   glib2-devel%{_isa}
9fa5f4
9fa5f4
%description devel
9fa5f4
This package contains the libraries and header files needed for
9fa5f4
developing with %{name}.
9fa5f4
9fa5f4
%prep
9fa5f4
%setup -q
9fa5f4
%patch0 -p1 -b .lua-5.2
9fa5f4
%patch1 -p1 -b .CVE-2012-4433
9fa5f4
%patch2 -p1 -b .remove-src-over-op
9fa5f4
9fa5f4
%build
9fa5f4
# use hardening compiler/linker flags because gegl is likely to deal with
9fa5f4
# untrusted input
9fa5f4
%define _hardened_build 1
9fa5f4
9fa5f4
# Needed by Ruby 1.9.3.
9fa5f4
export LANG=en_US.utf8
9fa5f4
9fa5f4
%configure \
9fa5f4
%if %{with workshop}
9fa5f4
    --enable-workshop \
9fa5f4
%else
9fa5f4
    --disable-workshop \
9fa5f4
%endif
9fa5f4
    --with-pic \
9fa5f4
    --with-gio \
9fa5f4
    --with-gtk \
9fa5f4
    --with-cairo \
9fa5f4
    --with-pango \
9fa5f4
    --with-pangocairo \
9fa5f4
    --with-gdk-pixbuf \
9fa5f4
    --with-lensfun \
9fa5f4
    --with-libjpeg \
9fa5f4
    --with-libpng \
9fa5f4
    --with-librsvg \
9fa5f4
    --with-openexr \
9fa5f4
    --with-sdl \
9fa5f4
    --with-libopenraw \
9fa5f4
    --with-jasper \
9fa5f4
    --with-graphviz \
9fa5f4
    --with-lua \
9fa5f4
    --without-libavformat \
9fa5f4
    --with-libv4l \
9fa5f4
    --with-libspiro \
9fa5f4
    --with-exiv2 \
9fa5f4
    --with-umfpack \
9fa5f4
    --disable-static \
9fa5f4
    --disable-gtk-doc
9fa5f4
9fa5f4
make %{?_smp_mflags}
9fa5f4
9fa5f4
%install
9fa5f4
rm -rf %{buildroot}
9fa5f4
make DESTDIR=%{buildroot} install INSTALL='install -p'
9fa5f4
pushd operations
9fa5f4
# favor non-workshop binaries
9fa5f4
make SUBDIRS= install INSTALL='install -p'
9fa5f4
for d in */; do
9fa5f4
    d="${d%/}"
9fa5f4
    if [ "$d" != "workshop" ]; then
9fa5f4
        pushd "$d"
9fa5f4
        make DESTDIR=%{buildroot} install INSTALL='install -p'
9fa5f4
        popd
9fa5f4
    fi
9fa5f4
done
9fa5f4
popd
9fa5f4
9fa5f4
rm -f %{buildroot}%{_libdir}/*.la
9fa5f4
rm -f %{buildroot}%{_libdir}/gegl-%{apiver}/*.la
9fa5f4
9fa5f4
# keep track of workshop/non-workshop operations
9fa5f4
opsdir="$PWD/operations"
9fa5f4
9fa5f4
files_ws="$PWD/operations_files_workshop"
9fa5f4
files_non_ws="$PWD/operations_files"
9fa5f4
non_ws_filenames_file="$PWD/non_ws_filenames"
9fa5f4
9fa5f4
find "$opsdir" -path "$opsdir/workshop" -prune -o -regex '.*/\.libs/.*\.so' -printf '%f\n' > "$non_ws_filenames_file"
9fa5f4
9fa5f4
echo '%%defattr(-, root, root, -)' > "$files_non_ws"
9fa5f4
echo '%%defattr(-, root, root, -)' > "$files_ws"
9fa5f4
9fa5f4
pushd %{buildroot}%{_libdir}/gegl-%{apiver}
9fa5f4
for opfile in *.so; do
9fa5f4
    if fgrep -q -x "$opfile" "$non_ws_filenames_file"; then
9fa5f4
        echo "%{_libdir}/gegl-%{apiver}/$opfile" >> "$files_non_ws"
9fa5f4
    else
9fa5f4
        echo "%{_libdir}/gegl-%{apiver}/$opfile" >> "$files_ws"
9fa5f4
    fi
9fa5f4
done
9fa5f4
popd
9fa5f4
9fa5f4
%find_lang %{name}-%{apiver}
9fa5f4
9fa5f4
%check
9fa5f4
%if 0%{skip_all_checks} < 1
9fa5f4
# skip tests known to be problematic in a specific version
9fa5f4
%if "%version" == "%skip_checks_version"
9fa5f4
pushd tests
9fa5f4
for problematic in %skip_checks; do
9fa5f4
    rm -f "$problematic"
9fa5f4
    cat << EOF > "$problematic"
9fa5f4
#!/bin/sh
9fa5f4
echo Skipping test "$problematic"
9fa5f4
EOF
9fa5f4
    chmod +x "$problematic"
9fa5f4
done
9fa5f4
popd
9fa5f4
%endif
9fa5f4
make check
9fa5f4
%endif
9fa5f4
9fa5f4
%clean
9fa5f4
rm -rf %{buildroot}
9fa5f4
9fa5f4
%post -p /sbin/ldconfig
9fa5f4
9fa5f4
%postun -p /sbin/ldconfig
9fa5f4
9fa5f4
%files -f operations_files -f %{name}-%{apiver}.lang
9fa5f4
%defattr(-, root, root, -)
9fa5f4
%doc AUTHORS ChangeLog COPYING COPYING.LESSER NEWS README
9fa5f4
%{_bindir}/gegl
9fa5f4
%{_libdir}/*.so.*
9fa5f4
%dir %{_libdir}/gegl-%{apiver}/
9fa5f4
9fa5f4
%if %{with workshop}
9fa5f4
%files operations-workshop -f operations_files_workshop
9fa5f4
%endif
9fa5f4
9fa5f4
%files devel
9fa5f4
%defattr(-, root, root, -)
9fa5f4
%doc %{_datadir}/gtk-doc/
9fa5f4
%{_includedir}/gegl-%{apiver}/
9fa5f4
%{_libdir}/*.so
9fa5f4
%{_libdir}/pkgconfig/%{name}-%{apiver}.pc
9fa5f4
9fa5f4
%changelog
9fa5f4
* Thu Dec  1 2016 Josef Ridky <jridky@redhat.com> - 0.2.0-19
9fa5f4
- add Requires: dcraw (#1279144)
9fa5f4
9fa5f4
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 0.2.0-18
9fa5f4
- Mass rebuild 2014-01-24
9fa5f4
9fa5f4
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.2.0-17
9fa5f4
- Mass rebuild 2013-12-27
9fa5f4
9fa5f4
* Wed Dec 04 2013 Nils Philippsen <nils@redhat.com> - 0.2.0-16
9fa5f4
- remove BR: w3m, it's only needed for "make dist"
9fa5f4
9fa5f4
* Tue Dec 03 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.2.0-15
9fa5f4
- rebuild (exiv2)
9fa5f4
9fa5f4
* Wed Nov 27 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.2.0-14
9fa5f4
- rebuild (openexr)
9fa5f4
9fa5f4
* Thu Sep 12 2013 Kalev Lember <kalevlember@gmail.com> - 0.2.0-13
9fa5f4
- Rebuilt for ilmbase soname bump
9fa5f4
9fa5f4
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-12
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
9fa5f4
9fa5f4
* Mon Jul 01 2013 Nils Philippsen <nils@redhat.com> - 0.2.0-11
9fa5f4
- replace lua-5.2 patch by upstream commit
9fa5f4
- fix buffer overflow in and add plausibility checks to ppm-load op
9fa5f4
  (CVE-2012-4433)
9fa5f4
- fix multi-lib issue in generated documentation
9fa5f4
9fa5f4
* Wed May 15 2013 Tom Callaway <spot@fedoraproject.org> - 0.2.0-10
9fa5f4
- rebuild for lua 5.2
9fa5f4
- disable check suite (so broken)
9fa5f4
9fa5f4
* Sun Mar 10 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.2.0-9
9fa5f4
- rebuild (OpenEXR)
9fa5f4
9fa5f4
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-8
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9fa5f4
9fa5f4
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> - 0.2.0-7
9fa5f4
- rebuild due to "jpeg8-ABI" feature drop
9fa5f4
9fa5f4
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 0.2.0-6
9fa5f4
- rebuild against new libjpeg
9fa5f4
9fa5f4
* Fri Oct 19 2012 Nils Philippsen <nils@redhat.com> - 0.2.0-5
9fa5f4
- don't catch "make check" errors but skip known problematic tests
9fa5f4
9fa5f4
* Fri Oct 19 2012 Nils Philippsen <nils@redhat.com> - 0.2.0-4
9fa5f4
- don't require lensfun-devel for building without workshop ops
9fa5f4
9fa5f4
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-3
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9fa5f4
9fa5f4
* Wed May 02 2012 Rex Dieter <rdieter@fedoraproject.org> - 0.2.0-2
9fa5f4
- rebuild (exiv2)
9fa5f4
9fa5f4
* Tue Apr 03 2012 Nils Philippsen <nils@redhat.com> - 0.2.0-1
9fa5f4
- version 0.2.0
9fa5f4
- split off workshop (i.e. experimental) operations
9fa5f4
- don't build/package workshop operations on EL
9fa5f4
9fa5f4
* Mon Feb 06 2012 Vít Ondruch <vondruch@redhat.com> - 0.1.8-3
9fa5f4
- Rebuilt for Ruby 1.9.3.
9fa5f4
9fa5f4
* Tue Jan 10 2012 Nils Philippsen <nils@redhat.com> - 0.1.8-2
9fa5f4
- rebuild for gcc 4.7
9fa5f4
9fa5f4
* Tue Dec 13 2011 Nils Philippsen <nils@redhat.com> - 0.1.8-1
9fa5f4
- version 0.1.8
9fa5f4
- drop all patches
9fa5f4
- add BRs: gdk-pixbuf2-devel, lensfun-devel
9fa5f4
- update BR version: glib2-devel
9fa5f4
- use %%_hardened_build macro instead of supplying our own hardening flags
9fa5f4
9fa5f4
* Thu Nov 17 2011 Nils Philippsen <nils@redhat.com> - 0.1.6-5
9fa5f4
- don't require gtk-doc (#707554)
9fa5f4
9fa5f4
* Mon Nov 07 2011 Nils Philippsen <nils@redhat.com> - 0.1.6-4
9fa5f4
- rebuild (libpng)
9fa5f4
9fa5f4
* Fri Oct 14 2011 Rex Dieter <rdieter@fedoraproject.org> - 0.1.6-3
9fa5f4
- rebuild (exiv2)
9fa5f4
9fa5f4
* Wed Apr 06 2011 Nils Philippsen <nils@redhat.com> - 0.1.6-2
9fa5f4
- fix crash when using hstack operation (#661533)
9fa5f4
9fa5f4
* Tue Feb 22 2011 Nils Philippsen <nils@redhat.com> - 0.1.6-1
9fa5f4
- version 0.1.6
9fa5f4
- remove obsolete patches
9fa5f4
- fix erroneous use of destdir
9fa5f4
- correct source URL
9fa5f4
- add BR: exiv2-devel, jasper-devel, suitesparse-devel
9fa5f4
- update BR versions
9fa5f4
- update --with-*/--without-* configure flags
9fa5f4
- replace tabs with spaces for consistency
9fa5f4
9fa5f4
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-5
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
9fa5f4
9fa5f4
* Tue Oct 19 2010 Nils Philippsen <nils@redhat.com> - 0.1.2-4
9fa5f4
- don't leak "root" symbol which clashes with (equally broken) xvnkb input
9fa5f4
  method (#642992)
9fa5f4
9fa5f4
* Wed Jun 23 2010 Nils Philippsen <nils@redhat.com> - 0.1.2-3
9fa5f4
- build with -fno-strict-aliasing
9fa5f4
- use PIC/PIE because gegl is likely to deal with data coming from untrusted
9fa5f4
  sources
9fa5f4
9fa5f4
* Fri Feb 26 2010 Nils Philippsen <nils@redhat.com>
9fa5f4
- use tabs consistently
9fa5f4
- let devel depend on gtk-doc
9fa5f4
9fa5f4
* Fri Feb 19 2010 Nils Philippsen <nils@redhat.com> - 0.1.2-2
9fa5f4
- ignore make check failures for now
9fa5f4
9fa5f4
* Wed Feb 17 2010 Nils Philippsen <nils@redhat.com>
9fa5f4
- avoid buffer overflow in gegl_buffer_header_init()
9fa5f4
- correct gegl library version, use macro for it
9fa5f4
9fa5f4
* Tue Feb 16 2010 Nils Philippsen <nils@redhat.com> - 0.1.2-1
9fa5f4
- version 0.1.2
9fa5f4
- remove obsolete cflags, babl-instrumentation, autoreconf patches
9fa5f4
- backported: don't leak each node set on a GeglProcessor
9fa5f4
9fa5f4
* Sat Jan 23 2010 Deji Akingunola <dakingun@gmail.com> - 0.1.0-3
9fa5f4
- Rebuild for babl-0.1.2
9fa5f4
- Backport upstream patch that removed babl processing time instrumentation
9fa5f4
9fa5f4
* Wed Jan 20 2010 Nils Philippsen <nils@redhat.com>
9fa5f4
- use tabs consistently to appease rpmdiff
9fa5f4
9fa5f4
* Tue Aug 18 2009 Nils Philippsen <nils@redhat.com>
9fa5f4
- explain patches
9fa5f4
9fa5f4
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.0-2
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
9fa5f4
9fa5f4
* Thu Jul 02 2009 Nils Philippsen - 0.1.0-1
9fa5f4
- fix cflags for building
9fa5f4
9fa5f4
* Thu Jul 02 2009 Nils Philippsen
9fa5f4
- version 0.1.0
9fa5f4
- use "--disable-gtk-doc" to avoid rebuilding documentation (#481404)
9fa5f4
- remove *.la files in %%{_libdir}/gegl-*/ (#509292)
9fa5f4
9fa5f4
* Thu Jun 04 2009 Deji Akingunola <dakingun@gmail.com> - 0.0.22-5
9fa5f4
- Apply patch to build with babl-0.1.0 API changes
9fa5f4
9fa5f4
* Thu Jun 04 2009 Nils Philippsen - 0.0.22-4
9fa5f4
- rebuild against babl-0.1.0
9fa5f4
9fa5f4
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.22-3
9fa5f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
9fa5f4
9fa5f4
* Thu Jan 29 2009 Nils Philippsen - 0.0.22-2
9fa5f4
- use the same timestamps for certain documentation files on all architectures
9fa5f4
  to avoid multi-lib conflicts (#481404)
9fa5f4
- consolidate spec files between OS releases
9fa5f4
- reenable building documentation on ppc64
9fa5f4
- explicitly list more build requirements and/or versions to catch eventual
9fa5f4
  problems during future builds
9fa5f4
9fa5f4
* Tue Jan 13 2009 Deji Akingunola <dakingun@gmail.com> - 0.0.22-1
9fa5f4
- Update to version 0.0.22
9fa5f4
9fa5f4
* Tue Oct 07 2008 Deji Akingunola <dakingun@gmail.com> - 0.0.20-1
9fa5f4
- Update to latest release
9fa5f4
9fa5f4
* Thu Jul 10 2008 Deji Akingunola <dakingun@gmail.com> - 0.0.18-1
9fa5f4
- Update to latest release
9fa5f4
9fa5f4
* Thu Feb 28 2008 Deji Akingunola <dakingun@gmail.com> - 0.0.16-1
9fa5f4
- New release
9fa5f4
9fa5f4
* Thu Jan 17 2008 Deji Akingunola <dakingun@gmail.com> - 0.0.15-1.svn20080117
9fa5f4
- Update to a svn snapshot for gnome-scan
9fa5f4
- Apply patch to fix extensions loading on 64bit systems
9fa5f4
- Building the docs on ppc64 segfaults, avoid it for now.
9fa5f4
9fa5f4
* Sat Dec 08 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.14-1
9fa5f4
- Update to 0.0.14 release
9fa5f4
- License change from GPLv2+ to GPLv3+
9fa5f4
9fa5f4
* Thu Oct 25 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.7.20071011svn
9fa5f4
- Include missing requires for the devel subpackage
9fa5f4
9fa5f4
* Thu Oct 25 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.6.20071011svn
9fa5f4
- BR graphiz instead of graphiz-devel
9fa5f4
- Remove the spurious exec flag from a couple of source codes
9fa5f4
9fa5f4
* Tue Oct 23 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.5.20071011svn
9fa5f4
- Fix missing directory ownership
9fa5f4
9fa5f4
* Mon Oct 22 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.4.20071011svn
9fa5f4
- Update the License field 
9fa5f4
9fa5f4
* Fri Oct 12 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.3.20071011svn
9fa5f4
- Package the extension libraries in the main package
9fa5f4
- Run 'make check'
9fa5f4
9fa5f4
* Fri Oct 12 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.2.20071011svn
9fa5f4
- Remove the use of inexistent source
9fa5f4
9fa5f4
* Thu Oct 11 2007 Deji Akingunola <dakingun@gmail.com> - 0.0.13-0.1.20071011svn
9fa5f4
- Initial packaging for Fedora