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.

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