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.

108 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:=181
  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).tar.bz2
  14. PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_SOURCE_VERSION:=$(PKG_REV)
  17. PKG_SOURCE_PROTO:=svn
  18. PKG_MD5SUM:=b2bc22665733319e647ace236e283684
  19. PKG_LICENSE:=GPL-2.0
  20. PKG_LICENSE_FILE:=LICENSE
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/mjpg-streamer
  23. SECTION:=multimedia
  24. CATEGORY:=Multimedia
  25. TITLE:=MJPG-streamer
  26. DEPENDS:=+libpthread +libjpeg +PACKAGE_libv4l: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-latest.tar.gz
  41. define Download/cambozola
  42. URL:=http://www.andywilcock.com/code/cambozola
  43. FILE:=$(CAMBOZOLA)
  44. MD5SUM:=6c48fd994685d4d72668850eeb613e24
  45. endef
  46. # Fetch latest cambozola that works with latest Java(s)
  47. # Yes, I know this is ugly
  48. define Build/Prepare
  49. $(call Build/Prepare/Default)
  50. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  51. $(eval $(call Download,cambozola))
  52. $(TAR) -xvf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
  53. -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
  54. endif
  55. endef
  56. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  57. TARGET_CFLAGS+= -DUSE_LIBV4L2
  58. TARGET_LDFLAGS+= -lv4l2
  59. endif
  60. define Package/mjpg-streamer/install
  61. $(INSTALL_DIR) $(1)/usr/bin
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
  63. $(INSTALL_DIR) $(1)/etc/config
  64. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  67. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  68. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
  71. $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
  72. endif
  73. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
  74. $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
  75. endif
  76. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
  77. $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
  78. endif
  79. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
  80. $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
  81. endif
  82. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
  83. $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
  84. $(INSTALL_DIR) $(1)/www/webcam
  85. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  86. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
  87. else
  88. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
  89. endif
  90. endif
  91. endef
  92. $(eval $(call BuildPackage,mjpg-streamer))