ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/multimedia/motion/Makefile b/external/subpack/multimedia/motion/Makefile
new file mode 100644
index 0000000..f865d75
--- /dev/null
+++ b/external/subpack/multimedia/motion/Makefile
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2008-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=motion
+PKG_VERSION:=4.3.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-release-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/Motion-Project/motion/tar.gz/release-$(PKG_VERSION)?
+PKG_HASH:=dafa4264b2d8e4778f8be5871f09b6c0ec710d5a836182c583469c18db944d70
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:lavrsen:motion
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/motion
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+libjpeg +libpthread +libmicrohttpd $(INTL_DEPENDS)
+  TITLE:=webcam motion sensing and logging
+  URL:=https://motion-project.github.io/
+endef
+
+define Package/motion/conffiles
+/etc/config/motion
+/etc/motion.conf
+endef
+
+CONFIGURE_ARGS += \
+	--without-bktr \
+	--without-webp \
+	--without-mmal \
+	--without-ffmpeg \
+	--without-mariadb \
+	--without-mysql \
+	--without-pgsql \
+	--without-sqlite3 \
+	--without-optimizecpu
+
+define Package/motion/install
+	$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
+	$(INSTALL_CONF) ./files/motion.conf $(1)/etc/config/motion
+	$(INSTALL_BIN) ./files/motion.init $(1)/etc/init.d/motion
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/motion/motion-dist.conf $(1)/etc/motion.conf
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/motion $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,motion))
diff --git a/external/subpack/multimedia/motion/files/motion.conf b/external/subpack/multimedia/motion/files/motion.conf
new file mode 100644
index 0000000..3155b5e
--- /dev/null
+++ b/external/subpack/multimedia/motion/files/motion.conf
@@ -0,0 +1,2 @@
+config motion general
+	option enabled '0'
diff --git a/external/subpack/multimedia/motion/files/motion.init b/external/subpack/multimedia/motion/files/motion.init
new file mode 100644
index 0000000..2aae920
--- /dev/null
+++ b/external/subpack/multimedia/motion/files/motion.init
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+
+START=94
+USE_PROCD=1
+
+PROG="/usr/bin/motion"
+CONF="/etc/motion.conf"
+
+start_service() {
+	local enabled
+
+	config_load "motion"
+	config_get_bool enabled "general" "enabled" 0
+	[ "$enabled" -gt 0 ] || return 1
+
+	procd_open_instance
+
+	procd_set_param command "$PROG"
+	procd_append_param command -c "$CONF"
+
+	procd_close_instance
+}
diff --git a/external/subpack/multimedia/motion/patches/010-no-po-man.patch b/external/subpack/multimedia/motion/patches/010-no-po-man.patch
new file mode 100644
index 0000000..05b8dc4
--- /dev/null
+++ b/external/subpack/multimedia/motion/patches/010-no-po-man.patch
@@ -0,0 +1,21 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = src po man
++SUBDIRS = src
+ 
+ sysconfdir = @sysconfdir@/$(PACKAGE)
+ sysconf_DATA = \
+--- a/configure.ac
++++ b/configure.ac
+@@ -472,8 +472,6 @@ AC_SUBST(AM_LDFLAGS, "$TEMP_LDFLAGS")
+ AC_CONFIG_FILES([
+ 	Makefile
+ 	src/Makefile
+-  po/Makefile.in
+-  man/Makefile
+   data/camera1-dist.conf
+   data/camera2-dist.conf
+   data/camera3-dist.conf