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.

107 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=mjpg-streamer
  9. PKG_REV:=182
  10. PKG_VERSION:=r$(PKG_REV)
  11. PKG_RELEASE:=1
  12. PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
  14. PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_SOURCE_VERSION:=$(PKG_REV)
  17. PKG_SOURCE_PROTO:=svn
  18. PKG_LICENSE:=GPL-2.0
  19. PKG_LICENSE_FILE:=LICENSE
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/mjpg-streamer
  22. SECTION:=multimedia
  23. CATEGORY:=Multimedia
  24. TITLE:=MJPG-streamer
  25. DEPENDS:=+libpthread +libjpeg +PACKAGE_libv4l:libv4l
  26. URL:=http://mjpg-streamer.wiki.sourceforge.net/
  27. MENU:=1
  28. endef
  29. define Package/mjpg-streamer/description
  30. Streaming application for Linux-UVC compatible webcams
  31. endef
  32. define Package/mjpg-streamer/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)
  36. define Package/mjpg-streamer/conffiles
  37. /etc/config/mjpg-streamer
  38. endef
  39. CAMBOZOLA:=cambozola-latest.tar.gz
  40. define Download/cambozola
  41. URL:=http://www.andywilcock.com/code/cambozola
  42. FILE:=$(CAMBOZOLA)
  43. MD5SUM:=6c48fd994685d4d72668850eeb613e24
  44. endef
  45. # Fetch latest cambozola that works with latest Java(s)
  46. # Yes, I know this is ugly
  47. define Build/Prepare
  48. $(call Build/Prepare/Default)
  49. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  50. $(eval $(call Download,cambozola))
  51. $(TAR) -xvf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
  52. -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
  53. endif
  54. endef
  55. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  56. TARGET_CFLAGS+= -DUSE_LIBV4L2
  57. TARGET_LDFLAGS+= -lv4l2
  58. endif
  59. define Package/mjpg-streamer/install
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
  62. $(INSTALL_DIR) $(1)/etc/config
  63. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  64. $(INSTALL_DIR) $(1)/etc/init.d
  65. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  66. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  67. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  68. $(INSTALL_DIR) $(1)/usr/lib
  69. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
  70. $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
  71. endif
  72. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
  73. $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
  74. endif
  75. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
  76. $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
  77. endif
  78. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
  79. $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
  80. endif
  81. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
  82. $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
  83. $(INSTALL_DIR) $(1)/www/webcam
  84. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  85. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
  86. else
  87. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
  88. endif
  89. endif
  90. endef
  91. $(eval $(call BuildPackage,mjpg-streamer))