--- libgphoto2-2.1.99.ebuild 2006-06-20 17:37:36.913817750 +0900 +++ libgphoto2-2.2.0.ebuild 2006-06-20 17:40:17.847875500 +0900 @@ -11,16 +11,17 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="nls doc exif nousb" +IUSE="nls doc exif usb hal" # needs >usbutils-0.11-r2 to avoid /usr/lib/libusb* # conflicts with dev-libs/libusb -RDEPEND="!nousb? ( +RDEPEND="usb? ( >=dev-libs/libusb-0.1.8 >=sys-apps/usbutils-0.11-r2 - kernel_linux? ( sys-apps/hotplug ) + kernel_linux? ( sys-apps/hotplug ) ) exif? ( >=media-libs/libexif-0.5.9 )" +# hal? ( >=sys-apps/hal-O.5 )" DEPEND="${RDEPEND} dev-util/pkgconfig doc? ( dev-util/gtk-doc )" @@ -81,11 +82,11 @@ ${myconf} || die "econf failed" # or the documentation fails. - emake -j1 || die "make failed" + emake || die "make failed" } src_install() { - if use !nousb && use kernel_linux; then + if use usb && use kernel_linux; then make DESTDIR=${D} \ gphotodocdir=/usr/share/doc/${PF} \ HTML_DIR=/usr/share/doc/${PF}/sgml \ @@ -110,7 +111,7 @@ dodoc ChangeLog NEWS* README AUTHORS TESTERS MAINTAINERS HACKING CHANGES # install hotplug support - if use !nousb && use kernel_linux; then + if use usb && use kernel_linux; then insinto /etc/hotplug/usb newins ${S}/packaging/linux-hotplug/usbcam.group usbcam chmod +x ${D}/etc/hotplug/usb/usbcam @@ -118,19 +119,28 @@ } pkg_postinst() { - if use !nousb && use kernel_linux; then - einfo "Generating usbcam-gphoto2.usermap .." + if [[ -x ${ROOT}/usr/$(get_libdir)/libgphoto2/print-camera-list ]]; then HOTPLUG_USERMAP="/etc/hotplug/usb/usbcam-gphoto2.usermap" - if [[ -x ${ROOT}/usr/$(get_libdir)/libgphoto2/print-usb-usermap ]]; then + HAL_FDI="/usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2.fdi" + + if use usb && use kernel_linux; then + einfo "Generating usbcam-gphoto2.usermap ..." echo "# !!! DO NOT EDIT THIS FILE !!! This file is automatically generated." > ${ROOT}/${HOTPLUG_USERMAP} echo "# Put your custom entries in /etc/hotplug/usb/usbcam.usermap" >> ${ROOT}/${HOTPLUG_USERMAP} - ${ROOT}/usr/$(get_libdir)/libgphoto2/print-usb-usermap >> ${ROOT}/${HOTPLUG_USERMAP} - else - eerror "Unable to find ${ROOT}/usr/$(get_libdir)/libgphoto2/print-usb-usermap" - eerror "and therefore unable to generate hotplug usermap." - eerror "You will have to manually generate it by running:" - eerror " /usr/$(get_libdir)/libgphoto2/print-usb-usermap > ${HOTPLUG_USERMAP}" + ${ROOT}/usr/$(get_libdir)/libgphoto2/print-camera-list usb-user-map >> ${ROOT}/${HOTPLUG_USERMAP} + fi + + if use hal; then + einfo "Generating HAL FDI files ..." + ${ROOT}/usr/$(get_libdir)/libgphoto2/print-camera-list hal-fdi >> ${ROOT}/${HAL_FDI} + fi + else + eerror "Unable to find ${ROOT}/usr/$(get_libdir)/libgphoto2/print-camera-list" + eerror "and therefore unable to generate hotplug usermap or HAL FDI files." + eerror "You will have to manually generate it by running:" + eerror " /usr/$(get_libdir)/libgphoto2/print-camera-list usb-usermap > ${HOTPLUG_USERMAP}" + eerror " /usr/$(get_libdir)/libgphoto2/print-camera-list hal-fdi > ${HAL_FDI}" fi einfo "Don't forget to add yourself to the plugdev group "