Split -extras subpackage

This commit is contained in:
Christian Tosta
2025-08-04 11:39:52 -03:00
parent cddcb9ab39
commit 90a07c90e6
4 changed files with 43 additions and 12 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ build/
CMakeCache.txt CMakeCache.txt
dist/ dist/
temp/

View File

@@ -25,6 +25,7 @@ set(SourceIgnoreFiles
"cmake-build*" "cmake-build*"
"cmake_install.cmake" "cmake_install.cmake"
"dist/" "dist/"
"temp/"
) )
# Escape any '.' and '/' characters # Escape any '.' and '/' characters
@@ -62,13 +63,19 @@ configure_file(
if(BUILD_RPMS) if(BUILD_RPMS)
execute_process( execute_process(
COMMAND bash -c COMMAND cat "${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt"
"LANG=C DATE=$(date +'%a %b %d %Y'); \
echo \"* $DATE %{packager} - ${PROJECT_VERSION}-1%{?dist}\"; \
echo \"- This is an automatically built package (See our Git URL for more info).\"; \
"
OUTPUT_VARIABLE CPACK_RPM_CHANGELOG OUTPUT_VARIABLE CPACK_RPM_CHANGELOG
) )
execute_process(
COMMAND bash -c
"head -1 \"${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt\" \
| grep -iPo '.*${CPACK_PACKAGE_VERSION}-\\K[\\d]' \
| tr -d '\\n' \
"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE
)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/packaging/pkg.spec.in" CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/packaging/pkg.spec.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.spec" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.spec"
@ONLY @ONLY

2
changelog.txt Normal file
View File

@@ -0,0 +1,2 @@
* Fri Jul 04 2025 Christian Tosta <7252968+christiantosta@users.noreply.github.com> 2025.07.04-1
- This is an automatically built package (See our Git URL for more info).

View File

@@ -6,10 +6,10 @@
Name: ca-certificates-brazil Name: ca-certificates-brazil
Version: @CPACK_PACKAGE_VERSION@ Version: @CPACK_PACKAGE_VERSION@
Release: %{autorelease} Release: @CPACK_RPM_PACKAGE_RELEASE@%{?dist}
Summary: The ICP-Brasil root certificate bundle Summary: The ICP-Brasil root certificate bundle
License: Public Domain License: MIT AND Public Domain
URL: https://www.gov.br/iti/pt-br/assuntos/certificado-digital URL: https://www.gov.br/iti/pt-br/assuntos/certificado-digital
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
@@ -20,6 +20,9 @@ BuildRequires: %{_bindir}/mktemp
BuildRequires: %{_bindir}/unzip BuildRequires: %{_bindir}/unzip
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
Provides: ca-certificates(ICP-Brasil) = %{version}-%{release}
Provides: config(ICP-Brasil) = %{version}-%{release}
Requires: %{name}-extras
%description %description
The Brazilian Public Key Infrastructure - ICP-Brasil is a hierarchical chain The Brazilian Public Key Infrastructure - ICP-Brasil is a hierarchical chain
@@ -36,24 +39,42 @@ chain, supervise and audit the processes.
%{cmake} %{cmake}
%build %build
BUILD_SHARED_LIBS= \
CMAKE_CXX_FLAGS_RELEASE= \
CMAKE_C_FLAGS_RELEASE= \
CMAKE_Fortran_FLAGS_RELEASE= \
CMAKE_INSTALL_DO_STRIP= \
CMAKE_INSTALL_FULL_SBINDIR= \
CMAKE_INSTALL_SBINDIR= \
INCLUDE_INSTALL_DIR= \
LIB_INSTALL_DIR= \
SHARE_INSTALL_PREFIX= \
SYSCONF_INSTALL_DIR= \
%{cmake_build} %{cmake_build}
%install %install
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
%{cmake_install} %{cmake_install}
%files %files
%doc %{_datadir}/doc/%{name}/*.pdf %doc %{_datadir}/doc/%{name}/*.pdf
%doc %{_datadir}/doc/%{name}/README.md %doc %{_datadir}/doc/%{name}/README.md
%license %{_datadir}/doc/%{name}/LICENSE %license %{_datadir}/doc/%{name}/LICENSE
%{_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 %{_datadir}/pki/ca-trust-source/anchors/icp-brasil-ca-bundle.crt
%post -p %{_bindir}/update-ca-trust %post -p %{_bindir}/update-ca-trust
%postun -p %{_bindir}/update-ca-trust %postun -p %{_bindir}/update-ca-trust
%package extras
Summary: Extra Root and Intermediate certificates used by ICP-Brasil
%description extras
%{summary}
%files extras
%license %{_datadir}/doc/%{name}/LICENSE
%{_datadir}/pki/ca-trust-source/anchors/*.crt
%exclude %{_datadir}/pki/ca-trust-source/anchors/icp-brasil-ca-bundle.crt
%post extras -p %{_bindir}/update-ca-trust
%postun extras -p %{_bindir}/update-ca-trust
%changelog %changelog
@CPACK_RPM_CHANGELOG@ @CPACK_RPM_CHANGELOG@