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.

140 lines
3.6 KiB

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