Blob Blame History Raw
Summary: Software for accessing digital cameras
Name: gphoto2
%define pkg gphoto2
%define pkgver 2.1.99
%define libpkg libgphoto2
%define libver 2.1.99
Version: %{pkgver}
Release: 4
License: LGPL
Group: Applications/Multimedia
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Source0: http://prdownloads.sourceforge.net/gphoto/%{pkg}-%{pkgver}.tar.bz2
Source1: http://prdownloads.sourceforge.net/gphoto/%{libpkg}-%{libver}.tar.bz2
#Source2: gen-libgphoto-hal-fdi
Source3: 90-gphoto-camera-policy.fdi
Source4: gphoto-set-procperm
Patch2: gphoto2-gcc4.patch
Patch3: gphoto2-2.1.99-dbus.patch
Patch4: gphoto2-2.1.99-canon_segv.patch
Url: http://www.gphoto.org/
ExcludeArch: s390 s390x
PreReq: /sbin/ldconfig, grep, fileutils
Provides: libgphoto2
Requires: lockdev
BuildRequires: libusb-devel >= 0.1.5
BuildRequires: gtk-doc
BuildRequires: findutils perl
BuildRequires: transfig
BuildRequires: lockdev-devel
BuildRequires: libexif-devel
BuildRequires: libjpeg-devel, readline-devel
BuildRequires: libtool, pkgconfig, sharutils

####################################
%description
The gPhoto2 project is a universal, free application and library
framework that lets you download images from several different
digital camera models, including the newer models with USB
connections. Note that
a) for some older camera models you must use the old "gphoto" package.
b) for USB mass storage models you must use the driver in the kernel

This package contains
i) the library that digital camera applications can use
ii) the command-line utility gphoto2 

Other (GUI) frontends are available separately.

####################################
%package devel
Summary: Headers and links to compile against the libgphoto2 library.
Requires: %{name} = %{version}
Requires: pkgconfig
Requires: libexif-devel
Group: Development/Libraries

####################################
%description devel
The gPhoto2 project is a universal, free application and library
framework that lets you download images from several different
digital camera models, including the newer models with USB
connections. Note that for some older camera models you must use
the old "gphoto" package.

This package contains the files needed to compile applications that
use libgphoto2.

########################################################################
# Building and installing the beast into %{buildroot}
########################################################################

####################################
%prep
%setup -q -a 1
%patch2 -p1 -b .gcc4
%patch3 -p1 -b .dbus
%patch4 -p1 -b .segv

####################################
%build
pushd %{libpkg}-%{libver}
export CFLAGS=$RPM_OPT_FLAGS
%configure \
	--mandir=%{_mandir} \
	--libdir=%{_libdir} \
	--with-drivers=all \
	--enable-docs \
	--with-doc-dir=%{_docdir}/%{name} \
	--disable-static
export tagname=CC
make
ln -s . libgphoto2/gphoto2
ln -s . libgphoto2_port/libgphoto2_port/gphoto2
popd

gp_path=../libgphoto2_port/libgphoto2_port
cat $(pwd)/libgphoto2-%{libver}/libgphoto2/libgphoto2.pc | sed \
  -e "s,^libdir=.*$,libdir=$(pwd)/libgphoto2-%{libver}/libgphoto2," \
  -e "s,^includedir=.*$,includedir=$(pwd)/libgphoto2-%{libver}/libgphoto2," \
  -e "s,^Libs:.*},Libs: -L\${libdir}/.libs -L\${libdir}/$gp_path/.libs/," \
  -e "s,^Cflags:.*$,Cflags: -I\${includedir}/$gp_path -I\${includedir}," \
  > libgphoto2.pc
export PKG_CONFIG_PATH=.
%configure \
	--mandir=%{_mandir} \
	--libdir=%{_libdir} \
	--enable-docs \
	--with-doc-dir=%{_docdir}/%{name} 

export tagname=CC
make

####################################
%install
rm -rf "${RPM_BUILD_ROOT}"

pushd %{libpkg}-%{libver}

export tagname=CC
make mandir=%{_mandir} DESTDIR=$RPM_BUILD_ROOT install

install -d -m755 %{buildroot}/usr/share/hal/fdi/information/20thirdparty/

#LIBDIR=%{buildroot}%{_libdir} %{SOURCE2} > %{buildroot}/usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
export LIBDIR=$RPM_BUILD_ROOT/%{_libdir} 
export CAMLIBS=$RPM_BUILD_ROOT/%{_libdir}/%{libpkg}/%{libver}
$RPM_BUILD_ROOT/%{_libdir}/%{libpkg}/print-usb-usermap --fdi > $RPM_BUILD_ROOT/%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
popd

install -d -m755 %{buildroot}/usr/share/hal/fdi/policy/20thirdparty/
install -m755 %{SOURCE3} %{buildroot}/usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi

export tagname=CC
make mandir=%{_mandir} DESTDIR=$RPM_BUILD_ROOT install

install -d -m755 $RPM_BUILD_ROOT%{_libexecdir}/

install -m755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/gphoto-set-procperm

mv -f %{buildroot}%{_docdir}/%{name} installed-doc
mv -f %{buildroot}/%{name} installed-doc
mv -f %{buildroot}/%{name}-port installed-doc
mv -f %{buildroot}/canon installed-doc
find installed-doc -name '*.sgml' | xargs -r rm

rm -rf %{buildroot}%{_libdir}/libgphoto2/*/*a
rm -rf %{buildroot}%{_libdir}/libgphoto2_port/*/*a
rm -rf %{buildroot}%{_libdir}/*.a

eval `grep ^LIBGPHOTO2_CURRENT %{libpkg}-%{libver}/configure.in`
eval `grep ^LIBGPHOTO2_PORT_CURRENT %{libpkg}-%{libver}/libgphoto2_port/configure.in`
%find_lang %{name}
%find_lang %{libpkg}-$LIBGPHOTO2_CURRENT
%find_lang %{libpkg}_port-$LIBGPHOTO2_PORT_CURRENT
cat libgphoto2*.lang >> %{name}.lang



####################################
%clean
rm -rf "${RPM_BUILD_ROOT}"

########################################################################
# file list and installation for main package
########################################################################

####################################
%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS README COPYING
%{_bindir}/gphoto2
%{_datadir}/libgphoto2
%dir %{_libdir}/libgphoto2_port
%dir %{_libdir}/libgphoto2_port/*
%{_libdir}/libgphoto2_port/*/*.so
%dir %{_libdir}/libgphoto2
%dir %{_libdir}/libgphoto2/*
%{_libdir}/libgphoto2/*/*.so
%{_libdir}/*.so.*
%{_mandir}/man1/gphoto2.1*
%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
%{_datadir}/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi
%{_libexecdir}/gphoto-set-procperm

####################################
%post
# register libraries
/sbin/ldconfig

####################################
%postun
# unregister libraries
/sbin/ldconfig

########################################################################
# file list and installation for -devel subpackage
########################################################################

####################################
%files devel
%defattr(-,root,root)
%doc installed-doc
%{_bindir}/gphoto2-config
%{_bindir}/gphoto2-port-config
%{_includedir}/gphoto2
%{_libdir}/*.la
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_mandir}/man3/*

########################################################################
# ChangeLog
########################################################################
%changelog
* Mon Jan 23 2006 Radek Vokal <rvokal@redhat.com> 2.1.99-4
- fixed gphoto2 --summary segfault with Canon cameras (#178572)

* Fri Jan 13 2006 Radek Vokal <rvokal@redhat.com> 2.1.99-3
- export LIBDIR before creating .fdi file

* Fri Jan 13 2006 Radek Vokal <rvokal@redhat.com> 2.1.99-2
- spec file clean-up
- use ./print-usb-map 
- docs are back in -devel package

* Thu Jan 05 2006 Radek Vokal <rvokal@redhat.com> 2.1.99-1
- upgrade to 2.1.99 + dbus patch

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com> 2.1.6-7.1
- rebuilt

* Sun Nov 13 2005 John (J5) Palmieri <johnp@redhat.com> 2.1.6-7
- Add callout to cameras with ptp access methods

* Fri Nov 11 2005 John (J5) Palmieri <johnp@redhat.com> 2.1.6-6
- Fix typo in fdi file to point to the correct script
- Install the fdi file to the policy directory instead of information

* Fri Nov 11 2005 John (J5) Palmieri <johnp@redhat.com> 2.1.6-5
- Fix to not install scripts as directories

* Fri Nov 11 2005 John (J5) Palmieri <johnp@redhat.com> 2.1.6-4
- Add gphoto-set-procperm and 90-gphoto-camera-policy.fdi to
  have HAL set permissions on the usb cameras
- Remove hotplug support since we don't use it anymore (udev takes care
  of devices and HAL takes care of permissions)

* Mon Nov 07 2005 Radek Vokal <rvokal@redhat.com> 2.1.6-3
- become self-hosting, don't depend on installed libs (#106442,#172519)

* Wed Jul 27 2005 Tim Waugh <twaugh@redhat.com> 2.1.6-2
- Rebuilt.

* Thu Jun 23 2005 Tim Waugh <twaugh@redhat.com> 2.1.6-1
- 2.1.6.

* Wed Jun  1 2005 Bill Nottingham <notting@redhat.com> 2.1.5-10
- fix multilib conflict on fdi files, and their generation on x86_64
  in general

* Sat May 14 2005 Tim Waugh <twaugh@redhat.com> 2.1.5-9
- Fixed buffer overrun in ricoh/g3 (bug #157739).

* Mon May  2 2005 David Zeuthen <davidz@redhat.com> 2.1.5-8
- Build and install hal device information files

* Tue Mar 29 2005 Tim Waugh <twaugh@redhat.com>
- Re-enable docs.

* Mon Mar 28 2005 Matthias Clasen <mclasen@redhat.com> 2.1.5-7
- Rebuild against newer libexif

* Thu Mar 24 2005 Warren Togami <wtogami@redhat.com>
- BR libtool, pkgconfig

* Thu Mar 24 2005 Tim Waugh <twaugh@redhat.com>
- Disable docs again until gtk-doc is fixed (GNOME bug #169087).

* Thu Mar 24 2005 Michael Schwendt <mschwendt[AT]users.sf.net> 2.1.5-6
- Avoid creation of bad rpaths by removing libtool hacks from spec.

* Thu Mar 24 2005 Tim Waugh <twaugh@redhat.com>
- Disable docs again until gtk-doc is fixed (GNOME bug #169087).

* Mon Mar 21 2005 Tim Waugh <twaugh@redhat.com>
- Fixed memset() usage bug.

* Fri Mar 11 2005 Tim Waugh <twaugh@redhat.com>
- Re-enable docs.

* Fri Mar 11 2005 Tim Waugh <twaugh@redhat.com> 2.1.5-5
- Rebuild with GCC 4 fixes.
- Disable docs again until gtk-doc is fixed (GNOME bug #169087).

* Fri Mar  4 2005 Tim Waugh <twaugh@redhat.com>
- Re-enable docs.

* Fri Mar  4 2005 Tim Waugh <twaugh@redhat.com> 2.1.5-4
- Disable docs until gtk-doc is fixed (GNOME bug #169087).
- Rebuilt for new GCC.

* Wed Jan 12 2005 Tim Waugh <twaugh@redhat.com> 2.1.5-3
- Rebuilt for new readline.

* Mon Jan 10 2005 Tim Waugh <twaugh@redhat.com> 2.1.5-2
- 2.1.5 (bug #143141).

* Fri Oct  8 2004 Tim Waugh <twaugh@redhat.com> 2.1.4-7
- devel sub-package requires libexif-devel (bug #135058).

* Tue Aug 31 2004 Tim Waugh <twaugh@redhat.com> 2.1.4-6
- Fixed mis-applied patch (bug #130755).

* Thu Aug 26 2004 Tim Waugh <twaugh@redhat.com> 2.1.4-5
- Apply patch from David Zeuthen to fix hotplug script (bug #130755).

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Mon Apr 19 2004 Tim Waugh <twaugh@redhat.com> 2.1.4-3
- BuildRequires libjpeg-devel, readline-devel (bug #121238).

* Wed Mar 10 2004 Tim Waugh <twaugh@redhat.com>
- Apply Jeff Law's cast-as-lvalue patch.

* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Thu Jan 29 2004 Tim Waugh <twaugh@redhat.com> 2.1.4-1
- 2.1.4.

* Tue Dec 23 2003 Tim Waugh <twaugh@redhat.com> 2.1.3-3
- Build with libexif support.

* Thu Dec  4 2003 Tim Waugh <twaugh@redhat.com> 2.1.3-2
- Rebuilt.

* Wed Dec  3 2003 Tim Waugh <twaugh@redhat.com> 2.1.3-1
- 2.1.3.

* Tue Sep 16 2003 Tim Waugh <twaugh@redhat.com> 2.1.2-1
- 2.1.2.

* Wed Aug  6 2003 Elliot Lee <sopwith@redhat.com> 2.1.1-4
- Fix libtool

* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Thu Mar 20 2003 Tim Waugh <twaugh@redhat.com> 2.1.1-2
- Ship print-usb-usermap, fix post scriptlet.

* Thu Mar 20 2003 Tim Waugh <twaugh@redhat.com> 2.1.1-1
- Use installed libtool.
- 2.1.1.

* Sat Feb 01 2003 Florian La Roche <Florian.LaRoche@redhat.de>
- only package man3 in devel rpm

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Sun Dec 01 2002 Florian La Roche <Florian.LaRoche@redhat.de>
- remove some old mainframe ifdefs

* Tue Nov 19 2002 Tim Waugh <twaugh@redhat.com> 2.1.0-5
- Fix file lists.
- Don't install files not shipped.
- Rebuild in new environment.

* Wed Jul 24 2002 Tim Waugh <twaugh@redhat.com> 2.1.0-4
- Rebuild, just in case (readline).

* Thu Jul 18 2002 Tim Waugh <twaugh@redhat.com> 2.1.0-3
- Own some more directories.

* Fri Jun 28 2002 Tim Waugh <twaugh@redhat.com> 2.1.0-2
- Don't use -rpath (bug #65983).

* Tue Jun 25 2002 Tim Waugh <twaugh@redhat.com> 2.1.0-1
- 2.1.0.
- No longer need cvsfixes or consolelock patches.

* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.0-9
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com> 2.0-8
- automated rebuild

* Thu May  9 2002 Tim Waugh <twaugh@redhat.com> 2.0-7
- Require lockdev (bug #64193).

* Mon Apr 29 2002 Tim Waugh <twaugh@redhat.com> 2.0-6
- In fact, don't even build for mainframe.

* Mon Apr 29 2002 Florian La Roche <Florian.LaRoche@redhat.de> 2.0-5
- do not require hotplug for mainframe

* Mon Apr 15 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0-4
- Set the owner of the device to the console lock holder, not the owner
  of /dev/console, in the hotplug agent, fixing access for users who log
  in at VTs and use startx (#62976).

* Fri Apr 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-3
- Rebuild (fixed bug #63355).

* Wed Feb 27 2002 Tim Waugh <twaugh@redhat.com> 2.0-2
- Fix from CVS: close port unconditionally in gp_camera_exit().

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-1
- 2.0 is released.
- Ship the .so symlinks in the devel package.

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc4.1
- 2.0rc4.

* Fri Feb 22 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc3.1
- 2.0rc3.  No longer need CVS patch.
- Build no longer requires xmlto.

* Thu Feb 21 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.2
- Fix DC240 hangs (patch from CVS).
- Rebuild in new environment.

* Tue Feb 19 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.1
- 2.0rc2 (bug #59993).  No longer need docs patch or man page.
- Really fix up libtool libraries (bug #60002).

* Fri Feb 15 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.2
- PreReq /sbin/ldconfig, grep, and fileutils (bug #59941).

* Tue Feb 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.1
- 2.0beta5.
- Fix Makefiles so that documentation can be built.
- Ship pkgconfig file.
- Add man page.

* Thu Feb  7 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta4.1
- 2.0beta4.
- Build requires transfig, and at least version 0.1.5 of libusb.
- Clean up file lists.
- Build documentation.

* Fri Jan 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.2
- Rebuild in new environment.
- Dump docbook-dtd30-sgml requirement; gtk-doc is sufficient.

* Sun Nov 18 2001 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.1
- Adapted for Red Hat Linux.

* Sat Oct 27 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- fixed update behaviour for hotplug list (do not erase it when updating)

* Thu Oct 25 2001 Tim Waugh <twaugh@redhat.com>
- hotplug dependency is a prereq not a requires (the package scripts
  need it).

* Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- integrated spec file into source package

* Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- 2.0beta3

* Tue Oct  2 2001 Tim Waugh <twaugh@redhat.com> 2.0beta2-0.1
- Adapted for Red Hat Linux.
- 2.0beta2.

* Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.2mdk
- Corrected "Requires:"

* Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.1mdk
- Initial release