Skip to content

Instantly share code, notes, and snippets.

@madagaga
Last active November 7, 2018 15:31
Show Gist options
  • Save madagaga/36831c73b3d806f8f645d5645404b49b to your computer and use it in GitHub Desktop.
Save madagaga/36831c73b3d806f8f645d5645404b49b to your computer and use it in GitHub Desktop.
openWRT motion package with ffmpeg
#
# Copyright (C) 2008-2015 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.2
PKG_RELEASE:=1
PKG_MAINTAINER:=Roger D <[email protected]>
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Motion-Project/motion.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/motion/Default
SECTION:=multimedia
CATEGORY:=Multimedia
DEPENDS:=+libjpeg +libpthread +libmicrohttpd
URL:=https://motion-project.github.io/
endef
define Package/motion
$(call Package/motion/Default)
TITLE:=webcam motion sensing and logging
VARIANT:=normal
endef
define Package/motion-ffmpeg
$(call Package/motion/Default)
TITLE:=(+ffmpeg)
DEPENDS+=+libffmpeg-full
VARIANT:=ffmpeg
endef
define Package/motion/conffiles
/etc/motion.conf
endef
CONFIGURE_ARGS+= \
--without-optimizecpu \
--without-jpeg-mmx \
--without-sdl \
--without-mysql \
--without-pgsql \
--without-sqlite3
ifeq ($(BUILD_VARIANT),normal)
CONFIGURE_ARGS+=--without-ffmpeg
endif
ifeq ($(BUILD_VARIANT),ffmpeg)
CONFIGURE_ARGS+=--with-ffmpeg=$(STAGING_DIR)/usr
endif
define Package/motion/install
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
endef
define Package/motion-ffmpeg/install
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
endef
$(eval $(call BuildPackage,motion))
$(eval $(call BuildPackage,motion-ffmpeg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment