File dng4ps2.spec of Package dng4ps2

Name: dng4ps2
Version: 0.2.2
Release: 0
License: GNU GPL v2
Group:	Productivity/Graphics/Convertors
URL: http://code.google.com/p/dng4ps2/	
Summary: Convert Canon PowerShot raw files (CHDK) into DNG

BuildRequires: gcc-c++ libstdc++-devel libXMP-devel libdng-devel boost-devel dos2unix
%if 0%{?mandriva_version} > 0
BuildRequires: libwxgtk2.8-devel
%else
%if 0%{?suse_version} >= 1140
BuildRequires: wxWidgets-devel
%else
BuildRequires: wxGTK-devel
%endif
%endif
%if 0%{?suse_version} == 1010
BuildRequires: libexif
%else
BuildRequires: libexif-devel 
%endif
%if 0%{?fedora_version} >= 16
BuildRequires:	jasper-libs
%endif
Source: dng4ps2-r62.tar.bz2
Patch:  dng4ps2-compile.diff
Patch1: dng4ps2-Makefile.diff
Patch2: sd990.diff
Patch3:	filelist-debug.diff
Patch4:	oldwx.diff
Patch5:	large-exif.diff

AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Prefix: /usr

%description
DNG for PowerShot-2 (DNG4PS-2) is free software for conversion of Canon PowerShot cameras RAW files into Digital Negative (DNG) format. 

Supported cameras: A610, A620, A630, A640, A710 IS, S2 IS, S3 IS, A700, G7, A560, A570 IS, IXUS 700, IXUS 70, IXUS 800, A720 IS, S5 IS, IXUS 950, A650 IS, A460, SD800 IS, A530, A540. 

Features
Batch conversion RAW files into DNG (with DNG file lossless compression ability) 
Preview insertion 
Regulation folders by image date 
Import image exif data from JPEG file (date, time, ISO, focal length, etc) 
Artist name insertion into image data 
ISO calculation in AutoISO mode 
Can run from command line (only in beta) 
Translated in languages: english, norwegian, german, spanish, italian, chinese, finnish and russian

%prep
%setup -n dng4ps2-r62
%patch -p1
%patch1 -p1
%patch2 -p1
#%patch3 -p1
%if 0%{?suse_version} == 1010
%patch4 -p1
%endif
#%patch5 -p1
cat >dng4ps2.desktop << 'EOF'
[Desktop Entry]
X-SuSE-translate=false
Name=Canon PS Raw Converter dng4ps2
Categories=Graphics;Photography;
Exec=/usr/bin/dng4ps2
Icon=dng4ps2
Terminal=false
Type=Application
GenericName=Raw Image Converter
Comment=A utility to convert raw images from Canon compact cameras (CHDK) to DNG
Encoding=UTF-8
Version=1.0
MimeType=application/x-dcraw;
EOF

%build
cd src
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %{?jobs:-j%jobs}

%install
cd src
make install PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir}
install -d $RPM_BUILD_ROOT/%{_datadir}/applications
install -m 0644 ../dng4ps2.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/
install -d %{buildroot}/%{_datadir}/dng4ps2/langs
install -m 0644 langs/* %{buildroot}/%{_datadir}/dng4ps2/langs/
%if 0%{?suse_version} == 1010
install -d %{buildroot}/%{_datadir}/pixmaps
install -m 0644 images/dng4ps2.png %{buildroot}/%{_datadir}/pixmaps/
%else
install -d %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps
install -m 0644 images/dng4ps2.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/
%endif
dos2unix changes_en.txt readme_en.txt

%files
%defattr(-,root,root)
%{_prefix}/bin/dng4ps2
%{_datadir}/applications/dng4ps2.desktop
%dir %{_datadir}/dng4ps2
%{_datadir}/dng4ps2/langs/
%doc src/changes_en.txt src/readme_en.txt src/html/*
%if 0%{?suse_version} == 1010
%{_datadir}/pixmaps/dng4ps2.png
%else
%{_datadir}/icons/hicolor/32x32/apps/dng4ps2.png
%endif

%changelog
* Wed Mar 24 2009 - garloff@suse.de
- Canon IXUS 980 IS / PS SD990 support.
* Tue Mar 24 2009 - garloff@suse.de
- Inital package creation.