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.

286 lines
8.2 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=mjpg-streamer
  7. PKG_VERSION:=1.0.0
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://codeload.github.com/jacksonliam/mjpg-streamer/tar.gz/v$(PKG_VERSION)?
  11. PKG_HASH:=31850cd533b0290640cbdf4da44f7a774bfba050647cb0a0c84a435e90b08598
  12. PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>, \
  13. Ted Hess <thess@kitschensync.net>
  14. PKG_LICENSE:=GPL-2.0-or-later
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip=2 -xf $(DL_DIR)/$(PKG_SOURCE)
  17. PKG_BUILD_DEPENDS:=MJPG_STREAMER_V4L2:libv4l zmq protobuf-c/host
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/mjpg-streamer
  21. SECTION:=multimedia
  22. CATEGORY:=Multimedia
  23. TITLE:=MJPG-streamer
  24. DEPENDS:=+libpthread +libjpeg +MJPG_STREAMER_V4L2:libv4l
  25. URL:=https://github.com/jacksonliam/mjpg-streamer
  26. endef
  27. define Package/mjpg-streamer/Default/description
  28. Streaming application for Linux-UVC compatible webcams
  29. endef
  30. define Package/mjpg-streamer/description
  31. $(call Package/mjpg-streamer/Default/description)
  32. endef
  33. define Package/mjpg-streamer/conffiles
  34. /etc/config/mjpg-streamer
  35. endef
  36. define Package/mjpg-streamer/config
  37. if PACKAGE_mjpg-streamer-input-uvc
  38. config MJPG_STREAMER_V4L2
  39. bool "Build input_uvc with libv4l2 (camera controls)"
  40. default n
  41. select PACKAGE_libv4l
  42. endif
  43. endef
  44. define Package/mjpg-streamer/Default
  45. SECTION:=multimedia
  46. CATEGORY:=Multimedia
  47. TITLE:=MJPG-streamer
  48. URL:=https://github.com/jacksonliam/mjpg-streamer
  49. DEPENDS:=mjpg-streamer
  50. endef
  51. define Package/mjpg-streamer-input-file
  52. $(call Package/mjpg-streamer/Default)
  53. TITLE+= (file input)
  54. endef
  55. define Package/mjpg-streamer-input-file/description
  56. $(call Package/mjpg-streamer/Default/description)
  57. This package provides the file input plugin.
  58. endef
  59. define Package/mjpg-streamer-input-uvc
  60. $(call Package/mjpg-streamer/Default)
  61. TITLE+= (UVC input)
  62. endef
  63. define Package/mjpg-streamer-input-uvc/description
  64. $(call Package/mjpg-streamer/Default/description)
  65. This package provides the UVC input plugin.
  66. endef
  67. define Package/mjpg-streamer-input-http
  68. $(call Package/mjpg-streamer/Default)
  69. TITLE+= (HTTP input)
  70. endef
  71. define Package/mjpg-streamer-input-http/description
  72. $(call Package/mjpg-streamer/Default/description)
  73. This package provides the http input plugin.
  74. endef
  75. define Package/mjpg-streamer-output-rtsp
  76. $(call Package/mjpg-streamer/Default)
  77. TITLE+= (RTSP output)
  78. endef
  79. define Package/mjpg-streamer-output-rtsp/description
  80. $(call Package/mjpg-streamer/Default/description)
  81. This package provides the RTSP output plugin.
  82. endef
  83. define Package/mjpg-streamer-output-udp
  84. $(call Package/mjpg-streamer/Default)
  85. TITLE+= (UDP output)
  86. endef
  87. define Package/mjpg-streamer-output-udp/description
  88. $(call Package/mjpg-streamer/Default/description)
  89. This package provides the UDP output plugin.
  90. endef
  91. define Package/mjpg-streamer-output-file
  92. $(call Package/mjpg-streamer/Default)
  93. TITLE+= (file output)
  94. endef
  95. define Package/mjpg-streamer-output-file/description
  96. $(call Package/mjpg-streamer/Default/description)
  97. This package provides the file output plugin.
  98. endef
  99. define Package/mjpg-streamer-output-http
  100. $(call Package/mjpg-streamer/Default)
  101. TITLE+= (HTTP output)
  102. endef
  103. define Package/mjpg-streamer-output-http/description
  104. $(call Package/mjpg-streamer/Default/description)
  105. This package provides the HTTP output plugin.
  106. endef
  107. define Package/mjpg-streamer-output-zmq
  108. $(call Package/mjpg-streamer/Default)
  109. TITLE+= (zmq output)
  110. DEPENDS+= +libzmq +libprotobuf-c
  111. endef
  112. define Package/mjpg-streamer-output-zmq/description
  113. $(call Package/mjpg-streamer/Default/description)
  114. This package provides the ZeroMQ output plugin.
  115. endef
  116. define Package/mjpg-streamer-www
  117. $(call Package/mjpg-streamer/Default)
  118. TITLE+= (full www)
  119. CONFLICTS:=mjpg-streamer-www-simple
  120. endef
  121. define Package/mjpg-streamer-www/description
  122. $(call Package/mjpg-streamer/Default/description)
  123. This package provides full version of the web content.
  124. Includes cambozola applet.
  125. endef
  126. define Package/mjpg-streamer-www-simple
  127. $(call Package/mjpg-streamer/Default)
  128. TITLE+= (simple www)
  129. endef
  130. define Package/mjpg-streamer-www-simple/description
  131. $(call Package/mjpg-streamer/Default/description)
  132. This package provides simple version of the web content.
  133. endef
  134. CMAKE_OPTIONS += -DCMAKE_SKIP_RPATH=FALSE
  135. CAMBOZOLA:=cambozola-0.936.tar.gz
  136. # Distribution URL doesn't always have the correct version
  137. # Using the OpenWrt mirror provides a stable version
  138. # orig-URL:=http://www.andywilcock.com/code/cambozola
  139. define Download/cambozola
  140. URL:=https://sources.openwrt.org/
  141. FILE:=$(CAMBOZOLA)
  142. HASH:=4e4e92d95673edd051e6b4d36bed8c5328873f5fc374073760b457d4be33415b
  143. endef
  144. # redefine prepare to extract to our build dir
  145. # apply patches
  146. define Build/Prepare
  147. $(Build/Prepare/Default)
  148. # Fetch latest cambozola that works with latest Java(s)
  149. # Yes, I know this is ugly
  150. ifneq ($(CONFIG_PACKAGE_mjpg-streamer-www),)
  151. $(eval $(call Download,cambozola))
  152. $(TAR) -xf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
  153. -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
  154. endif
  155. endef
  156. define Build/Configure
  157. $(RM) $(PKG_BUILD_DIR)/plugins/input_uvc/uvcvideo.h
  158. $(call Build/Configure/Default)
  159. endef
  160. TARGET_LDFLAGS+= -ljpeg
  161. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  162. TARGET_CFLAGS+= -DUSE_LIBV4L2
  163. TARGET_LDFLAGS+= -lv4l2
  164. endif
  165. define Package/mjpg-streamer/install
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mjpg_streamer $(1)/usr/bin/
  168. $(INSTALL_DIR) $(1)/etc/config
  169. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  170. $(INSTALL_DIR) $(1)/etc/init.d
  171. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  172. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  173. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  174. endef
  175. define Package/mjpg-streamer-input-file/install
  176. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  177. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/input_file.so $(1)/usr/lib/mjpg-streamer
  178. endef
  179. define Package/mjpg-streamer-input-uvc/install
  180. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  181. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/input_uvc.so $(1)/usr/lib/mjpg-streamer
  182. endef
  183. define Package/mjpg-streamer-input-http/install
  184. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  185. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/input_http.so $(1)/usr/lib/mjpg-streamer
  186. endef
  187. define Package/mjpg-streamer-output-rtsp/install
  188. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  189. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/output_rtsp.so $(1)/usr/lib/mjpg-streamer
  190. endef
  191. define Package/mjpg-streamer-output-udp/install
  192. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  193. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/output_udp.so $(1)/usr/lib/mjpg-streamer
  194. endef
  195. define Package/mjpg-streamer-output-file/install
  196. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  197. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/output_file.so $(1)/usr/lib/mjpg-streamer
  198. endef
  199. define Package/mjpg-streamer-output-http/install
  200. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  201. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/output_http.so $(1)/usr/lib/mjpg-streamer
  202. endef
  203. define Package/mjpg-streamer-output-zmq/install
  204. $(INSTALL_DIR) $(1)/usr/lib/mjpg-streamer
  205. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mjpg-streamer/output_zmqserver.so $(1)/usr/lib/mjpg-streamer
  206. endef
  207. define Package/mjpg-streamer-www/install
  208. $(INSTALL_DIR) $(1)/www/webcam
  209. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mjpg-streamer/www/* $(1)/www/webcam
  210. endef
  211. define Package/mjpg-streamer-www-simple/install
  212. $(INSTALL_DIR) $(1)/www/webcam
  213. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mjpg-streamer/www/stream_simple.html $(1)/www/webcam/index.html
  214. endef
  215. $(eval $(call BuildPackage,mjpg-streamer))
  216. $(eval $(call BuildPackage,mjpg-streamer-input-file))
  217. $(eval $(call BuildPackage,mjpg-streamer-input-uvc))
  218. $(eval $(call BuildPackage,mjpg-streamer-input-http))
  219. $(eval $(call BuildPackage,mjpg-streamer-output-rtsp))
  220. $(eval $(call BuildPackage,mjpg-streamer-output-file))
  221. $(eval $(call BuildPackage,mjpg-streamer-output-http))
  222. $(eval $(call BuildPackage,mjpg-streamer-output-zmq))
  223. $(eval $(call BuildPackage,mjpg-streamer-www))
  224. $(eval $(call BuildPackage,mjpg-streamer-www-simple))