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.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.9
  8. PKG_RELEASE:=2
  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_HASH:=f08f257d26c5e9b503f068d6753c8e55cb76f47f73a81da6ed2bba3de3fee2ff
  14. PKG_LICENSE:=GPL-3.0-or-later
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  17. PKG_INSTALL:=1
  18. PKG_FIXUP:=autoreconf
  19. PLUGINS:= \
  20. archive:+libarchive-noopenssl \
  21. deb \
  22. dvi \
  23. flac:+libflac \
  24. gif:+giflib \
  25. gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
  26. it \
  27. jpeg:+libjpeg \
  28. man \
  29. mime:+libmagic \
  30. mpeg:+libmpeg2 \
  31. nsf \
  32. nsfe \
  33. odf \
  34. ogg:+libvorbis \
  35. png \
  36. ps \
  37. riff \
  38. s3m \
  39. sid \
  40. thumbnailffmpeg:+libffmpeg-full:+libmagic \
  41. tiff:+libtiff \
  42. wav \
  43. xm \
  44. zip
  45. include $(INCLUDE_DIR)/package.mk
  46. include $(INCLUDE_DIR)/nls.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 $(ICONV_DEPENDS) $(INTL_DEPENDS)
  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))