libgphoto2.spec
author dermotm
Mon, 24 Jul 2006 12:30:39 +0000
branchgnome-2-10
changeset 19949 94f49bf19351
parent 19881 6180c371ed87
permissions -rw-r--r--
access control test #4

#
# 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.5
Release:      40
Distribution: Java Desktop System
Vendor:       Sun Microsystems, Inc.
Summary:      Digital camera library
Source:       http://umn.dl.sourceforge.net/gphoto/libgphoto2-%{version}.tar.gz
Source1:      usermap.gphoto
Source2:      usbcam
Patch1:       libgphoto2-01-gettext.diff
Patch2:       libgphoto2-02-uninstalled-pc.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

%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"
%else
%define driver_options ""
%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} \
  --with-drivers=all 	\
  --disable-static  %{driver_options}
make -j $CPUS

%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

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

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

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

%changelog -n libgphoto2
* 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