diff --git a/contrib/zhparser/Dockerfile b/contrib/zhparser/Dockerfile new file mode 100644 index 00000000..e162e718 --- /dev/null +++ b/contrib/zhparser/Dockerfile @@ -0,0 +1,19 @@ +ARG PG_VERSION +FROM quay.io/coredb/c-builder:pg${PG_VERSION} + +# Install dependency. +USER root +RUN wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2 \ + && tar xvf scws-1.2.3.tar.bz2 \ + && cd scws-1.2.3 \ + && ./configure \ + && make install \ + && cd .. \ + && rm -rf scws-1.2.3.tar.bz2 scws-1.2.3 \ + && ln -s /usr/local/lib/libscws.so /usr/lib/x86_64-linux-gnu/libscws.so + +# Clone and build the extension. +ARG EXTENSION_NAME +ARG EXTENSION_VERSION +RUN git clone --depth 1 --branch "V$(perl -E 'print shift =~ s/[.]0$//gr' "${EXTENSION_VERSION}")" https://github.com/amutu/${EXTENSION_NAME}.git \ + && make -C ${EXTENSION_NAME} diff --git a/contrib/zhparser/Trunk.toml b/contrib/zhparser/Trunk.toml new file mode 100644 index 00000000..9763c0dc --- /dev/null +++ b/contrib/zhparser/Trunk.toml @@ -0,0 +1,17 @@ +[extension] +name = "zhparser" +version = "2.2.0" +repository = "https://github.com/amutu/zhparser" +license = "PostgreSQL" +description = "PostgreSQL extension for full-text search of Chinese language." +documentation = "https://github.com/amutu/zhparser" +categories = ["search"] + +[dependencies] +apt = ["libc6"] + +[build] +postgres_version = "17" +platform = "linux/amd64" +dockerfile = "Dockerfile" +install_command = "make -C zhparser install"