From e59f38bf2586244e5c1dd90d493abda11ed86499 Mon Sep 17 00:00:00 2001 From: POIROTTE Francois Date: Thu, 22 May 2025 18:08:49 +0200 Subject: [PATCH] Make dependency on emacs optional This is based on the change already in c9s: https://gitlab.com/redhat/centos-stream/rpms/protobuf/-/commit/32a0119716d009eac689cb05ee46ea26378badfe Resolves: RHEL-93236 Signed-off-by: POIROTTE Francois --- protobuf.spec | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/protobuf.spec b/protobuf.spec index 8cadbaf..7fbb363 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -9,6 +9,8 @@ %else %bcond_without java %endif +# Build -emacs subpackage +%bcond_without emacs #global rcver rc2 @@ -19,7 +21,7 @@ Name: protobuf # “patch” updates of protobuf. Version: 3.19.6 %global so_version 30 -Release: 11%{?dist} +Release: 12%{?dist} # The entire source is BSD-3-Clause, except the following files, which belong # to the build system; are unpackaged maintainer utility scripts; or are used @@ -101,7 +103,9 @@ BuildRequires: libtool BuildRequires: make BuildRequires: gcc-c++ +%if %{with emacs} BuildRequires: emacs +%endif BuildRequires: zlib-devel %if %{with java} @@ -267,6 +271,7 @@ Protocol Buffer BOM POM. %endif %endif +%if %{with emacs} %package emacs Summary: Emacs mode for Google Protocol Buffers descriptions BuildArch: noarch @@ -276,6 +281,7 @@ Obsoletes: protobuf-emacs-el < 3.6.1-4 %description emacs This package contains syntax highlighting for Google Protocol Buffers descriptions in the Emacs editor. +%endif %prep %setup -q -n protobuf-%{version}%{?rcver} -a 3 @@ -352,7 +358,9 @@ export MAVEN_OPTS=-Xmx1024m %endif %endif +%if %{with emacs} %{_emacs_bytecompile} editors/protobuf-mode.el +%endif %check @@ -383,11 +391,13 @@ install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/synt %endif %endif +%if %{with emacs} mkdir -p %{buildroot}%{_emacs_sitelispdir}/protobuf install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/protobuf install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/protobuf mkdir -p %{buildroot}%{_emacs_sitestartdir} install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} +%endif %files %doc CHANGES.txt CONTRIBUTORS.txt README.md @@ -409,10 +419,12 @@ install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} %{_libdir}/pkgconfig/protobuf.pc %doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md +%if %{with emacs} %files emacs %license LICENSE %{_emacs_sitelispdir}/protobuf/ %{_emacs_sitestartdir}/protobuf-init.el +%endif %files lite %license LICENSE @@ -473,6 +485,10 @@ install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} %changelog +* Thu May 22 2025 François Poirotte - 3.19.6-12 +- Copy patch from c9s to make emacs dependency optional + Resolves: RHEL-93236 + * Tue Oct 29 2024 Troy Dawson - 3.19.6-11 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018