You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.4 KiB

  1. #
  2. # Copyright (C) 2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. PKG_SOURCE_PROTO:=git
  8. PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver.git
  9. PKG_SOURCE_VERSION:=d7e8dd4d35a802219222642a2e3b28f2dc5069c1
  10. PKG_DATE:=2017-12-20
  11. PKG_NAME:=v4l2rtspserver
  12. PKG_VERSION:=$(PKG_DATE)-$(PKG_SOURCE_VERSION)
  13. PKG_RELEASE:=1
  14. PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
  15. LIVE555_VERSION:=2017.10.28
  16. LIVE555_MD5SUM:=a5acd14c4fa7b50f7270304d3b4a70ae
  17. LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/v4l2rtspserver
  22. SECTION:=multimedia
  23. CATEGORY:=Multimedia
  24. TITLE:=v4l2rtspserver
  25. DEPENDS:=+libstdcpp
  26. URL:=https://github.com/mpromonet/v4l2rtspserver
  27. endef
  28. define Package/v4l2rtspserver/description
  29. RTSP server for v4L2 video sources
  30. endef
  31. define Package/v4l2rtspserver/conffiles
  32. /etc/config/v4l2rtspserver
  33. endef
  34. define Download/live555
  35. URL:=https://download.videolan.org/pub/contrib/live555/
  36. FILE:=$(LIVE555_FILE)
  37. MD5SUM:=$(LIVE555_MD5SUM)
  38. endef
  39. define Build/Prepare
  40. $(Build/Prepare/Default)
  41. ## need to compile some dependencies so that cmake will find them
  42. # build live555
  43. $(eval $(call Download,live555))
  44. mkdir -p $(PKG_BUILD_DIR)/live555
  45. $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live555
  46. $(CP) files/config.openwrt $(PKG_BUILD_DIR)/live555
  47. ( cd $(PKG_BUILD_DIR)/live555; ./genMakefiles openwrt )
  48. $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/live555
  49. $(MAKE) -C $(PKG_BUILD_DIR)/live555 PREFIX="$(STAGING_DIR)/usr/" install
  50. # build v4l2wrapper
  51. $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/v4l2wrapper CFLAGS="$(TARGET_CFLAGS) -I $(PKG_BUILD_DIR)/v4l2wrapper/inc"
  52. $(CP) $(PKG_BUILD_DIR)/v4l2wrapper/libv4l2wrapper.a $(PKG_BUILD_DIR)
  53. # patch cmake file
  54. $(SED) 's/DEBUG/RELEASE/' $(PKG_BUILD_DIR)/CMakeLists.txt
  55. endef
  56. define Package/v4l2rtspserver/install
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/
  59. mv $(1)/usr/bin/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/v4l2rtspserver
  60. $(INSTALL_DIR) $(1)/etc/init.d
  61. $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
  62. $(INSTALL_DIR) $(1)/etc/config
  63. $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
  64. endef
  65. $(eval $(call BuildPackage,v4l2rtspserver))