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.

82 lines
2.2 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_NAME:=v4l2rtspserver
  8. PKG_VERSION:=0.2.1
  9. PKG_RELEASE:=1
  10. #cannot use codeload as this uses submodules
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver
  13. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  14. PKG_MIRROR_HASH:=ddc4217ee12e57a4c248b6667309559323458028dc0fa085942b91dbbcd74146
  15. LIVE555_VERSION:=2020.11.29
  16. LIVE555_HASH:=0300f1f0b92529909623d3e870edeadff9841bbc9097a481a8583c5b9a6cc3ae
  17. LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
  18. PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
  19. PKG_LICENSE:=Unlicense
  20. PKG_LICENSE_FILES:=LICENSE
  21. PKG_BUILD_PARALLEL:=1
  22. CMAKE_INSTALL:=1
  23. include $(INCLUDE_DIR)/uclibc++.mk
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/cmake.mk
  26. define Package/v4l2rtspserver
  27. SECTION:=multimedia
  28. CATEGORY:=Multimedia
  29. TITLE:=v4l2rtspserver
  30. DEPENDS:=$(CXX_DEPENDS)
  31. URL:=https://github.com/mpromonet/v4l2rtspserver
  32. endef
  33. define Package/v4l2rtspserver/description
  34. RTSP server for v4L2 video sources
  35. endef
  36. define Package/v4l2rtspserver/conffiles
  37. /etc/config/v4l2rtspserver
  38. endef
  39. define Download/live555
  40. URL:=https://download.videolan.org/pub/contrib/live555/
  41. FILE:=$(LIVE555_FILE)
  42. HASH:=$(LIVE555_HASH)
  43. endef
  44. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  45. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  46. CMAKE_OPTIONS += \
  47. -DALSA=OFF \
  48. -DLIVE555CFLAGS=" -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED -DNO_SSTREAM=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1 -DNO_OPENSSL"
  49. define Build/Prepare
  50. $(Build/Prepare/Default)
  51. # download live555
  52. $(eval $(call Download,live555))
  53. mkdir -p $(PKG_BUILD_DIR)/live
  54. $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live
  55. endef
  56. define Package/v4l2rtspserver/install
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver $(1)/usr/bin/
  59. $(INSTALL_DIR) $(1)/etc/init.d
  60. $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
  61. $(INSTALL_DIR) $(1)/etc/config
  62. $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
  63. endef
  64. $(eval $(call BuildPackage,v4l2rtspserver))