libgphoto2.spec
author dcarbery
Mon, 23 Oct 2006 12:46:17 +0000
branchgnome-2-14
changeset 19195 352a4716f1f3
parent 7256 39cb28ba817d
child 7693 d3e498cd50f6
permissions -rw-r--r--
2006-10-23 Damien Carbery <[email protected]> * docs/ssa/*: Remove these, as they're now up on the JDS project pages under 'Tasks/Single Sys Admin'.

#
# spec file for package libgphoto2
#
# Copyright (c) 2005 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
Name:         libgphoto2
License:      LGPL
Group:        Library/Hardware/Other
Version:      2.1.99
Release:      40
Distribution: Java Desktop System
Vendor:       Sun Microsystems, Inc.
Summary:      Digital camera library
Source:       http://easynews.dl.sourceforge.net/sourceforge/gphoto/%{name}-%{version}.tar.gz
Source1:      usermap.gphoto
Source2:      usbcam
Patch1:       libgphoto2-01-gettext.diff
Patch2:       libgphoto2-02-uninstalled-pc.diff
Patch3:       libgphoto2-03-solaris-mntent.diff
Patch4:       libgphoto2-04-pragma-pack.diff
URL:          http://www.gphoto.org
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
DocDir:       %{_defaultdocdir}/libgphoto2
Autoreqprov:  on
Prereq:       /sbin/ldconfig

Requires:     hotplug

%description
gPhoto (GNU Photo) is a set of libraries for previewing, retrieving, and capturing images from a range of supported digital camerason to your local harddrive.

(It does not support digital cameras based on the USB storage protocol,
those can be mounted by Linux directly.)

As of this time gPhoto supports around 200 cameras, listed on:

 http://www.gphoto.org/cameras.html

or by running

 gphoto2 --list-cameras

%prep
%setup -q
%ifos solaris
%patch1 -p1
%endif
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
%ifos linux
if [ -x /usr/bin/getconf ]; then
  CPUS=`getconf _NPROCESSORS_ONLN`
fi
%else
  CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
%endif
if test "x$CPUS" = "x" -o $CPUS = 0; then
  CPUS=1
fi

%ifos solaris
glib-gettextize -f
%endif
#%{?suse_update_config:%{suse_update_config -f . libgphoto2_port}}
libtoolize --copy --force
aclocal $ACLOCAL_FLAGS -I libgphoto2_port/m4
automake -a -f
autoconf
cd libgphoto2_port
%ifos solaris
glib-gettextize -f
%endif
libtoolize --copy --force
aclocal $ACLOCAL_FLAGS -I ./m4
automake -a -f
autoconf
cd ..
# Removing sierra driver on Solaris since it doesn't compile.
%ifos solaris
%define driver_options "--with-drivers=agfa-cl20,aox,barbie,canon,casio,digita,dimera,directory,fuji,gsmart300,jamcam,jd11,kodak,konica,mustek,largan,minolta,panasonic,pccam300,pccam600,polaroid,ptp2,ricoh,samsung,smal,sipix,sonydscf1,sonydscf55,soundvision,spca50x,sq905,stv0680,sx330z"
%define libusb_option "--with-libusb=/usr/sfw"
export LIBUSB_LIBS="-L/usr/sfw/lib -R/usr/sfw/lib -lusb"
export LIBUSB_CFLAGS="-I/usr/sfw/include"
%else
%define driver_options "--with-drivers=all"
%define libusb_option ""
%endif

PATH="/usr/X11R6/bin:$PATH" CFLAGS="$RPM_OPT_FLAGS -fPIC" ./configure	\
  --prefix=%{_prefix} 	\
  --mandir=%{_mandir} 	\
  --bindir=%{_bindir} 	\
  --libdir=%{_libdir} 	\
  --includedir=%{_includedir} \
  --with-doc-dir=%{_defaultdocdir}/%{name} \
  --disable-static %{libusb_option} %{driver_options}
make -j $CPUS INTLLIBS=

%install
export LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/hotplug/usb/
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/hotplug/usb/usbcam.usermap
install -c -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/hotplug/usb/usbcam

rm -f $RPM_BUILD_ROOT%{_libdir}/libgphoto2/*/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libgphoto2_port/*/*.la

#Clean up unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%defattr(-,root,root)
%{_includedir}/gphoto2
%dir %{_defaultdocdir}/%{name}
%{_defaultdocdir}/%{name}/*
%{_datadir}/libgphoto2
%{_bindir}/gphoto2-config
%{_bindir}/gphoto2-port-config
%{_libdir}/libgphoto2.*so*
%{_libdir}/libgphoto2/*/*.so
%{_libdir}/libgphoto2_port.*
%{_libdir}/libgphoto2_port/*/*.so
%{_libdir}/libgphoto2/print-usb-usermap
%{_libdir}/pkgconfig/libgphoto2.pc
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_mandir}/man3/
%{_sysconfdir}/hotplug/usb/*

%changelog -n libgphoto2
* Thu May 11 2006 - [email protected]
- add patch pragma-pack.diff
* Thu Mar  9 2006 - [email protected]
- Add patch, 03-solaris-mntent, to port mntent code to Solaris.
* Wed Jan 25 2006 - [email protected]
- Set LIBUSB_LIBS and LIBUSB_CFLAGS which makes the libgphoto2_port configure
  happier.  For some reason just calling with --with-libusb isn't enough.  The
  build still fails when compiling libgphoto2_port/disk.c because Solaris does
  not have mntent.h, but this gets the build farther along.  
* Tue Jan 03 2006 - [email protected]
- Bump to 2.1.99.
* Mon Aug 15 2005 - [email protected]
- Bump to 2.1.6.
* Wed Feb 09 2005 - [email protected]
- Version updated to 2.1.5
- Patches 2 and 4 are not longer needed:
  libgphoto2-02-fix-konica.diff, libgphoto2-04-pc.diff
- Renamed path 5 as patch 2: libgphoto2-05-g11n-potfiles.diff ->
  libgphoto2-02-g11n-potfiles.diff
* Fri Nov 12 2004 - [email protected]
- added --bindir=%{_bindir} so it can be redirected on Solaris
* Wed Sep 15 2004 - [email protected]
- Added libgphoto2-05-g11n-potfiles.diff
* Thu Jul 08 2004 - [email protected]
- Updated l10n content to libgphoto2-l10n-po-1.2.tar.bz2
* Thu Jul 08 2004 - [email protected]
- ported to rpm4
* Wed Jul 07 2004 - [email protected]
- added "-j $CPUS" to make to speed up builds
* Fri May 28 2004 - [email protected]
- Added patch 04, so that gtkam can build on Solaris.
* Wed May 12 2004 - [email protected]
- Updated l10n content to libgphoto2-l10n-po-1.1.tar.bz2
* Thu Apr 15 2004 - [email protected]
- Only apply patch01 on Solaris since it is causing problems for
  Linux.
* Wed Apr 14 2004 - [email protected]
- Add glib-gettextize -f when running configure in the
  libgphoto2_port directory. 
* Thu Apr 08 2004 - [email protected]
- Avoid building sierra driver on Solaris, since it doesn't
  build with Forte.  Add needed 02 patch.
* Wed Mar 31 2004 - [email protected]
- replace tar jxf with the more solaris friendly
  bzcat piped through tar
* Mon Mar 29 2004 - [email protected]
- Updated l10n content to libgphoto2-l10n-po-1.0.tar.bz2
* Wed Feb 04 2004 - <[email protected]>
- New Tarball 2.1.4, added l10n tarball
- Remove patch: libgphoto2-01-potfiles-in.diff
* Tue Oct 14 2003 - <[email protected]>
- New Tarball 2.1.2 for QS
* Thu Aug 14 2003 - <[email protected]>
- remove *.a, *.la
* Wed Jul 23 2003 - [email protected]
- Fixing POTFILES.in
* Wed Jul 16 2003 - [email protected]
- Initial Spec File