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.

148 lines
4.0 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.10
  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:=9eed11b5ddc7c929ba112c50de8cfaa379f1d99a0c8e064101775837cf432357
  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-thumbnailffmpeg \
  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 \
  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. thumbnailffmpeg:+libffmpeg-full:+libmagic:@BUILD_PATENTED \
  44. tiff:+libtiff \
  45. wav \
  46. xm \
  47. zip
  48. include $(INCLUDE_DIR)/package.mk
  49. include $(INCLUDE_DIR)/nls.mk
  50. CONFIGURE_ARGS += \
  51. --$(if $(CONFIG_PACKAGE_libextractor-plugin-thumbnailffmpeg),en,dis)able-ffmpeg \
  52. --disable-glibtest \
  53. --disable-gsf \
  54. --disable-rpath \
  55. --with$(if $(CONFIG_PACKAGE_libextractor-plugin-gstreamer),,out)-gstreamer
  56. CONFIGURE_VARS += \
  57. ac_cv_lib_jpeg_jpeg_mem_src=yes
  58. TARGET_LDFLAGS += \
  59. -liconv
  60. define Package/libextractor
  61. SECTION:=libs
  62. CATEGORY:=Libraries
  63. TITLE:=GNU Libextractor
  64. URL:=https://www.gnu.org/software/libextractor/
  65. DEPENDS:=+libbz2 +libltdl +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
  66. MENU:=1
  67. endef
  68. define Package/libextractor/description
  69. GNU Libextractor is a library used to extract meta data from files.
  70. The goal is to provide developers of file-sharing networks, browsers or
  71. WWW-indexing bots with a universal library to obtain simple keywords and meta
  72. data to match against queries and to show to users instead of only relying on
  73. filenames.
  74. endef
  75. define PluginGen
  76. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
  77. SECTION:=libs
  78. CATEGORY:=Libraries
  79. TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
  80. URL:=https://www.gnu.org/software/libextractor/
  81. DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
  82. endef
  83. endef
  84. $(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
  85. define Package/extract
  86. SECTION:=utils
  87. CATEGORY:=Utilities
  88. TITLE:=extract util from GNU Libextractor
  89. URL:=https://www.gnu.org/software/libextractor/
  90. DEPENDS:=+libextractor
  91. endef
  92. define Package/extract/description
  93. libextractor contains the shell command extract that, similar to the
  94. well-known file command, can extract meta data from a file an print the results
  95. to stdout.
  96. endef
  97. define Build/InstallDev
  98. $(INSTALL_DIR) $(1)/usr/include/
  99. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  100. $(INSTALL_DIR) $(1)/usr/lib/
  101. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
  102. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  103. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  104. endef
  105. define Package/libextractor/install
  106. $(INSTALL_DIR) $(1)/usr/lib/
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  108. endef
  109. define PluginInstall
  110. define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
  111. $(INSTALL_DIR) $$(1)/usr/lib/libextractor
  112. $(INSTALL_BIN) \
  113. $(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
  114. $$(1)/usr/lib/libextractor
  115. endef
  116. endef
  117. define Package/extract/install
  118. $(INSTALL_DIR) $(1)/usr/bin
  119. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  120. endef
  121. $(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
  122. $(eval $(call BuildPackage,libextractor))
  123. $(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
  124. $(eval $(call BuildPackage,extract))