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.

110 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:=2
  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
  26. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  27. DEPENDS+=+libv4l
  28. endif
  29. URL:=http://mjpg-streamer.wiki.sourceforge.net/
  30. MENU:=1
  31. endef
  32. define Package/mjpg-streamer/description
  33. Streaming application for Linux-UVC compatible webcams
  34. endef
  35. define Package/mjpg-streamer/config
  36. source "$(SOURCE)/Config.in"
  37. endef
  38. EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)
  39. define Package/mjpg-streamer/conffiles
  40. /etc/config/mjpg-streamer
  41. endef
  42. CAMBOZOLA:=cambozola-latest.tar.gz
  43. define Download/cambozola
  44. URL:=http://www.andywilcock.com/code/cambozola
  45. FILE:=$(CAMBOZOLA)
  46. MD5SUM:=6c48fd994685d4d72668850eeb613e24
  47. endef
  48. # Fetch latest cambozola that works with latest Java(s)
  49. # Yes, I know this is ugly
  50. define Build/Prepare
  51. $(call Build/Prepare/Default)
  52. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  53. $(eval $(call Download,cambozola))
  54. $(TAR) -xvf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
  55. -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
  56. endif
  57. endef
  58. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  59. TARGET_CFLAGS+= -DUSE_LIBV4L2
  60. TARGET_LDFLAGS+= -lv4l2
  61. endif
  62. define Package/mjpg-streamer/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
  65. $(INSTALL_DIR) $(1)/etc/config
  66. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  67. $(INSTALL_DIR) $(1)/etc/init.d
  68. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  69. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  70. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
  73. $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
  74. endif
  75. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
  76. $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
  77. endif
  78. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
  79. $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
  80. endif
  81. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
  82. $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
  83. endif
  84. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
  85. $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
  86. $(INSTALL_DIR) $(1)/www/webcam
  87. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  88. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
  89. else
  90. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
  91. endif
  92. endif
  93. endef
  94. $(eval $(call BuildPackage,mjpg-streamer))