Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > f1c08a58b440f65ab81fd68676e4d7cf > files > 4

camdump-1.01-0.12mdk.src.rpm

# Version of installed Perl, Mandrake 9.1: 5.8.0, Mandrake 9.2: 5.8.1
%define perlversion %(rpm -q --qf '%%{version}' perl)

%define perlfullver %(rpm -q --qf '%%{epoch}:%%{version}' perl)

Summary: 	Download all new pictures using GPhoto2
Name: 		camdump
Version:	1.01
Release:	%mkrel 0.12
License: 	GPL
Group: 		Graphics
Source0: 	%{name}-%{version}.tar.bz2
Source1:	digicam-launch-icon.png.bz2
Patch0:		camdump-1.01-enhancements.patch.bz2
Patch1:		camdump-1.01-perlfix.patch.bz2
URL: 		http://gphoto2.sf.net/
Requires: 	libgphoto2 >= 2.1.0-1mdk, perl-GTK2, perl = %{perlfullver}
BuildRequires:  libgphoto-devel, swig-devel >= 1.3.19, 
BuildRequires:  perl-devel = %{perlfullver} ImageMagick
BuildRoot: 	%{_tmppath}/%{name}-buildroot
ExclusiveArch:  %{ix86}

%description
"camdump" is a simple frontend for the gphoto2 libraries. It takes a
single command-line argument: the directory into which it should copy
downloaded pictures. It then queries the first recognized camera and
downloads any files from the camera which do not already exist in the
target directory.


%prep
rm -rf ${RPM_BUILD_DIR}/%{name}-%{version}

%setup -n %{name}-%{version}
%patch0 -p1
%patch1 -p0
bzcat %{SOURCE1} > icon.png

%define perlplatform `ls -d /usr/lib/perl*/*/*/CORE | tail -1 | perl -p -e 's!%{_libdir}/perl\\d+/\\d+\\.\\d+\\.\\d+/([^/]+)/CORE!$1!'`

# Fix for non-i386-compatible platforms
perl -p -i -e "s!i386-linux!%{perlplatform}!" Makefile

# Fix build with new perl:
perl -p -i -e "s!5\.8\.0!%{perlversion}!; s!-linux-thread-multi!-linux!" Makefile

%build

%make

# convert icons to required format
convert icon.png -resize 32x32 camdump.png
convert icon.png -resize 16x16 camdump_mini.png
convert icon.png -resize 48x48 camdump_large.png


%install

perl -p -i -e "s!__BLDRT__!$RPM_BUILD_ROOT!" Makefile

%makeinstall

# icons
install -d $RPM_BUILD_ROOT%{_datadir}/icons
install -m 644 camdump.png $RPM_BUILD_ROOT%{_datadir}/icons/
install -d $RPM_BUILD_ROOT%{_datadir}/icons/mini
install -m 644 camdump_mini.png $RPM_BUILD_ROOT%{_datadir}/icons/mini/camdump.png
install -d $RPM_BUILD_ROOT%{_datadir}/icons/large
install -m 644 camdump_large.png $RPM_BUILD_ROOT%{_datadir}/icons/large/camdump.png

install -d %{buildroot}%{_sysconfdir}/dynamic/hooks
cp camdump.hook %{buildroot}%{_sysconfdir}/dynamic/hooks

# menu stuff
install -d %{buildroot}%{_menudir}
cat <<EOF > %{buildroot}%{_menudir}/camdump
?package(camdump):command="/usr/bin/camdump" \
title="Camdump (GPhoto 2)" \
longtitle="Automatically load photos from digital camera" \
needs="x11" \
section="Multimedia/Graphics" \
icon="camdump.png"
EOF

install -d %{buildroot}%{_sysconfdir}
cat <<EOF > %{buildroot}%{_sysconfdir}/camdump
CAMDUMP=/var/spool/camdump
EOF

install -d %{buildroot}/var/spool/camdump

%post
%update_menus

%postun
%clean_menus

%clean
rm -fr %buildroot

%files
%defattr(-,root,root,-)
%doc README TODO COPYING
%_bindir/*
%_menudir/*
%_libdir/perl5/vendor_perl/%{perlversion}/*/gphoto2_perl.pm
%_libdir/perl5/vendor_perl/%{perlversion}/*/auto/gphoto2_perl/libgphoto2_perl.so
%_datadir/icons/*
%config(noreplace) %_sysconfdir/dynamic/hooks/camdump.hook
%config(noreplace) %_sysconfdir/camdump
%attr(1777,root,root) /var/spool/camdump

%changelog
* Tue Jan 24 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1.01-0.12mdk
- Rebuild for new perl

* Thu Jan 19 2006 Till Kamppeter <till@mandriva.com> 1.01-0.11mdk
- Does not work on 64-bit -> Added "ExclusiveArch: %%{ix_86}".
- Introduced %%mkrel.

* Thu Jun 02 2005 Nicolas Lécureuil <neoclust@mandriva.org> 1.01-0.10mdk
- Rebuild

* Wed Feb 09 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.01-0.9mdk
- fix build for new perl

* Thu Jul 08 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 1.01-0.8mdk
- Rebuild for new perl

* Tue Apr 06 2004 Michael Scherer <misc@mandrake.org> 1.01-0.7mdk 
- rebuild for new perl
- autodetect perl at build time

* Tue Mar 02 2004 Pascal Terjan <pterjan@mandrake.org> 1.01-0.6mdk
- Fix perl errors

* Sun Feb 29 2004 Pascal Terjan <pterjan@mandrake.org> 1.01-0.5mdk
- Add epoch in perl require 

* Thu Sep 11 2003 Till Kamppeter <till@mandrakesoft.com> 1.01-0.4mdk
- Correct size of mini icon to 16x16.

* Wed Sep 10 2003 Till Kamppeter <till@mandrakesoft.com> 1.01-0.3mdk
- New icon (Thanks to Fabian Mandelbaum).

* Wed Aug 20 2003 Till Kamppeter <till@mandrakesoft.com> 1.01-0.2mdk
- Prevent several instances of camdump running in parallel
- Moved system-wide config to /etc/camdump
- Support for personal config in ~/.camdump
- Moved default image directory to /var/spool/camdump
- Do not consider an argument beginning with "-" as a destination directory
- More user-friendly "Usage: ..." message
- Moved reading of config files to camdump, so that it can be called without
  arguments from the menu.
- Taken care that in camdump the target directory is always used with
  absolute path, so that camdump works reliably independent of the
  working directory out of which it is called.
- "Gtk2->exit(0)" causes error message, use "Gtk2::exit(0)" instead
- Tell in all windows where the loaded photos were dropped
- Security fix: Do not create error log file by default
- Made menu entry working the same way as camdump triggered by hotplug

* Wed Aug 20 2003 Aaron Peromsik <aaron@peromsik.net> 1.01-0.1mdk
- 1.01 for new swig
- moved to perl-GTK2

* Tue Aug 19 2003 Till Kamppeter <till@mandrakesoft.com> 1.0-0.3mdk
- Macro for Perl version number (currently 5.8.1).
- Made more use of macros.
- Made menu entry Mandrake-conformimg.
- Moved image dunping directory to /var/spool/camdump-images.
- Included /var/spool/camdump-images in package.
- Replaced "pointer.i" by "cpointer.i" in gphoto.i to eliminate SWIG
  warning.

* Sun Jun 15 2003 Aaron Peromsik <aaron@peromsik.net> 1.0-0.2mdk
- update for Mandrake 9.1

* Sun Dec 22 2002 Aaron Peromsik <aaron@peromsik.net> 1.0-0.1mdk
- Created using libgphoto2, swig, and an oatmeal paste.