Blob Blame History Raw
Summary: Software for accessing digital cameras
Name: gphoto2
%define pkg gphoto2
%define pkgver 2.1.4
%define libpkg libgphoto2
%define libver 2.1.4
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
Patch0: libgphoto2-lvalue.patch
Url: http://www.gphoto.org/
ExcludeArch: s390 s390x
# For /etc/hotplug/usb..
PreReq: hotplug >= 2001_04_24-13
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

####################################
%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
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
pushd %{libpkg}-%{libver}
%patch0 -p1 -b .lvalue
popd

####################################
%build
pushd %{libpkg}-%{libver}
%configure --disable-rpath --enable-docs \
	--with-doc-dir=%{buildroot}%{_docdir}/%{name}
export tagname=CC
make LIBTOOL=/usr/bin/libtool
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 --enable-docs --with-doc-dir=%{buildroot}%{_docdir}/%{name}
export tagname=CC
make LIBTOOL=/usr/bin/libtool

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

pushd %{libpkg}-%{libver}

# Convince gphoto2 to be packaged.
perl -p -i -e "s|^libdir.*|libdir='$RPM_BUILD_ROOT%{_libdir}'|g" \
	libgphoto2_port/libgphoto2_port/libgphoto2_port.la

export tagname=CC
%makeinstall LIBTOOL=/usr/bin/libtool

install -d -m755 %{buildroot}/etc/hotplug/usb/
install -m755 packaging/linux-hotplug/usbcam.console %{buildroot}/etc/hotplug/usb/usbcam

popd

export tagname=CC
%makeinstall LIBTOOL=/usr/bin/libtool

# Fix up libtool libraries.
find $RPM_BUILD_ROOT -name '*.la' | \
  xargs perl -p -i -e "s|$RPM_BUILD_ROOT||g"

cp -a %{buildroot}%{_docdir}/%{name} installed-doc
find installed-doc -name '*.sgml' | xargs -r rm
rm -rf %{buildroot}%{_docdir}/%{name}
rm -rf %{buildroot}%{_libdir}/gphoto2/*/*a
rm -rf %{buildroot}%{_libdir}/gphoto2_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
/etc/hotplug/usb/usbcam
%{_datadir}/libgphoto2
%dir %{_libdir}/gphoto2_port
%dir %{_libdir}/gphoto2_port/*
%{_libdir}/gphoto2_port/*/*.so
%dir %{_libdir}/gphoto2
%dir %{_libdir}/gphoto2/*
%{_libdir}/gphoto2/*/*.so
%{_libdir}/*.so.*
%{_libdir}/libgphoto2
%{_mandir}/man1/gphoto2.1*


####################################
%post
# add supported cameras to /etc/hotplug/usb.usermap
grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.tmp
%{_libdir}/libgphoto2/print-usb-usermap >> /etc/hotplug/usb.usermap.tmp
mv /etc/hotplug/usb.usermap.tmp /etc/hotplug/usb.usermap
# register libraries
/sbin/ldconfig

####################################
%postun
# unregister libraries
/sbin/ldconfig
if [ "$1" = 0 ]; then
    # remove supported cameras from /etc/hotplug/usb.usermap
    grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.new
    mv /etc/hotplug/usb.usermap.new /etc/hotplug/usb.usermap
fi

########################################################################
# 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
* 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