aboutsummaryrefslogtreecommitdiff
path: root/libs/libextractor/Makefile
blob: 179bc9a78a5151f3671527c0a0e3679f312c4d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#
# 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.8
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:=e235a4aa2623fe458f8fcf1dcbb5be4f03df509aacec86a1de1fc7fcca582cfc

PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>

PKG_INSTALL:=1
PKG_FIXUP:=autoreconf

PLUGINS:= \
	archive:+libarchive-noopenssl \
	deb \
	dvi \
	flac:+libflac \
	gif:+giflib \
	gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
	it \
	jpeg:+libjpeg \
	man \
	mime:+libmagic \
	mpeg:+libmpeg2 \
	nsf \
	nsfe \
	odf \
	ogg:+libvorbis \
	png \
	ps \
	riff \
	s3m \
	sid \
	thumbnailffmpeg:+libffmpeg-full:+libmagic \
	tiff:+libtiff \
	wav \
	xm \
	zip


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

CONFIGURE_ARGS += \
	--enable-ffmpeg \
	--with-gstreamer \
	--disable-gsf \
	--disable-rpath

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))