diff --git a/configs/amlogic_xios-xbmc_defconfig b/configs/amlogic_xios-xbmc_defconfig index d50382ab41..da3e526d80 100644 --- a/configs/amlogic_xios-xbmc_defconfig +++ b/configs/amlogic_xios-xbmc_defconfig @@ -27,6 +27,7 @@ BR2_PACKAGE_DOSFSTOOLS_DOSFSCK=y BR2_PACKAGE_DOSFSTOOLS_DOSFSLABEL=y BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_E2FSPROGS_UTILS=y +BR2_PACKAGE_GPHOTOFS=y BR2_PACKAGE_MTD=y BR2_PACKAGE_NTFS_3G=y BR2_PACKAGE_NTFSPROGS=n diff --git a/configs/amlogic_xios_m3-xbmc_defconfig b/configs/amlogic_xios_m3-xbmc_defconfig index 769cfd0538..0a92949e7d 100644 --- a/configs/amlogic_xios_m3-xbmc_defconfig +++ b/configs/amlogic_xios_m3-xbmc_defconfig @@ -27,6 +27,7 @@ BR2_PACKAGE_DOSFSTOOLS_DOSFSCK=y BR2_PACKAGE_DOSFSTOOLS_DOSFSLABEL=y BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_E2FSPROGS_UTILS=y +BR2_PACKAGE_GPHOTOFS=y BR2_PACKAGE_MTD=y BR2_PACKAGE_NTFS_3G=y BR2_PACKAGE_NTFSPROGS=n diff --git a/package/thirdparty/Config.in b/package/thirdparty/Config.in index b6eaf3bbe1..8754a9eba4 100644 --- a/package/thirdparty/Config.in +++ b/package/thirdparty/Config.in @@ -28,5 +28,7 @@ source "package/thirdparty/xbmc/Config.in" source "package/thirdparty/xbmcpvr/Config.in" source "package/thirdparty/xios-skin/Config.in" source "package/thirdparty/boblight/Config.in" +source "package/thirdparty/gphotofs/Config.in" +source "package/thirdparty/libgphoto2/Config.in" endmenu diff --git a/package/thirdparty/gphotofs/40-gphoto.rules b/package/thirdparty/gphotofs/40-gphoto.rules new file mode 100644 index 0000000000..f0406afb2b --- /dev/null +++ b/package/thirdparty/gphotofs/40-gphoto.rules @@ -0,0 +1,2 @@ +ENV{INTERFACE}=="6/1/1", ACTION=="add", SUBSYSTEM=="usb", RUN+="/bin/sh /usr/bin/mountptp.sh" +ENV{INTERFACE}=="6/1/1", ACTION=="remove", SUBSYSTEM=="usb", RUN+="/bin/sh /usr/bin/umountptp.sh" diff --git a/package/thirdparty/gphotofs/Config.in b/package/thirdparty/gphotofs/Config.in new file mode 100644 index 0000000000..a37b9ac303 --- /dev/null +++ b/package/thirdparty/gphotofs/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_GPHOTOFS + bool "gphotofs" + select BR2_PACKAGE_LIBUSB-COMPAT + select BR2_PACKAGE_LIBGPHOTO2 + select BR2_PACKAGE_FUSE + help + gphotofs + + http://www.gphoto.org diff --git a/package/thirdparty/gphotofs/gphotofs.mk b/package/thirdparty/gphotofs/gphotofs.mk new file mode 100644 index 0000000000..9d5fae36e6 --- /dev/null +++ b/package/thirdparty/gphotofs/gphotofs.mk @@ -0,0 +1,24 @@ +############################################################# +# +# GPHOTOFS +# +############################################################# + +GPHOTOFS_VERSION = 0.5 +GPHOTOFS_SOURCE = gphotofs-$(GPHOTOFS_VERSION).tar.gz +GPHOTOFS_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/gphoto/gphotofs +GPHOTOFS_INSTALL_STAGING = YES +GPHOTOFS_INSTALL_TARGET = YES +GPHOTOFS_DEPENDENCIES = host-libgphoto2 libusb-compat libfuse libgphoto2 udev +GPHOTOFS_CONF_ENV += LDFLAGS+="-lgphoto2" + +define GPHOTOFS_INSTALL_UDEV + $(HOST_DIR)/usr/lib/libgphoto2/print-camera-list udev-rules version 175 mode 0660 > $(TARGET_DIR)/etc/udev/rules.d/40-gphoto.rules + cat package/thirdparty/gphotofs/40-gphoto.rules >> $(TARGET_DIR)/etc/udev/rules.d/40-gphoto.rules + $(INSTALL) -m 0755 package/thirdparty/gphotofs/mountptp.sh $(TARGET_DIR)/usr/bin/mountptp.sh + $(INSTALL) -m 0755 package/thirdparty/gphotofs/umountptp.sh $(TARGET_DIR)/usr/bin/umountptp.sh +endef + +GPHOTOFS_POST_INSTALL_TARGET_HOOKS += GPHOTOFS_INSTALL_UDEV + +$(eval $(call AUTOTARGETS,package/thirdparty,gphotofs)) diff --git a/package/thirdparty/gphotofs/mountptp.sh b/package/thirdparty/gphotofs/mountptp.sh new file mode 100644 index 0000000000..97198dd5b1 --- /dev/null +++ b/package/thirdparty/gphotofs/mountptp.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#Make Directory if it doesn't exist +if [ ! -d /media/camera ]; then + /bin/mkdir /media/camera +fi +# If something already mounted, dismount it +if grep -qs '/media/camera ' /proc/mounts; then + /bin/umount /media/camera +fi +# Mount the camera +/usr/bin/gphotofs /media/camera diff --git a/package/thirdparty/gphotofs/umountptp.sh b/package/thirdparty/gphotofs/umountptp.sh new file mode 100644 index 0000000000..97fdadb9bf --- /dev/null +++ b/package/thirdparty/gphotofs/umountptp.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# If its still mounted, then dismount it +if grep -qs '/media/camera ' /proc/mounts; then + umount /media/camera +fi diff --git a/package/thirdparty/libgphoto2/Config.in b/package/thirdparty/libgphoto2/Config.in new file mode 100644 index 0000000000..aec609966e --- /dev/null +++ b/package/thirdparty/libgphoto2/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBGPHOTO2 + bool "libgphoto2" + select BR2_PACKAGE_LIBUSB-COMPAT + help + libgphoto2 + + http://www.gphoto.org diff --git a/package/thirdparty/libgphoto2/libgphoto2.mk b/package/thirdparty/libgphoto2/libgphoto2.mk new file mode 100644 index 0000000000..cfc705a89a --- /dev/null +++ b/package/thirdparty/libgphoto2/libgphoto2.mk @@ -0,0 +1,17 @@ +############################################################# +# +# LIBGPHOTO2 +# +############################################################# + +LIBGPHOTO2_VERSION = 2.5.0 +LIBGPHOTO2_SOURCE = libgphoto2-$(LIBGPHOTO2_VERSION).tar.gz +LIBGPHOTO2_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/gphoto/libgphoto +LIBGPHOTO2_INSTALL_STAGING = YES +LIBGPHOTO2_INSTALL_TARGET = YES +LIBGPHOTO2_CONF_OPT = --enable-static --enable-shared +LIBGPHOTO2_DEPENDENCIES = host-pkg-config libusb-compat libtool +HOST_LIBGPHOTO2_CONF_OPT = --enable-shared --enable-static --without-libusb-1.0 --without-libusb + +$(eval $(call AUTOTARGETS,package/thirdparty,libgphoto2)) +$(eval $(call AUTOTARGETS,package/thirdparty,libgphoto2,host))