From 05b3169a113c63733f3ac4ee75b79c13c533fa17 Mon Sep 17 00:00:00 2001 From: Christian Tosta Date: Fri, 18 Apr 2025 04:01:14 -0300 Subject: [PATCH] Added RPM build workflow --- .github/workflows/build-rpm.yml | 6 ++-- packaging/pkg.spec.in | 54 +++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 packaging/pkg.spec.in diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 4088a32..929f564 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -30,10 +30,10 @@ jobs: cmake --build build --target sdist - name: Copy SOURCES and SPEC file - run: | - mkdir -p ~/rpmbuild/SOURCES + run: | + VERSION=$(grep -iPo -m1 '.*CPACK_PACKAGE_VERSION [\"]*\K[\S]*[^(\"\))]' build/CPackConfig.cmake) + sed 's/__VERSION__/${VERSION}/g' packaging/pkg.spec.in > ~/rpmbuild/SPECS/ca-certificates-brazil.spec cp dist/*.src.tar.gz ~/rpmbuild/SOURCES/ - cp packaging/pkg.spec.in ~/rpmbuild/SPECS/ca-certificates-brazil.spec - name: Build RPM run: | diff --git a/packaging/pkg.spec.in b/packaging/pkg.spec.in new file mode 100644 index 0000000..dba808b --- /dev/null +++ b/packaging/pkg.spec.in @@ -0,0 +1,54 @@ +%global debug_package %{nil} +%global source_date_epoch_from_changelog 0 + +%global version __VERSION__ + +%define __openssl %{_bindir}/openssl + +Name: ca-certificates-brazil +Version: %{version} +Release: %{autorelease} +Summary: The ICP-Brasil root certificate bundle + +License: Public Domain +URL: https://www.gov.br/iti/pt-br/assuntos/certificado-digital +Source0: %{name}-%{version}.src.tar.gz + +BuildArch: noarch +BuildRequires: %{__openssl} +BuildRequires: %{_bindir}/mktemp +BuildRequires: %{_bindir}/unzip + +%description +The Brazilian Public Key Infrastructure - ICP-Brasil is a hierarchical chain +of trust that enables the issuance of digital certificates for the virtual +identification of citizens. + +It is observed that the model adopted by Brazil was single-root certification, +and the ITI, in addition to playing the role of Root Certifying Authority - Root AC, +also has the role of accrediting and discrediting the other participants in the +chain, supervise and audit the processes. + +%prep +%autosetup -c +%{cmake} + +%build +%{cmake_build} + +%install +%{__rm} -rf %{buildroot} +%{cmake_install} + + +%files +%{_datadir}/pki/ca-trust-source/anchors/isrg-root-x2.crt +%{_datadir}/pki/ca-trust-source/anchors/lets-encrypt-ca-bundle.crt +%{_datadir}/pki/ca-trust-source/anchors/icp-brasil-ca-bundle.crt + + +%post -p %{_bindir}/update-ca-trust +%postun -p %{_bindir}/update-ca-trust + +%changelog +%autochangelog