Skip to content

Commit ae21cfe

Browse files
committed
Add OpenSearch analysis-icu plugin
1 parent 9daddd3 commit ae21cfe

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build OpenSearch ICU analysis plugin RPMs
2+
3+
env:
4+
package: opensearch-analysis-icu
5+
arch: noarch
6+
repo: release
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- develop
13+
- 'r/*'
14+
paths:
15+
- oc.version
16+
- .github/workflows/build-opensearch-plugin-analysis-icu.yml+
17+
- rpmbuild/SPECS/opensearch-analysis-icu.spec
18+
19+
jobs:
20+
build:
21+
strategy:
22+
matrix:
23+
osversion:
24+
- 8
25+
- 9
26+
outputs:
27+
oc-version: ${{ steps.version.outputs.version }}
28+
arch: ${{ env.arch}}
29+
repo: ${{ env.repo }}
30+
name: build (el${{ matrix.osversion }})
31+
runs-on: ubuntu-latest
32+
container:
33+
image: docker.io/lkiesow/opencast-rpmbuild:el${{ matrix.osversion }}-oc16
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- id: version
38+
run: echo "version=$(cat oc.version)" >> $GITHUB_OUTPUT
39+
40+
- name: mimic rpmdev-setuptree
41+
working-directory: rpmbuild
42+
run: |
43+
ln -s "$(pwd)" ~/rpmbuild
44+
45+
- name: download sources
46+
working-directory: rpmbuild/SPECS
47+
run: |
48+
spectool -g -R ${{ env.package }}.spec
49+
50+
- name: build rpm
51+
working-directory: rpmbuild/SPECS
52+
run: |
53+
rpmbuild -ba ${{ env.package }}.spec
54+
55+
- name: list rpms
56+
working-directory: rpmbuild/RPMS/${{ env.arch }}
57+
run: |
58+
du -hs ./*.rpm
59+
60+
- name: prepare gpg
61+
env:
62+
GPG_KEY: ${{ secrets.GPG_KEY_OC18 }}
63+
run: |
64+
echo "${GPG_KEY}" | gpg --import
65+
echo '%_gpg_name [email protected]' >> ~/.rpmmacros
66+
67+
- name: sign rpms
68+
working-directory: rpmbuild/RPMS/${{ env.arch }}
69+
run: |
70+
rpmsign --addsign *.rpm
71+
72+
- name: configure s3cmd
73+
env:
74+
S3_HOST: ${{ secrets.S3_HOST }}
75+
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
76+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
77+
run: |
78+
echo "host_base = ${S3_HOST}" > "$HOME/.s3cfg"
79+
echo "host_bucket = ${S3_HOST}" >> "$HOME/.s3cfg"
80+
echo "bucket_location = us-east-1" >> "$HOME/.s3cfg"
81+
echo "use_https = True" >> "$HOME/.s3cfg"
82+
echo "access_key = ${S3_ACCESS_KEY}" >> "$HOME/.s3cfg"
83+
echo "secret_key = ${S3_SECRET_KEY}" >> "$HOME/.s3cfg"
84+
echo "signature_v2 = False" >> "$HOME/.s3cfg"
85+
86+
- name: publish repository rpm
87+
working-directory: rpmbuild/RPMS/${{ env.arch }}
88+
run: |
89+
s3cmd put -P *.rpm "s3://opencast-pkg/rpms/${{ env.repo }}/el/${{ matrix.osversion }}/oc-${{ steps.version.outputs.version }}/${{ env.arch }}/"
90+
91+
createrepo:
92+
uses: opencast/opencast-rpmbuild/.github/workflows/createrepo.yml@develop
93+
needs: build
94+
strategy:
95+
matrix:
96+
os-version:
97+
- 8
98+
- 9
99+
with:
100+
oc-version: ${{ needs.build.outputs.oc-version }}
101+
os-version: ${{ matrix.os-version }}
102+
arch: ${{ needs.build.outputs.arch }}
103+
repo: ${{ needs.build.outputs.repo }}
104+
secrets:
105+
S3_HOST: ${{ secrets.S3_HOST }}
106+
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
107+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
%global _enable_debug_package 0
2+
%global debug_package %{nil}
3+
%global __os_install_post %{nil}
4+
5+
%global plugin_name analysis-icu
6+
7+
Name: opensearch-plugin-%{plugin_name}
8+
Summary: OpenSearch ICU analysis plugin
9+
Version: 1.3.17
10+
Release: 1%{?dist}
11+
License: Apache-2.0
12+
13+
Source0: https://artifacts.opensearch.org/releases/plugins/%{plugin_name}/%{version}/%{plugin_name}-%{version}.zip
14+
URL: https://github.com/opensearch-project/OpenSearch/tree/main/plugins
15+
BuildRoot: %{_tmppath}/%{name}-root
16+
17+
BuildArch: noarch
18+
19+
BuildRequires: unzip
20+
Requires: opensearch = %{version}
21+
22+
23+
%description
24+
The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding extended Unicode support using the
25+
ICU libraries, including better analysis of Asian languages, Unicode normalization, Unicode-aware case folding,
26+
collation support, and transliteration.
27+
28+
29+
%prep
30+
unzip -o %{SOURCE0}
31+
32+
33+
%build
34+
35+
36+
%install
37+
rm -rf %{buildroot}
38+
39+
install -p -d -m 0755 %{buildroot}%{_datadir}/opensearch/plugins/%{plugin_name}
40+
install -p -m 0644 *.jar *.properties %{buildroot}%{_datadir}/opensearch/plugins/%{plugin_name}/
41+
42+
%clean
43+
rm -rf %{buildroot}
44+
45+
46+
%files
47+
%defattr(-,root,root,-)
48+
%doc NOTICE.txt
49+
%license LICENSE.txt
50+
%{_datadir}/opensearch/plugins/%{plugin_name}
51+
52+
53+
%changelog
54+
* Sun Nov 17 2024 Lars Kiesow <[email protected]> - 1.3.17-1
55+
- Initial build
56+

0 commit comments

Comments
 (0)