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.

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