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.

139 lines
3.6 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=libextractor
  7. PKG_VERSION:=1.3
  8. PKG_RELEASE:=4
  9. # ToDo:
  10. # - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  13. PKG_MD5SUM:=35b8913dbebafe583a2781bf71509c48
  14. PKG_HASH:=868ad64c9a056d6b923d451d746935bffb1ddf5d89c3eb4f67d786001a3f7b7f
  15. PKG_LICENSE:=GPL-3.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  18. PKG_INSTALL:=1
  19. PKG_FIXUP:=autoreconf
  20. PLUGINS:= \
  21. archive:+libarchive-noopenssl \
  22. deb \
  23. dvi \
  24. flac:+libflac \
  25. gif:+giflib \
  26. gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+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. include $(INCLUDE_DIR)/nls.mk
  48. CONFIGURE_ARGS += \
  49. --enable-ffmpeg \
  50. --with-gstreamer \
  51. --disable-gsf \
  52. --disable-rpath
  53. define Package/libextractor
  54. SECTION:=libs
  55. CATEGORY:=Libraries
  56. TITLE:=GNU Libextractor
  57. URL:=https://www.gnu.org/software/libextractor/
  58. DEPENDS:=+libbz2 +libltdl +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
  59. MENU:=1
  60. endef
  61. define Package/libextractor/description
  62. GNU Libextractor is a library used to extract meta data from files.
  63. The goal is to provide developers of file-sharing networks, browsers or
  64. WWW-indexing bots with a universal library to obtain simple keywords and meta
  65. data to match against queries and to show to users instead of only relying on
  66. filenames.
  67. endef
  68. define PluginGen
  69. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
  70. SECTION:=libs
  71. CATEGORY:=Libraries
  72. TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
  73. URL:=https://www.gnu.org/software/libextractor/
  74. DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
  75. endef
  76. endef
  77. $(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
  78. define Package/extract
  79. SECTION:=utils
  80. CATEGORY:=Utilities
  81. TITLE:=extract util from GNU Libextractor
  82. URL:=https://www.gnu.org/software/libextractor/
  83. DEPENDS:=+libextractor
  84. endef
  85. define Package/extract/description
  86. libextractor contains the shell command extract that, similar to the
  87. well-known file command, can extract meta data from a file an print the results
  88. to stdout.
  89. endef
  90. define Build/InstallDev
  91. $(INSTALL_DIR) $(1)/usr/include/
  92. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  93. $(INSTALL_DIR) $(1)/usr/lib/
  94. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
  95. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  96. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  97. endef
  98. define Package/libextractor/install
  99. $(INSTALL_DIR) $(1)/usr/lib/
  100. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  101. endef
  102. define PluginInstall
  103. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
  104. $(INSTALL_DIR) $$(1)/usr/lib/libextractor
  105. $(INSTALL_BIN) \
  106. $(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
  107. $$(1)/usr/lib/libextractor
  108. endef
  109. endef
  110. define Package/extract/install
  111. $(INSTALL_DIR) $(1)/usr/bin
  112. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  113. endef
  114. $(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
  115. $(eval $(call BuildPackage,libextractor))
  116. $(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
  117. $(eval $(call BuildPackage,extract))