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.

116 lines
3.4 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_REV:=182
  8. PKG_VERSION:=r$(PKG_REV)
  9. PKG_RELEASE:=10
  10. PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>, \
  11. Ted Hess <thess@kitschensync.net>
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.xz
  13. PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE_VERSION:=$(PKG_REV)
  16. PKG_SOURCE_PROTO:=svn
  17. PKG_MIRROR_HASH:=ccff417d0a34f7cee12c7984f77788267b1da0f2a7d849bc1b2e3614e670078b
  18. PKG_LICENSE:=GPL-2.0
  19. PKG_LICENSE_FILES:=LICENSE
  20. include $(INCLUDE_DIR)/package.mk
  21. PKG_BUILD_DEPENDS:=MJPG_STREAMER_V4L2:libv4l
  22. define Package/mjpg-streamer
  23. SECTION:=multimedia
  24. CATEGORY:=Multimedia
  25. TITLE:=MJPG-streamer
  26. DEPENDS:=+libpthread +libjpeg +MJPG_STREAMER_V4L2:libv4l
  27. URL:=http://mjpg-streamer.wiki.sourceforge.net/
  28. MENU:=1
  29. endef
  30. define Package/mjpg-streamer/description
  31. Streaming application for Linux-UVC compatible webcams
  32. endef
  33. define Package/mjpg-streamer/config
  34. source "$(SOURCE)/Config.in"
  35. endef
  36. EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)
  37. define Package/mjpg-streamer/conffiles
  38. /etc/config/mjpg-streamer
  39. endef
  40. CAMBOZOLA:=cambozola-0.936.tar.gz
  41. # Distribution URL doesn't always have the correct version
  42. # Using the OpenWrt mirror provides a stable version
  43. # orig-URL:=http://www.andywilcock.com/code/cambozola
  44. define Download/cambozola
  45. URL:=http://mirror2.openwrt.org/sources
  46. FILE:=$(CAMBOZOLA)
  47. MD5SUM:=35c45188aa9635aef2b745c35c311396
  48. endef
  49. # Fetch latest cambozola that works with latest Java(s)
  50. # Yes, I know this is ugly
  51. define Build/Prepare
  52. $(call Build/Prepare/Default)
  53. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  54. $(eval $(call Download,cambozola))
  55. $(TAR) -xvf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
  56. -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
  57. endif
  58. endef
  59. define Build/Configure
  60. $(RM) $(PKG_BUILD_DIR)/plugins/input_uvc/uvcvideo.h
  61. endef
  62. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  63. TARGET_CFLAGS+= -DUSE_LIBV4L2
  64. TARGET_LDFLAGS+= -lv4l2
  65. endif
  66. define Package/mjpg-streamer/install
  67. $(INSTALL_DIR) $(1)/usr/bin
  68. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
  69. $(INSTALL_DIR) $(1)/etc/config
  70. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  71. $(INSTALL_DIR) $(1)/etc/init.d
  72. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  73. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  74. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
  77. $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
  78. endif
  79. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
  80. $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
  81. endif
  82. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
  83. $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
  84. endif
  85. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
  86. $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
  87. endif
  88. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
  89. $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
  90. $(INSTALL_DIR) $(1)/www/webcam
  91. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  92. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
  93. else
  94. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
  95. endif
  96. endif
  97. endef
  98. $(eval $(call BuildPackage,mjpg-streamer))