Name:           rawstudio 
Version:        2.0
Release:        8%{?_dist_release}
Summary:        Read, manipulate and convert digital camera raw images

Group:          Applications/Multimedia 
License:        GPLv2+
URL:            http://rawstudio.org

Source0:        http://rawstudio.org/files/release/%{name}-%{version}.tar.gz
# Packaging a snapshot created with 
# svn export -r 3521 https://rawstudio.org/svn/rawstudio/trunk/ rawstudio
#Source0:        rawstudio.tar.gz

Patch0:		rawstudio-2.0-makefile.patch
Patch1:		rawstudio-2.0-lensfun-0.3.x.patch
Patch2:		rawstudio-2.0-libpng-1.6.x.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  gtk2-devel, libxml2-devel, GConf2-devel, dbus-devel
BuildRequires:  lcms-devel, libjpeg-devel, libtiff-devel, exiv2-devel
BuildRequires:  flickcurl-devel, lensfun-devel, fftw3-devel, curl-devel
BuildRequires:  sqlite3-devel, openssl-devel, libgphoto2-devel
BuildRequires:  desktop-file-utils
BuildRequires:  intltool
BuildRequires:  libtool

Distribution: Vine Linux
Vendor: Project Vine
Packager: iwaim

%description
Rawstudio is a highly specialized application for processing RAW images
from digital cameras. It is not a fully featured image editing application.

The RAW format is often recommended to get the best quality out of digital 
camera images.  The format is specific to cameras and cannot be read by most 
image editing applications.

Rawstudio makes it possible to read and manipulate RAW images, experiment 
with the controls to see how they affect the image, and finally export into 
JPEG, PNG or TIF format images from most digital cameras.


%package -n librawstudio-devel
Summary: librawstudio development files
Requires: librawstudio = %{version}-%{release}
Group: Development/Libraries

%description -n librawstudio-devel
Development files for rawstudio backend library


%package -n librawstudio
Summary: Rawstudio backend library
Group: System Environment/Libraries

%description -n librawstudio
Rawstudio backend library


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1


%build
rm configure
NOCONFIGURE=1 ./autogen.sh
%configure --disable-static
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name}

# Remove useless files
find %{buildroot} -name '*.la' -delete

# Fix desktop file warning
# Note: the Encoding tag seems to be deprecated in desktop entry specs v1.0
#       so this has probably to go away in the future
echo "Encoding=UTF-8" >> ${RPM_BUILD_ROOT}%{_datadir}/applications/rawstudio.desktop

desktop-file-install --vendor vine                              \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
        --remove-category Application                           \
        --delete-original                                       \
        ${RPM_BUILD_ROOT}%{_datadir}/applications/rawstudio.desktop


%clean
rm -rf $RPM_BUILD_ROOT

%post
update-desktop-database &> /dev/null ||:

%postun
update-desktop-database &> /dev/null ||:


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README NEWS COPYING AUTHORS
%{_bindir}/rawstudio
%{_datadir}/rawstudio
%{_datadir}/rawspeed
%{_datadir}/pixmaps/rawstudio
%{_datadir}/applications/vine-rawstudio.desktop
%{_datadir}/icons/rawstudio.png

%files -n librawstudio
%{_libdir}/librawstudio-2.0.so.*

%files -n librawstudio-devel
%{_includedir}/rawstudio-2.0
%{_libdir}/librawstudio-2.0.so
%{_libdir}/pkgconfig/rawstudio-2.0.pc

%changelog
* Sun May 15 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-8
- rebuild with openssl-1.0.2

* Wed Nov 11 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-7
- rebuild with exiv2-0.25

* Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-6
- rebuild with ligphoto2-2.5.7
- add Patch1 (rawstudio-2.0-lensfun-0.3.x.patch)
- add Patch2 (rawstudio-2.0-libpng-1.6.x.patch)

* Wed Dec 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-5
- rebuild with exiv2-0.24

* Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> 2.0-4
- build with libgphoto2 2.5.0-1
- update BR: gphoto2-devel -> libgphoto2-devel
- fix vendor in desktop-update-install option: fedora -> vine

* Sun Jul 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-3
- rebuild with exiv2-0.23

* Mon May 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0-2
- rebuild with exiv2-0.22
- add Patch0 (rawstudio-2.0-makefile.patch)

* Sun Sep  4 2011 IWAI, Masaharu <iwai@alib.jp> 2.0-1
- build for Vine Linux: based Fedora 2.0-1

* Fri Apr  8 2011 Gianluca Sforna <giallu@gmail.com> - 2.0-1
- Update to final release
- remove upstreamed patch

* Sat Mar 26 2011 Gianluca Sforna <giallu@gmail.com> - 2.0-0.1.beta1
- Update to released beta
- Split librawstudio library in own package

* Mon Mar 14 2011 Gianluca Sforna <giallu@gmail.com> - 1.2-10
- update to newer snapshot, another fixed crash

* Mon Feb 21 2011 Gianluca Sforna <giallu@gmail.com> - 1.2-9
- update to newer snapshot, includes fixes for #635964 and #636919
- remove upstreamed patch, add new one to remove -Werror
- require gphoto2

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-8.20100907svn3521
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Jan 02 2011 Rex Dieter <rdieter@fedoraproject.org> - 1.2-7.20100907svn3521
- rebuild (exiv2)

* Wed Sep  8 2010 Gianluca Sforna <giallu gmail com>
- Fix BuildRequires
- Add updated patch for X11 link issue

* Tue Sep  7 2010 Gianluca Sforna <giallu gmail com>
- move to a snapshot
- drop upstreamed patches
- add find-lang
- remove .la files
- disable static library build

* Mon May 31 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.2-5 
- rebuild (exiv2)

* Sat Feb 13 2010 Gianluca Sforna <giallu gmail com> - 1.2-4
- Add explicit link to libX11 (#564638)

* Mon Jan 04 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.2-3 
- rebuild (exiv2)

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Apr 10 2009 Gianluca Sforna <giallu gmail com> - 1.2-1
- New upstream release

* Thu Feb 26 2009 Gianluca Sforna <giallu gmail com> - 1.1.1-4
- Fix build with newer glibc

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Dec 18 2008 Rex Dieter <rdieter@fedoraproject.org> - 1.1.1-2 
- respin (eviv2)

* Mon Oct 13 2008 Gianluca Sforna <giallu gmail com> - 1.1.1-1
- new upstream release

* Tue Sep 16 2008 Gianluca Sforna <giallu gmail com> - 1.1-1
- new upstream release

* Thu May  1 2008 Gianluca Sforna <giallu gmail com> - 1.0-1
- new upstream release
- drop upstreamed patch
- slightly improved summary

* Sun Feb 24 2008 Gianluca Sforna <giallu gmail com> - 0.7-2
- rebuild with gcc 4.3

* Thu Jan 24 2008 Gianluca Sforna <giallu gmail com> - 0.7-1
- New upstream release
- Improved package description
- Add fix for PPC build

* Sun Aug 19 2007 Gianluca Sforna <giallu gmail com> 0.6-1
- New upstream release
- Updated License field
- Include new pixmaps directory

* Wed Feb 21 2007 Gianluca Sforna <giallu gmail com> 0.5.1-1
- New upstream release
- Fix desktop-file-install warnings

* Tue Feb 06 2007 Gianluca Sforna <giallu gmail com> 0.5-1
- new upstream version
- add libtiff-devel BR
- drop upstreamed patch
- drop dcraw runtime Require

* Wed Sep 27 2006 Gianluca Sforna <giallu gmail com> 0.4.1-1
- new upstream version
- Add DESTDIR patch (and BR: automake)
- New .desktop file and icon

* Fri Jul 28 2006 Gianluca Sforna <giallu gmail com> 0.3-1
- Initial package. Adapted from fedora-rpmdevtools template.
