Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / libs / libextractor / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=libextractor
9 PKG_VERSION:=1.4
10 PKG_RELEASE:=1
11
12 # ToDo:
13 # - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
17 PKG_HASH:=84128170a4a9aa3a19942dd53fdf30ed17b56d7fae79b5f6e7e17a0d65d1f66c
18
19 PKG_LICENSE:=GPL-3.0
20 PKG_LICENSE_FILES:=COPYING
21 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
22
23 PKG_INSTALL:=1
24 PKG_FIXUP:=autoreconf
25
26 PLUGINS:= \
27 archive:+libarchive-noopenssl \
28 deb \
29 dvi \
30 flac:+libflac \
31 gif:+giflib \
32 gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
33 it \
34 jpeg:+libjpeg \
35 man \
36 mime:+libmagic \
37 mpeg:+libmpeg2 \
38 nsf \
39 nsfe \
40 odf \
41 ogg:+libvorbis \
42 png \
43 ps \
44 riff \
45 s3m \
46 sid \
47 thumbnailffmpeg:+libffmpeg-full:+libmagic \
48 tiff:+libtiff \
49 wav \
50 xm \
51 zip
52
53
54 include $(INCLUDE_DIR)/package.mk
55 include $(INCLUDE_DIR)/nls.mk
56
57 CONFIGURE_ARGS += \
58 --enable-ffmpeg \
59 --with-gstreamer \
60 --disable-gsf \
61 --disable-rpath
62
63 define Package/libextractor
64 SECTION:=libs
65 CATEGORY:=Libraries
66 TITLE:=GNU Libextractor
67 URL:=https://www.gnu.org/software/libextractor/
68 DEPENDS:=+libbz2 +libltdl +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
69 MENU:=1
70 endef
71
72 define Package/libextractor/description
73 GNU Libextractor is a library used to extract meta data from files.
74 The goal is to provide developers of file-sharing networks, browsers or
75 WWW-indexing bots with a universal library to obtain simple keywords and meta
76 data to match against queries and to show to users instead of only relying on
77 filenames.
78 endef
79
80 define PluginGen
81 define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
82 SECTION:=libs
83 CATEGORY:=Libraries
84 TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
85 URL:=https://www.gnu.org/software/libextractor/
86 DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
87 endef
88 endef
89
90 $(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
91
92 define Package/extract
93 SECTION:=utils
94 CATEGORY:=Utilities
95 TITLE:=extract util from GNU Libextractor
96 URL:=https://www.gnu.org/software/libextractor/
97 DEPENDS:=+libextractor
98 endef
99
100 define Package/extract/description
101 libextractor contains the shell command extract that, similar to the
102 well-known file command, can extract meta data from a file an print the results
103 to stdout.
104 endef
105
106 define Build/InstallDev
107 $(INSTALL_DIR) $(1)/usr/include/
108 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
109 $(INSTALL_DIR) $(1)/usr/lib/
110 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
111 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
112 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
113 endef
114
115 define Package/libextractor/install
116 $(INSTALL_DIR) $(1)/usr/lib/
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
118 endef
119
120 define PluginInstall
121 define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
122 $(INSTALL_DIR) $$(1)/usr/lib/libextractor
123 $(INSTALL_BIN) \
124 $(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
125 $$(1)/usr/lib/libextractor
126 endef
127 endef
128
129 define Package/extract/install
130 $(INSTALL_DIR) $(1)/usr/bin
131 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
132 endef
133
134 $(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
135
136 $(eval $(call BuildPackage,libextractor))
137 $(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
138 $(eval $(call BuildPackage,extract))