Skip to content

Commit

Permalink
Add OpenSearch analysis-icu plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
lkiesow committed Nov 17, 2024
1 parent 9daddd3 commit ae21cfe
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/build-opensearch-plugin-analysis-icu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build OpenSearch ICU analysis plugin RPMs

env:
package: opensearch-analysis-icu
arch: noarch
repo: release

on:
workflow_dispatch:
push:
branches:
- develop
- 'r/*'
paths:
- oc.version
- .github/workflows/build-opensearch-plugin-analysis-icu.yml+
- rpmbuild/SPECS/opensearch-analysis-icu.spec

jobs:
build:
strategy:
matrix:
osversion:
- 8
- 9
outputs:
oc-version: ${{ steps.version.outputs.version }}
arch: ${{ env.arch}}
repo: ${{ env.repo }}
name: build (el${{ matrix.osversion }})
runs-on: ubuntu-latest
container:
image: docker.io/lkiesow/opencast-rpmbuild:el${{ matrix.osversion }}-oc16
steps:
- uses: actions/checkout@v4

- id: version
run: echo "version=$(cat oc.version)" >> $GITHUB_OUTPUT

- name: mimic rpmdev-setuptree
working-directory: rpmbuild
run: |
ln -s "$(pwd)" ~/rpmbuild
- name: download sources
working-directory: rpmbuild/SPECS
run: |
spectool -g -R ${{ env.package }}.spec
- name: build rpm
working-directory: rpmbuild/SPECS
run: |
rpmbuild -ba ${{ env.package }}.spec
- name: list rpms
working-directory: rpmbuild/RPMS/${{ env.arch }}
run: |
du -hs ./*.rpm
- name: prepare gpg
env:
GPG_KEY: ${{ secrets.GPG_KEY_OC18 }}
run: |
echo "${GPG_KEY}" | gpg --import
echo '%_gpg_name [email protected]' >> ~/.rpmmacros
- name: sign rpms
working-directory: rpmbuild/RPMS/${{ env.arch }}
run: |
rpmsign --addsign *.rpm
- name: configure s3cmd
env:
S3_HOST: ${{ secrets.S3_HOST }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run: |
echo "host_base = ${S3_HOST}" > "$HOME/.s3cfg"
echo "host_bucket = ${S3_HOST}" >> "$HOME/.s3cfg"
echo "bucket_location = us-east-1" >> "$HOME/.s3cfg"
echo "use_https = True" >> "$HOME/.s3cfg"
echo "access_key = ${S3_ACCESS_KEY}" >> "$HOME/.s3cfg"
echo "secret_key = ${S3_SECRET_KEY}" >> "$HOME/.s3cfg"
echo "signature_v2 = False" >> "$HOME/.s3cfg"
- name: publish repository rpm
working-directory: rpmbuild/RPMS/${{ env.arch }}
run: |
s3cmd put -P *.rpm "s3://opencast-pkg/rpms/${{ env.repo }}/el/${{ matrix.osversion }}/oc-${{ steps.version.outputs.version }}/${{ env.arch }}/"
createrepo:
uses: opencast/opencast-rpmbuild/.github/workflows/createrepo.yml@develop
needs: build
strategy:
matrix:
os-version:
- 8
- 9
with:
oc-version: ${{ needs.build.outputs.oc-version }}
os-version: ${{ matrix.os-version }}
arch: ${{ needs.build.outputs.arch }}
repo: ${{ needs.build.outputs.repo }}
secrets:
S3_HOST: ${{ secrets.S3_HOST }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
56 changes: 56 additions & 0 deletions rpmbuild/SPECS/opensearch-analysis-icu.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post %{nil}

%global plugin_name analysis-icu

Name: opensearch-plugin-%{plugin_name}
Summary: OpenSearch ICU analysis plugin
Version: 1.3.17
Release: 1%{?dist}
License: Apache-2.0

Source0: https://artifacts.opensearch.org/releases/plugins/%{plugin_name}/%{version}/%{plugin_name}-%{version}.zip
URL: https://github.com/opensearch-project/OpenSearch/tree/main/plugins
BuildRoot: %{_tmppath}/%{name}-root

BuildArch: noarch

BuildRequires: unzip
Requires: opensearch = %{version}


%description
The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding extended Unicode support using the
ICU libraries, including better analysis of Asian languages, Unicode normalization, Unicode-aware case folding,
collation support, and transliteration.


%prep
unzip -o %{SOURCE0}


%build


%install
rm -rf %{buildroot}

install -p -d -m 0755 %{buildroot}%{_datadir}/opensearch/plugins/%{plugin_name}
install -p -m 0644 *.jar *.properties %{buildroot}%{_datadir}/opensearch/plugins/%{plugin_name}/

%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc NOTICE.txt
%license LICENSE.txt
%{_datadir}/opensearch/plugins/%{plugin_name}


%changelog
* Sun Nov 17 2024 Lars Kiesow <[email protected]> - 1.3.17-1
- Initial build

0 comments on commit ae21cfe

Please sign in to comment.