Files
packages/libs/libextractor/Makefile
T
Daniel Golle 45cb8e6cd5 libextractor: update to 1.19
1.15: fix potential 4 MB on-stack allocation / stack-based buffer overflow
in the OLE2 plugin.

1.16: security fix to not honour LIBEXTRACTOR_PREFIX when linked into a
SUID binary running as root; fix tIME chunk parser in PNG plugin, QT
mime-type detection, wrong constant in REAL plugin, multi-chunked
decompression in DEB plugin, GIF plugin memory leak, W32 IPC error
handling, gzip-compressed header bit-flags.

1.17: fix various minor issues, including a missing 0 terminator in ZIP
handling under particular circumstances.

1.18: detect secure execution mode properly when deciding whether to
honour LIBEXTRACTOR_PREFIX (use secure_getenv()/issetugid()/real vs
effective UID-GID instead of only checking for root).

1.19: add RTF and msoffice plugins; fix bugs and performance issues in
the unzip logic, an offset calculation issue in the WAV extractor, and
minor memory leaks in the ELF extractor; add OSS-Fuzz support.

Add the two new plugins to PLUGINS so they actually get built and
packaged rather than compiled and silently dropped. Per
src/plugins/Makefile.am upstream, neither needs a new dependency:
libextractor_rtf is unconditional (same group as the already-packaged
riff/ps plugins), and libextractor_msoffice only requires HAVE_ZLIB
(same group as the already-packaged deb/odf/zip plugins), which is
already satisfied.

Not build-verified: a pre-existing host python3/ncurses build failure
affecting every package in this feed blocks the build well before it
reaches libextractor's own compile step.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-08-24 14:45:02 +01:00

149 lines
3.9 KiB
Makefile

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libextractor
PKG_VERSION:=1.19
PKG_RELEASE:=1
# ToDo:
# - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=2d5b33cbdb21c88ae9360994d4e216627413ee9cb11b31b033c2d0cf42ef2700
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_CPE_ID:=cpe:/a:gnu:libextractor
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_libextractor-plugin-gstreamer
PLUGINS:= \
archive:+libarchive-noopenssl \
deb \
dvi \
flac:+libflac \
gif:+giflib \
gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
it \
jpeg:+libjpeg-turbo \
man \
mime:+libmagic \
mpeg:+libmpeg2 \
msoffice \
nsf \
nsfe \
odf \
ogg:+libvorbis \
png \
ps \
riff \
rtf \
s3m \
sid \
tiff:+libtiff \
wav \
xm \
zip
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
CONFIGURE_ARGS += \
--disable-glibtest \
--disable-gsf \
--disable-rpath \
--with$(if $(CONFIG_PACKAGE_libextractor-plugin-gstreamer),,out)-gstreamer
CONFIGURE_VARS += \
ac_cv_lib_apparmor_aa_change_profile=no
TARGET_CFLAGS += -D__GNU_LIBRARY__
define Package/libextractor
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU Libextractor
URL:=https://www.gnu.org/software/libextractor/
DEPENDS:=+libbz2 +libltdl +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
MENU:=1
endef
define Package/libextractor/description
GNU Libextractor is a library used to extract meta data from files.
The goal is to provide developers of file-sharing networks, browsers or
WWW-indexing bots with a universal library to obtain simple keywords and meta
data to match against queries and to show to users instead of only relying on
filenames.
endef
define PluginGen
define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
URL:=https://www.gnu.org/software/libextractor/
DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
endef
endef
$(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
define Package/extract
SECTION:=utils
CATEGORY:=Utilities
TITLE:=extract util from GNU Libextractor
URL:=https://www.gnu.org/software/libextractor/
DEPENDS:=+libextractor
endef
define Package/extract/description
libextractor contains the shell command extract that, similar to the
well-known file command, can extract meta data from a file an print the results
to stdout.
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
endef
define Package/libextractor/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
endef
define PluginInstall
define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
$(INSTALL_DIR) $$(1)/usr/lib/libextractor
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
$$(1)/usr/lib/libextractor
endef
endef
define Package/extract/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
$(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
$(eval $(call BuildPackage,libextractor))
$(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
$(eval $(call BuildPackage,extract))