From 610735c228426ccfe333ddcf9ed53f9c61f31d47 Mon Sep 17 00:00:00 2001 From: Erik Lax Date: Sat, 8 Oct 2022 00:00:33 +0200 Subject: [PATCH] Register functions to the plugins module namespace --- .devcontainer/Dockerfile | 2 +- CMakeLists.txt | 6 +++--- README.md | 1 + build/centos-7/Dockerfile | 4 ++-- build/centos-8/Dockerfile | 4 ++-- build/docker-compose.yaml | 18 +++++++++--------- build/ubuntu-18.04/Dockerfile | 4 ++-- build/ubuntu-20.04/Dockerfile | 4 ++-- build/ubuntu-22.04/Dockerfile | 2 +- time-rfc2822.go | 1 + 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 50d605d..64b0b86 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get install -y apt-transport-https RUN wget -qO - https://raw.githubusercontent.com/halon/changelog/master/pgp-keys/7F0A73B5.asc | apt-key add - RUN echo "deb https://repo.halon.io/ focal stable" >> /etc/apt/sources.list.d/halon.list RUN echo "machine repo.halon.io login ${HALON_REPO_USER} password ${HALON_REPO_PASS}" >> /etc/apt/auth.conf -RUN apt-get update && apt-get install -y halon=5.8.3 +RUN apt-get update && apt-get install -y halon=5.10.0 RUN /usr/bin/install -d /var/run/halon ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH diff --git a/CMakeLists.txt b/CMakeLists.txt index be4b0cf..13cc79b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0) -PROJECT("time-rfc2822" VERSION 1.0.0) +PROJECT("time-rfc2822" VERSION 1.1.0) # RPM/DEB and CENTOS7/CENTOS8/UBU1804/UBU2004/UBU2204 IF (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/OSRELEASE.txt") @@ -59,12 +59,12 @@ SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/halon") IF (CPACK_GENERATOR MATCHES "DEB") SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "halon (>= 5.8)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "halon (>= 5.10)") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/postrm") ENDIF() IF (CPACK_GENERATOR MATCHES "RPM") SET(CPACK_RPM_PACKAGE_AUTOREQPROV ON) - SET(CPACK_RPM_PACKAGE_REQUIRES "halon >= 5.8") + SET(CPACK_RPM_PACKAGE_REQUIRES "halon >= 5.10") SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst") SET(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postrm") ENDIF() diff --git a/README.md b/README.md index d98a009..d7eb639 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ On success it will return a string that contains the time in RFC2822 format. On **Example** ``` +import { time_rfc2822 } from "extras://time-rfc2822"; echo time_rfc2822(); echo time_rfc2822(1645012689.519825); echo time_rfc2822(time(), "Europe/Stockholm"); diff --git a/build/centos-7/Dockerfile b/build/centos-7/Dockerfile index 939a985..43fd029 100644 --- a/build/centos-7/Dockerfile +++ b/build/centos-7/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM --platform=linux/amd64 centos:7 LABEL org.opencontainers.image.authors="support@halon.io" ARG HALON_REPO_USER @@ -12,7 +12,7 @@ RUN echo "baseurl=https://${HALON_REPO_USER}:${HALON_REPO_PASS}@repo.halon.io/di RUN echo "gpgcheck=1" >> /etc/yum.repos.d/Halon.repo RUN echo "gpgkey=https://raw.githubusercontent.com/halon/changelog/master/pgp-keys/7F0A73B5.asc" >> /etc/yum.repos.d/Halon.repo RUN echo "enabled=1" >> /etc/yum.repos.d/Halon.repo -RUN yum install -y halon-5.8.0 +RUN yum install -y halon-5.10.0 RUN yum install -y centos-release-scl RUN yum install -y devtoolset-8 diff --git a/build/centos-8/Dockerfile b/build/centos-8/Dockerfile index f41e0f9..6b7245a 100644 --- a/build/centos-8/Dockerfile +++ b/build/centos-8/Dockerfile @@ -1,4 +1,4 @@ -FROM rockylinux/rockylinux:8 +FROM --platform=linux/amd64 rockylinux/rockylinux:8 LABEL org.opencontainers.image.authors="support@halon.io" ARG HALON_REPO_USER @@ -12,7 +12,7 @@ RUN echo "baseurl=https://${HALON_REPO_USER}:${HALON_REPO_PASS}@repo.halon.io/di RUN echo "gpgcheck=1" >> /etc/yum.repos.d/Halon.repo RUN echo "gpgkey=https://raw.githubusercontent.com/halon/changelog/master/pgp-keys/7F0A73B5.asc" >> /etc/yum.repos.d/Halon.repo RUN echo "enabled=1" >> /etc/yum.repos.d/Halon.repo -RUN yum install -y halon-5.8.0 +RUN yum install -y halon-5.10.0 RUN yum install -y cmake3 make gcc-c++ rpm-build curl diff --git a/build/docker-compose.yaml b/build/docker-compose.yaml index b8cbaa9..e8f0200 100644 --- a/build/docker-compose.yaml +++ b/build/docker-compose.yaml @@ -1,13 +1,13 @@ services: - # ubuntu-22.04: - # build: - # context: ./ubuntu-22.04 - # dockerfile: ./Dockerfile - # args: - # HALON_REPO_USER: ${HALON_REPO_USER} - # HALON_REPO_PASS: ${HALON_REPO_PASS} - # volumes: - # - ../:/plugin + ubuntu-22.04: + build: + context: ./ubuntu-22.04 + dockerfile: ./Dockerfile + args: + HALON_REPO_USER: ${HALON_REPO_USER} + HALON_REPO_PASS: ${HALON_REPO_PASS} + volumes: + - ../:/plugin ubuntu-20.04: build: context: ./ubuntu-20.04 diff --git a/build/ubuntu-18.04/Dockerfile b/build/ubuntu-18.04/Dockerfile index d410395..b63a190 100644 --- a/build/ubuntu-18.04/Dockerfile +++ b/build/ubuntu-18.04/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM --platform=linux/amd64 ubuntu:18.04 LABEL org.opencontainers.image.authors="support@halon.io" ARG HALON_REPO_USER @@ -12,7 +12,7 @@ RUN apt-get install -y apt-transport-https RUN wget -qO - https://raw.githubusercontent.com/halon/changelog/master/pgp-keys/7F0A73B5.asc | apt-key add - RUN echo "deb https://repo.halon.io/ bionic stable" >> /etc/apt/sources.list.d/halon.list RUN echo "machine repo.halon.io login ${HALON_REPO_USER} password ${HALON_REPO_PASS}" >> /etc/apt/auth.conf -RUN apt-get update && apt-get install -y halon=5.8.0 +RUN apt-get update && apt-get install -y halon=5.10.0 RUN apt-get install -y build-essential cmake git curl diff --git a/build/ubuntu-20.04/Dockerfile b/build/ubuntu-20.04/Dockerfile index 9ac625c..394abe2 100644 --- a/build/ubuntu-20.04/Dockerfile +++ b/build/ubuntu-20.04/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM --platform=linux/amd64 ubuntu:20.04 LABEL org.opencontainers.image.authors="support@halon.io" ARG HALON_REPO_USER @@ -12,7 +12,7 @@ RUN apt-get install -y apt-transport-https RUN wget -qO - https://raw.githubusercontent.com/halon/changelog/master/pgp-keys/7F0A73B5.asc | apt-key add - RUN echo "deb https://repo.halon.io/ focal stable" >> /etc/apt/sources.list.d/halon.list RUN echo "machine repo.halon.io login ${HALON_REPO_USER} password ${HALON_REPO_PASS}" >> /etc/apt/auth.conf -RUN apt-get update && apt-get install -y halon=5.8.0 +RUN apt-get update && apt-get install -y halon=5.10.0 RUN apt-get install -y build-essential cmake git curl diff --git a/build/ubuntu-22.04/Dockerfile b/build/ubuntu-22.04/Dockerfile index 143935e..8093acc 100644 --- a/build/ubuntu-22.04/Dockerfile +++ b/build/ubuntu-22.04/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM --platform=linux/amd64 ubuntu:22.04 LABEL org.opencontainers.image.authors="support@halon.io" ARG HALON_REPO_USER diff --git a/time-rfc2822.go b/time-rfc2822.go index 370279f..8542521 100644 --- a/time-rfc2822.go +++ b/time-rfc2822.go @@ -109,5 +109,6 @@ func time_rfc2822(hhc *C.HalonHSLContext, args *C.HalonHSLArguments, ret *C.Halo func Halon_hsl_register(hhrc *C.HalonHSLRegisterContext) C.bool { time_rfc2822_cs := C.CString("time_rfc2822") C.HalonMTA_hsl_register_function(hhrc, time_rfc2822_cs, nil) + C.HalonMTA_hsl_module_register_function(hhrc, time_rfc2822_cs, nil) return true }