1
0

Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #
  2. # Copyright (C) 2006-2015 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:=8
  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_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. ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
  60. TARGET_CFLAGS+= -DUSE_LIBV4L2
  61. TARGET_LDFLAGS+= -lv4l2
  62. endif
  63. define Package/mjpg-streamer/install
  64. $(INSTALL_DIR) $(1)/usr/bin
  65. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
  66. $(INSTALL_DIR) $(1)/etc/config
  67. $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
  68. $(INSTALL_DIR) $(1)/etc/init.d
  69. $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
  70. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  71. $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
  74. $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
  75. endif
  76. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
  77. $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
  78. endif
  79. ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
  80. $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
  81. endif
  82. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
  83. $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
  84. endif
  85. ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
  86. $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
  87. $(INSTALL_DIR) $(1)/www/webcam
  88. ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
  89. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
  90. else
  91. $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
  92. endif
  93. endif
  94. endef
  95. $(eval $(call BuildPackage,mjpg-streamer))