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.

80 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.1.8
  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:=2df448435fa169b1611e619496ec529baa4caa59627a8a508fb6db59c31e42be
  15. LIVE555_VERSION:=2019.08.28
  16. LIVE555_HASH:=a3dcd157865186cf883c3a80b4bb09637e91fff96b234b2c780a7f7dcc7a35dc
  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 += -DALSA=OFF -DLIVE555CFLAGS="$(TARGET_CFLAGS) -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"
  47. define Build/Prepare
  48. $(Build/Prepare/Default)
  49. # download live555
  50. $(eval $(call Download,live555))
  51. mkdir -p $(PKG_BUILD_DIR)/live
  52. $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live
  53. endef
  54. define Package/v4l2rtspserver/install
  55. $(INSTALL_DIR) $(1)/usr/bin
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver $(1)/usr/bin/
  57. $(INSTALL_DIR) $(1)/etc/init.d
  58. $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
  59. $(INSTALL_DIR) $(1)/etc/config
  60. $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
  61. endef
  62. $(eval $(call BuildPackage,v4l2rtspserver))