1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
2 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
3 # Contributor: Marcello "mererghost" Rocha <https://github.com/mereghost>
4 # Contributor: Blaž "Speed" Hrastnik <https://github.com/archSeer>
9 opensearch-analysis-icu-plugin
10 opensearch-analysis-kuromoji-plugin
11 opensearch-analysis-nori-plugin
12 opensearch-analysis-phonetic-plugin
13 opensearch-analysis-smartcn-plugin
14 opensearch-analysis-stempel-plugin
15 opensearch-analysis-ukrainian-plugin
16 opensearch-discovery-azure-classic-plugin
17 opensearch-discovery-ec2-plugin
18 opensearch-discovery-gce-plugin
19 opensearch-ingest-attachment-plugin
20 opensearch-mapper-annotated-text-plugin
21 opensearch-mapper-murmur3-plugin
22 opensearch-mapper-size-plugin
23 opensearch-repository-azure-plugin
24 opensearch-repository-gcs-plugin
25 opensearch-repository-hdfs-plugin
26 opensearch-repository-s3-plugin
27 opensearch-store-smb-plugin
28 opensearch-transport-nio-plugin
32 # See https://github.com/opensearch-project/OpenSearch/blob/main/.ci/java-versions.properties
36 url="https://opensearch.org/docs/opensearch/index/"
38 makedepends=("jdk${_jdkver}-openjdk" 'unzip')
40 "OpenSearch-${pkgver}.tar.gz::https://github.com/opensearch-project/OpenSearch/archive/${pkgver}.tar.gz"
43 opensearch-keystore.service
44 opensearch-keystore@.service
45 opensearch-sysctl.conf
47 opensearch-tmpfile.conf
50 sha256sums=('977c26b153146bee8295d439ee064fc5d4b9af4687e6b986da948cea8681fe7b'
51 'b59d064ce8e348f22b969cc2b7522a1c7b64d4b4e3fd98d9ad1f01d842e94d46'
52 '02bfe1e723f6522d7b5bf72d43c7847c4d9329d105b543583aa5b9c952e7d54d'
53 '097de1fc6ef1f12e99d2b3def9c9803cf0dd8609aeace608048d599a2cb85c5c'
54 'a133b8944d57d81224caf03f8d0e5b127f2570123b2a1e2d2f6eb199446448ae'
55 'b3feb1e9c7e7ce6b33cea6c727728ed700332aae942ca475c3bcc1d56b9f113c'
56 '79cb5856b7105da7f25c6da2a25be88ccba2b849fd92cc32c3204e2fad530efc'
57 '12c4feb01c5c42e98e53f9d6fd457727ec0bf0b19bf9c4bc2ee216f31afe7afc'
58 '66401172f710e80e1f715c89bc6ed5a6d0ad567c58ad03101e59556c52245158')
61 cd "OpenSearch-${pkgver}"
62 export JAVA_HOME="/usr/lib/jvm/java-${_jdkver}-openjdk"
63 export PATH="/usr/lib/jvm/java-${_jdkver}-openjdk/bin:$PATH"
64 export GRADLE_OPTS="-Dbuild.snapshot=false -Dorg.gradle.jvmargs=-Xmx8192M" # https://github.com/opensearch-project/OpenSearch/blame/1.3/DEVELOPER_GUIDE.md#L65
66 echo "======================== Building OpenSearch =========================="
69 ./gradlew :distribution:buildSystemdModule
70 ./gradlew :distribution:archives:no-jdk-linux-tar:build
81 discovery-azure-classic \
85 mapper-annotated-text \
94 echo "======================== Building plugin ${p} ========================"
95 ./gradlew :plugin:${p}:build
99 package_opensearch() {
100 pkgdesc="Open source distributed and RESTful search engine"
101 depends=("jre${_jrever}-openjdk-headless" 'systemd' 'libxml2')
103 'opensearch-analysis-icu-plugin'
104 'opensearch-analysis-kuromoji-plugin'
105 'opensearch-analysis-nori-plugin'
106 'opensearch-analysis-phonetic-plugin'
107 'opensearch-analysis-smartcn-plugin'
108 'opensearch-analysis-stempel-plugin'
109 'opensearch-analysis-ukrainian-plugin'
110 'opensearch-discovery-azure-classic-plugin'
111 'opensearch-discovery-ec2-plugin'
112 'opensearch-discovery-gce-plugin'
113 'opensearch-ingest-attachment-plugin'
114 'opensearch-mapper-annotated-text-plugin'
115 'opensearch-mapper-murmur3-plugin'
116 'opensearch-mapper-size-plugin'
117 'opensearch-repository-azure-plugin'
118 'opensearch-repository-gcs-plugin'
119 'opensearch-repository-hdfs-plugin'
120 'opensearch-repository-s3-plugin'
121 'opensearch-store-smb-plugin'
122 'opensearch-transport-nio-plugin'
123 'opensearch-alerting-plugin'
124 'opensearch-anomaly-detection-plugin'
125 'opensearch-asynchronous-search-plugin'
126 'opensearch-cross-cluster-replication-plugin'
127 'opensearch-geospatial-plugin'
128 'opensearch-ml-commons-plugin'
129 'opensearch-notifications-plugin'
130 'opensearch-neural-search-plugin'
131 'opensearch-index-management-plugin'
132 'opensearch-job-scheduler-plugin'
133 'opensearch-knn-plugin'
134 'opensearch-observability-plugin'
135 'opensearch-performance-analyzer-plugin'
136 'opensearch-reports-scheduler-plugin'
137 'opensearch-security-plugin'
138 'opensearch-sql-plugin'
141 'etc/opensearch/opensearch.yml'
142 'etc/opensearch/log4j2.properties'
143 'etc/opensearch/jvm.options'
144 'etc/default/opensearch'
147 cd "OpenSearch-${pkgver}"
149 install -dm755 "${pkgdir}"/{usr/share,var/lib,var/log}/opensearch
150 install -dm755 "${pkgdir}/usr/bin"
152 tar xf distribution/archives/no-jdk-linux-tar/build/distributions/opensearch-min-$pkgver-no-jdk-linux-x64.tar.gz \
153 --strip 1 -C "${pkgdir}/usr/share/opensearch"
154 rm -r "${pkgdir}"/usr/share/opensearch/logs
156 install -dm755 "${pkgdir}/etc"
157 mv "${pkgdir}/usr/share/opensearch/config" "${pkgdir}/etc/opensearch"
158 chmod 2755 "${pkgdir}/etc/opensearch/"{,jvm.options.d}
159 chmod -R 644 "${pkgdir}/etc/opensearch/"{jvm.options,log4j2.properties}
160 chmod 640 "${pkgdir}/etc/opensearch/opensearch.yml" # Might contain sensitive information
162 ln -sT "/usr/share/opensearch/bin/opensearch" "${pkgdir}/usr/bin/opensearch"
163 for b in opensearch-keystore opensearch-node opensearch-plugin opensearch-shard opensearch-upgrade; do
164 ln -sT "/usr/share/opensearch/bin/${b}" "${pkgdir}/usr/bin/${b}"
165 sed 's|"`dirname "$0"`"|/usr/share/opensearch/bin|' -i "${pkgdir}/usr/share/opensearch/bin/${b}"
168 ln -s /etc/opensearch "${pkgdir}/usr/share/opensearch/config"
169 ln -s /var/log/opensearch "${pkgdir}/usr/share/opensearch/logs"
170 ln -s /var/lib/opensearch "${pkgdir}/usr/share/opensearch/data"
172 install -Dm644 "$srcdir"/opensearch.service "${pkgdir}/usr/lib/systemd/system/opensearch.service"
173 install -Dm644 "$srcdir"/opensearch@.service "${pkgdir}/usr/lib/systemd/system/opensearch@.service"
174 install -Dm644 "$srcdir"/opensearch-keystore.service "${pkgdir}/usr/lib/systemd/system/opensearch-keystore.service"
175 install -Dm644 "$srcdir"/opensearch-keystore@.service "${pkgdir}/usr/lib/systemd/system/opensearch-keystore@.service"
176 install -Dm644 "$srcdir"/opensearch-user.conf "${pkgdir}/usr/lib/sysusers.d/opensearch.conf"
177 install -Dm644 "$srcdir"/opensearch-tmpfile.conf "${pkgdir}/usr/lib/tmpfiles.d/opensearch.conf"
178 install -Dm644 "$srcdir"/opensearch-sysctl.conf "${pkgdir}/usr/lib/sysctl.d/opensearch.conf"
179 install -Dm644 "$srcdir"/opensearch.default "${pkgdir}/etc/default/opensearch"
181 cp -r distribution/build/outputs/systemd/modules/systemd "${pkgdir}/usr/share/opensearch/modules/"
183 sed -i "2iJAVA_HOME=/usr/lib/jvm/java-${_jrever}-openjdk" "${pkgdir}/usr/share/opensearch/bin/opensearch-env"
185 # Since this warning only affects official OpenSearch releases we can remove it on our end
186 sed -i 's/echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2/:/g' "${pkgdir}/usr/share/opensearch/bin/opensearch-env"
188 install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
194 install -dm755 "${pkgdir}/usr/share/opensearch/plugins/${plugin}"
195 install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
197 cd "${pkgdir}/usr/share/opensearch/plugins/${plugin}"
198 unzip "${srcdir}/OpenSearch-${pkgver}/plugins/${plugin}/build/distributions/${plugin}-${pkgver}.zip"
200 mv LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
201 mv NOTICE.txt "${pkgdir}/usr/share/licenses/${pkgname}/NOTICE.txt"
204 package_opensearch-analysis-icu-plugin() {
205 pkgdesc="The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding ICU-related analysis components."
206 depends=("opensearch=${pkgver}")
207 _package_plugin analysis-icu
210 package_opensearch-analysis-kuromoji-plugin() {
211 pkgdesc="The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into opensearch."
212 depends=("opensearch=${pkgver}")
213 _package_plugin analysis-kuromoji
216 package_opensearch-analysis-nori-plugin() {
217 pkgdesc="The Korean (nori) Analysis plugin integrates Lucene nori analysis module into opensearch."
218 depends=("opensearch=${pkgver}")
219 _package_plugin analysis-nori
222 package_opensearch-analysis-phonetic-plugin() {
223 pkgdesc="The Phonetic Analysis plugin integrates phonetic token filter analysis with opensearch."
224 depends=("opensearch=${pkgver}")
225 _package_plugin analysis-phonetic
228 package_opensearch-analysis-smartcn-plugin() {
229 pkgdesc="Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into opensearch."
230 depends=("opensearch=${pkgver}")
231 _package_plugin analysis-smartcn
234 package_opensearch-analysis-stempel-plugin() {
235 pkgdesc="The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into opensearch."
236 depends=("opensearch=${pkgver}")
237 _package_plugin analysis-stempel
240 package_opensearch-analysis-ukrainian-plugin() {
241 pkgdesc="The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into opensearch."
242 depends=("opensearch=${pkgver}")
243 _package_plugin analysis-ukrainian
246 package_opensearch-discovery-azure-classic-plugin() {
247 pkgdesc="The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism"
248 depends=("opensearch=${pkgver}")
249 _package_plugin discovery-azure-classic
252 package_opensearch-discovery-ec2-plugin() {
253 pkgdesc="The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism."
254 depends=("opensearch=${pkgver}")
255 _package_plugin discovery-ec2
258 package_opensearch-discovery-gce-plugin() {
259 pkgdesc="The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism."
260 depends=("opensearch=${pkgver}")
261 _package_plugin discovery-gce
264 package_opensearch-ingest-attachment-plugin() {
265 pkgdesc="Ingest processor that uses Apache Tika to extract contents"
266 depends=("opensearch=${pkgver}")
267 _package_plugin ingest-attachment
270 package_opensearch-mapper-annotated-text-plugin() {
271 pkgdesc="The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index."
272 depends=("opensearch=${pkgver}")
273 _package_plugin mapper-annotated-text
276 package_opensearch-mapper-murmur3-plugin() {
277 pkgdesc="The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index."
278 depends=("opensearch=${pkgver}")
279 _package_plugin mapper-murmur3
282 package_opensearch-mapper-size-plugin() {
283 pkgdesc="The Mapper Size plugin allows document to record their uncompressed size at index time."
284 depends=("opensearch=${pkgver}")
285 _package_plugin mapper-size
288 package_opensearch-repository-azure-plugin() {
289 pkgdesc="The Azure Repository plugin adds support for Azure storage repositories."
290 depends=("opensearch=${pkgver}")
291 _package_plugin repository-azure
294 package_opensearch-repository-gcs-plugin() {
295 pkgdesc="The GCS repository plugin adds Google Cloud Storage support for repositories."
296 depends=("opensearch=${pkgver}")
297 _package_plugin repository-gcs
300 package_opensearch-repository-hdfs-plugin() {
301 pkgdesc="The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories."
302 depends=("opensearch=${pkgver}")
303 _package_plugin repository-hdfs
306 package_opensearch-repository-s3-plugin() {
307 pkgdesc="The S3 repository plugin adds S3 repositories"
308 depends=("opensearch=${pkgver}")
309 _package_plugin repository-s3
312 package_opensearch-store-smb-plugin() {
313 pkgdesc="The Store SMB plugin adds support for SMB stores."
314 depends=("opensearch=${pkgver}")
315 _package_plugin store-smb
318 package_opensearch-transport-nio-plugin() {
319 pkgdesc="The nio transport."
320 depends=("opensearch=${pkgver}")
321 _package_plugin transport-nio