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.

138 lines
3.5 KiB

  1. #
  2. # Copyright (C) 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:=libextractor
  9. PKG_VERSION:=1.3
  10. PKG_RELEASE:=3
  11. # ToDo:
  12. # - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  15. PKG_MD5SUM:=35b8913dbebafe583a2781bf71509c48
  16. PKG_LICENSE:=GPL-3.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  19. PKG_INSTALL:=1
  20. PLUGINS:= \
  21. archive:+libarchive \
  22. deb \
  23. dvi \
  24. flac:+libflac \
  25. gif:+giflib \
  26. gstreamer:+libgstreamer1:+libgst1app:+libgst1pbutils:+libgst1tag \
  27. it \
  28. jpeg:+libjpeg \
  29. man \
  30. mime:+libmagic \
  31. mpeg:+libmpeg2 \
  32. nsf \
  33. nsfe \
  34. odf \
  35. ogg:+libvorbis \
  36. png \
  37. ps \
  38. riff \
  39. s3m \
  40. sid \
  41. thumbnailffmpeg:+libffmpeg-full:+libmagic \
  42. tiff:+libtiff \
  43. wav \
  44. xm \
  45. zip
  46. include $(INCLUDE_DIR)/package.mk
  47. CONFIGURE_ARGS += \
  48. --enable-ffmpeg \
  49. --with-gstreamer \
  50. --disable-gsf \
  51. --disable-rpath
  52. define Package/libextractor
  53. SECTION:=libs
  54. CATEGORY:=Libraries
  55. TITLE:=GNU Libextractor
  56. URL:=https://www.gnu.org/software/libextractor/
  57. DEPENDS:=+libbz2 +libltdl +librt +zlib
  58. MENU:=1
  59. endef
  60. define Package/libextractor/description
  61. GNU Libextractor is a library used to extract meta data from files.
  62. The goal is to provide developers of file-sharing networks, browsers or
  63. WWW-indexing bots with a universal library to obtain simple keywords and meta
  64. data to match against queries and to show to users instead of only relying on
  65. filenames.
  66. endef
  67. define PluginGen
  68. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
  69. SECTION:=libs
  70. CATEGORY:=Libraries
  71. TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
  72. URL:=https://www.gnu.org/software/libextractor/
  73. DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
  74. endef
  75. endef
  76. $(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
  77. define Package/extract
  78. SECTION:=utils
  79. CATEGORY:=Utilities
  80. TITLE:=extract util from GNU Libextractor
  81. URL:=https://www.gnu.org/software/libextractor/
  82. DEPENDS:=+libextractor
  83. endef
  84. define Package/extract/description
  85. libextractor contains the shell command extract that, similar to the
  86. well-known file command, can extract meta data from a file an print the results
  87. to stdout.
  88. endef
  89. define Build/InstallDev
  90. $(INSTALL_DIR) $(1)/usr/include/
  91. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  92. $(INSTALL_DIR) $(1)/usr/lib/
  93. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
  94. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  95. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  96. endef
  97. define Package/libextractor/install
  98. $(INSTALL_DIR) $(1)/usr/lib/
  99. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  100. endef
  101. define PluginInstall
  102. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
  103. $(INSTALL_DIR) $$(1)/usr/lib/libextractor
  104. $(INSTALL_BIN) \
  105. $(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
  106. $$(1)/usr/lib/libextractor
  107. endef
  108. endef
  109. define Package/extract/install
  110. $(INSTALL_DIR) $(1)/usr/bin
  111. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  112. endef
  113. $(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
  114. $(eval $(call BuildPackage,libextractor))
  115. $(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
  116. $(eval $(call BuildPackage,extract))