libgphoto2/libgphoto2.spec
2008-04-18 06:10:29 +00:00

149 lines
4.1 KiB
RPMSpec

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 "<!-- This file was generated" > $RPM_BUILD_ROOT/%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
popd
for i in AUTHORS COPYING; do
mv ${i} ${i}.old
iconv -f cp1250 -t utf-8 < ${i}.old > ${i}
touch -r ${i}.old ${i}
rm -f ${i}.old
done
rm -rf %{buildroot}%{_libdir}/libgphoto2/*/*a
rm -rf %{buildroot}%{_libdir}/libgphoto2_port/*/*a
rm -rf %{buildroot}%{_libdir}/*.a
rm -rf %{buildroot}%{_libdir}/*.la
%find_lang %{name}-2
%find_lang %{name}_port-0
cat libgphoto2*.lang >> %{name}.lang
%clean
rm -rf "${RPM_BUILD_ROOT}"
%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS COPYING README NEWS
%dir %{_libdir}/libgphoto2_port
%dir %{_libdir}/libgphoto2_port/*
%dir %{_libdir}/libgphoto2
%dir %{_libdir}/libgphoto2/*
%{_libdir}/libgphoto2_port/*/*.so
%{_libdir}/libgphoto2/*/*.so
%{_libdir}/*.so.*
%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
%{_libdir}/udev/check-ptp-camera
%{_libdir}/udev/check-mtp-device
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{_datadir}/libgphoto2
%{_bindir}/gphoto2-config*
%{_bindir}/gphoto2-port-config
%{_includedir}/gphoto2
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_mandir}/man3/*
%changelog
* Mon Apr 14 2008 Jindrich Novy <jnovy@redhat.com> 2.4.0-0.2
- review fixes, thanks to Hans de Goede: (#437285)
- remove unused macro
- don't exclude s390/s390x
- preserve timestamps
- fix license
* Thu Mar 13 2008 Jindrich Novy <jnovy@redhat.com> 2.4.0-0.1
- initial libgphoto2 packaging