libgphoto2.spec
author dermotm
Mon, 18 Oct 2004 09:30:38 +0000
changeset 4276 2a2c7f354601
parent 4133 ac0c5fbef3de
child 4409 4fec71e58697
permissions -rw-r--r--
Incremented release numbers for build 21

Name:         libgphoto2
License:      LGPL
Group:        Library/Hardware/Other
Version:      2.1.4
Release:      25
Distribution: Cinnabar
Vendor:       Sun Microsystems, Inc.
Summary:      Digital camera library
Source:       libgphoto2-%{version}.tar.bz2
Source1:      usermap.gphoto
Source2:      usbcam
Source3:      libgphoto2-l10n-po-1.2.tar.bz2
Patch1:       libgphoto2-01-gettext.diff
Patch2:       libgphoto2-02-fix-konica.diff
Patch3:       libgphoto2-03-uninstalled-pc.diff
Patch4:       libgphoto2-04-pc.diff
Patch5:       libgphoto2-05-g11n-potfiles.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
/usr/bin/bzcat -dc %SOURCE3|tar xf -
%ifos solaris
%patch1 -p1
%endif
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -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 %{_datadir}/aclocal/gnome2-macros -I libgphoto2_port/m4
automake -a -f
autoconf
cd libgphoto2_port
%ifos solaris
glib-gettextize -f
%endif
libtoolize --copy --force
aclocal $ACLOCAL_FLAGS -I %{_datadir}/aclocal/gnome2-macros -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} 	\
  --libdir=%{_libdir} 	\
  --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 mandir=$RPM_BUILD_ROOT%{_mandir} 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
# FIXME: **** WEIRD *****
rm -Rf $RPM_BUILD_ROOT$RPM_BUILD_ROOT%{_mandir}/man3

%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.*
#FIXME - should this not have a .so extension?
%{_libdir}/libgphoto2/print-usb-usermap
%{_libdir}/pkgconfig/libgphoto2.pc
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_sysconfdir}/hotplug/usb/*

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