diff --git a/.cvsignore b/.cvsignore index e69de29..4b21a51 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +libgphoto2-2.4.0.tar.bz2 diff --git a/gphoto2-ixany.patch b/gphoto2-ixany.patch new file mode 100644 index 0000000..09d9d90 --- /dev/null +++ b/gphoto2-ixany.patch @@ -0,0 +1,14 @@ +diff -up gphoto2-2.4.0/libgphoto2-2.4.0/libgphoto2_port/serial/unix.c.ixany gphoto2-2.4.0/libgphoto2-2.4.0/libgphoto2_port/serial/unix.c +--- libgphoto2-2.4.0/libgphoto2_port/serial/unix.c.ixany 2007-07-27 02:36:13.000000000 +0200 ++++ libgphoto2-2.4.0/libgphoto2_port/serial/unix.c 2008-02-25 06:40:40.000000000 +0100 +@@ -98,6 +98,10 @@ + + #define CHECK(result) {int r=(result); if (r<0) return (r);} + ++#ifndef IXANY ++#define IXANY 0004000 ++#endif ++ + /* Linux */ + #ifdef __linux__ + /* devfs is accounted for in the implementation */ diff --git a/gphoto2-norpath.patch b/gphoto2-norpath.patch new file mode 100644 index 0000000..31e1108 --- /dev/null +++ b/gphoto2-norpath.patch @@ -0,0 +1,28 @@ +diff -up libgphoto2-2.4.0/libgphoto2_port/configure.norpath libgphoto2-2.4.0/libgphoto2_port/configure +--- libgphoto2-2.4.0/libgphoto2_port/configure.norpath 2007-07-28 17:02:04.000000000 +0200 ++++ libgphoto2-2.4.0/libgphoto2_port/configure 2008-03-13 09:55:36.000000000 +0100 +@@ -8149,8 +8149,8 @@ cc_basename=`$echo "X$cc_temp" | $Xsed - + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' ++ runpath_var= ++ hardcode_libdir_flag_spec= + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then +diff -up libgphoto2-2.4.0/configure.norpath libgphoto2-2.4.0/configure +--- libgphoto2-2.4.0/configure.norpath 2007-07-28 17:02:11.000000000 +0200 ++++ libgphoto2-2.4.0/configure 2008-03-13 09:51:54.000000000 +0100 +@@ -8579,8 +8579,8 @@ cc_basename=`$echo "X$cc_temp" | $Xsed - + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. +- runpath_var=LD_RUN_PATH +- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' ++ runpath_var= ++ hardcode_libdir_flag_spec= + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then diff --git a/gphoto2-pkgcfg.patch b/gphoto2-pkgcfg.patch new file mode 100644 index 0000000..acff8e0 --- /dev/null +++ b/gphoto2-pkgcfg.patch @@ -0,0 +1,74 @@ +--- libgphoto2-2.4.0/gphoto2-config.in.pkgcfg 2007-07-27 02:36:23.000000000 +0200 ++++ libgphoto2-2.4.0/gphoto2-config.in 2007-07-31 12:21:14.000000000 +0200 +@@ -1,11 +1,5 @@ + #! /bin/sh + +-# leave these definitions here +-# they are required for correct interpolation of +-# @libdir@ and @includedir@ later on +-prefix="@prefix@" +-exec_prefix="@exec_prefix@" +- + usage() + { + cat <\n"); + printf(" \n"); + printf(" \n"); ++ printf(" \n"); ++ printf(" \n"); + return 0; + } + +@@ -838,52 +840,52 @@ + return 0; + } + if (a->usb_vendor) { /* usb product id might be 0! */ +- printf(" \n", a->usb_vendor); +- printf(" \n", a->usb_product); ++ printf(" \n", a->usb_vendor); ++ printf(" \n", a->usb_product); + if (a->device_type & GP_DEVICE_AUDIO_PLAYER) { +- printf(" portable_audio_player\n"); +- printf(" portable_audio_player\n"); +- printf(" user\n"); +- printf(" mtp\n"); ++ printf(" portable_audio_player\n"); ++ printf(" portable_audio_player\n"); ++ printf(" user\n"); ++ printf(" mtp\n"); + + /* FIXME: needs true formats ... But all of them can do MP3 */ +- printf(" audio/mpeg\n"); ++ printf(" audio/mpeg\n"); + } else { +- printf(" camera\n"); +- printf(" camera\n"); ++ printf(" camera\n"); ++ printf(" camera\n"); + + /* HACK alert ... but the HAL / gnome-volume-manager guys want that */ + if (NULL!=strstr(a->library,"ptp")) +- printf(" ptp\n"); ++ printf(" ptp\n"); + else +- printf(" proprietary\n"); ++ printf(" proprietary\n"); + } + /* leave them here even for audio players */ +- printf(" %s\n", model); +- printf(" true\n"); ++ printf(" %s\n", model); ++ printf(" true\n"); ++ printf(" \n"); + printf(" \n"); +- printf(" \n"); + + } else if ((a->usb_class) && (a->usb_class != 666)) { +- printf(" \n", a->usb_class); +- printf(" \n", a->usb_subclass); +- printf(" \n", a->usb_protocol); +- printf(" camera\n"); +- printf(" camera\n"); ++ printf(" \n", a->usb_class); ++ printf(" \n", a->usb_subclass); ++ printf(" \n", a->usb_protocol); ++ printf(" camera\n"); ++ printf(" camera\n"); + if (a->usb_class == 6) { +- printf(" ptp\n"); ++ printf(" ptp\n"); + } else { + if (a->usb_class == 8) { +- printf(" storage\n"); ++ printf(" storage\n"); + } else { +- printf(" proprietary\n"); ++ printf(" proprietary\n"); + } + } +- printf(" %s\n", model); +- printf(" true\n"); ++ printf(" %s\n", model); ++ printf(" true\n"); ++ printf(" \n"); + printf(" \n"); + printf(" \n"); +- printf(" \n"); + } + } /* camera has USB connection */ + return 0; +@@ -892,6 +894,7 @@ + static int + fdi_end_func (const func_params_t *params, void *data) + { ++ printf(" \n"); + printf(" \n"); + printf(" \n"); + printf("\n"); +@@ -918,6 +921,8 @@ + printf("\n"); + printf(" \n"); + printf(" \n"); ++ printf(" \n"); ++ printf(" \n"); + return 0; + } + +@@ -961,28 +966,28 @@ + /* do not set category. We don't really know what this device really is. + * But we do now that is capable of being a camera, so add to capabilities + */ +- printf(" \n", a->usb_vendor); +- printf(" \n", a->usb_product); ++ printf(" \n", a->usb_vendor); ++ printf(" \n", a->usb_product); + if (params->add_comments) { + printf(" \n", a->model); + } + if (a->device_type & GP_DEVICE_AUDIO_PLAYER) +- printf(" portable_audio_player\n"); ++ printf(" portable_audio_player\n"); + else +- printf(" camera\n"); ++ printf(" camera\n"); ++ printf(" \n"); + printf(" \n"); +- printf(" \n"); + } + #if 0 + /* would need to be able to merge upwards ... but cannot currently */ + else if ((a->usb_class) && (a->usb_class != 666)) { +- printf(" \n", a->usb_class); +- printf(" \n", a->usb_subclass); +- printf(" \n", a->usb_protocol); +- printf(" camera\n"); ++ printf(" \n", a->usb_class); ++ printf(" \n", a->usb_subclass); ++ printf(" \n", a->usb_protocol); ++ printf(" camera\n"); ++ printf(" \n"); + printf(" \n"); + printf(" \n"); +- printf(" \n"); + } + #endif + } +@@ -992,6 +997,7 @@ + static int + fdi_device_end_func (const func_params_t *params, void *data) + { ++ printf(" \n"); + printf(" \n"); + printf(" \n"); + printf("\n"); diff --git a/libgphoto2.spec b/libgphoto2.spec new file mode 100644 index 0000000..3ff9799 --- /dev/null +++ b/libgphoto2.spec @@ -0,0 +1,148 @@ +Summary: Library for accessing digital cameras +Name: libgphoto2 +Version: 2.4.0 +Release: 0.2%{?dist} +# GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2 +License: GPLv2+ and GPLv2 +Group: Development/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: http://downloads.sourceforge.net/gphoto/libgphoto2-%{version}.tar.bz2 +Patch1: gphoto2-pkgcfg.patch +Patch2: gphoto2-storage.patch +Patch3: gphoto2-ixany.patch +Patch4: gphoto2-norpath.patch +Url: http://www.gphoto.org/ +Requires: lockdev +BuildRequires: libusb-devel >= 0.1.5 +BuildRequires: lockdev-devel +BuildRequires: libexif-devel +BuildRequires: libjpeg-devel +BuildRequires: libtool, pkgconfig, sharutils +BuildRequires: libtool-ltdl-devel, popt-devel + +%description +libgphoto2 is a library that can be used by applications to access +various digital cameras. libgphoto2 itself is not a GUI application, +opposed to gphoto. There are GUI frontends for the gphoto2 library, +however, such as gtkam for example. + +%package devel +Summary: Headers and links to compile against the libgphoto2 library +Group: Development/Libraries +Requires: %{name} = %{version} +Requires: pkgconfig + +%description devel +libgphoto2 is a library that can be used by applications to access +various digital cameras. libgphoto2 itself is not a GUI application, +opposed to gphoto. There are GUI frontends for the gphoto2 library, +however, such as gtkam for example. + +This package contains files needed to compile applications that +use libgphoto2. + +%prep +%setup -q +%patch1 -p1 -b .pkgcfg +%patch2 -p1 -b .storage +%patch3 -p1 -b .ixany +%patch4 -p1 -b .norpath + +cat > gphoto2.pc.in << EOF +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +VERSION=@VERSION@ + +Name: gphoto2 +Description: Library for easy access to digital cameras +Requires: +Version: @VERSION@ +Libs: -L\${libdir} -lgphoto2 -lgphoto2_port -lm +Cflags: -I\${includedir} -I\${includedir}/gphoto2 +EOF +sed 's/Name: gphoto2/Name: gphoto2-port/' < gphoto2.pc.in > gphoto2-port.pc.in + +%build +export CFLAGS=$RPM_OPT_FLAGS +%configure \ + --with-drivers=all \ + --with-doc-dir=%{_docdir}/%{name} \ + --disable-static \ + --disable-rpath \ + --without-aalib +make %{?_smp_mflags} + +%install +rm -rf "${RPM_BUILD_ROOT}" + +make mandir=%{_mandir} DESTDIR=$RPM_BUILD_ROOT install + +pushd packaging/linux-hotplug/ +install -d -m755 %{buildroot}/usr/share/hal/fdi/information/20thirdparty/ +export LIBDIR=$RPM_BUILD_ROOT%{_libdir} +export CAMLIBS=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} +export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} +$RPM_BUILD_ROOT%{_libdir}/%{name}/print-camera-list hal-fdi | \ +grep -v "