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.

81 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:=2
  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)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. define Package/v4l2rtspserver
  26. SECTION:=multimedia
  27. CATEGORY:=Multimedia
  28. TITLE:=v4l2rtspserver
  29. DEPENDS:=+libstdcpp
  30. URL:=https://github.com/mpromonet/v4l2rtspserver
  31. endef
  32. define Package/v4l2rtspserver/description
  33. RTSP server for v4L2 video sources
  34. endef
  35. define Package/v4l2rtspserver/conffiles
  36. /etc/config/v4l2rtspserver
  37. endef
  38. define Download/live555
  39. URL:=https://download.videolan.org/pub/contrib/live555/
  40. FILE:=$(LIVE555_FILE)
  41. HASH:=$(LIVE555_HASH)
  42. endef
  43. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  44. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  45. CMAKE_OPTIONS += \
  46. -DALSA=OFF \
  47. -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"
  48. define Build/Prepare
  49. $(Build/Prepare/Default)
  50. # download live555
  51. $(eval $(call Download,live555))
  52. mkdir -p $(PKG_BUILD_DIR)/live
  53. $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live
  54. endef
  55. define Package/v4l2rtspserver/install
  56. $(INSTALL_DIR) $(1)/usr/bin
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver $(1)/usr/bin/
  58. $(INSTALL_DIR) $(1)/etc/init.d
  59. $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
  60. $(INSTALL_DIR) $(1)/etc/config
  61. $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
  62. endef
  63. $(eval $(call BuildPackage,v4l2rtspserver))