From 75e6bff750d0888660fd6786f02d4ed6cec37b71 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 06:17:48 -0700 Subject: [PATCH 01/10] Add spec file for rpms Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 74 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 examples/rpms/spire.spec diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec new file mode 100644 index 0000000..a090543 --- /dev/null +++ b/examples/rpms/spire.spec @@ -0,0 +1,74 @@ +############################################################################## +# +# To you, dear reader: +# +# If you are a normal user, we recommend not reading further. Its probably not +# the file your looking for. +# +# If you are looking at using this file as a base for your own work, please +# don't. It is a horrible example. Please look elsewhere, +# +# If you are a package maintainer, please read on. We recognize this spec file +# is blasphemous, an terrible abomination, a crime against nature, and more. We +# regret needing to produce it in order to attract enough users to find you. We +# beseech thee, kind and generous package maintainer, please help us mend our +# wicked ways by joining is us and help us produce proper packaging. Your our +# only hope. +# +############################################################################## + +Summary: SPIRE components +Name: spire-common +Version: 1.9.4 +Release: 1 +Group: Applications/Internet +License: Apache-2.0 +URL: https://spiffe.io +Source0: https://github.com/spiffe/spire/releases/download/v%{version}/spire-%{version}-linux-amd64-musl.tar.gz + +%description +SPIRE Common + +%package -n spire-server +Summary: SPIRE Server +Requires: spire-common +%description -n spire-server +SPIRE Server + +%package -n spire-agent +Summary: SPIRE Agent +Requires: spire-common +%description -n spire-agent +SPIRE Agent + +%global debug_package %{nil} + +%prep + +%setup -c + +%build + +%install + +mkdir -p "%{buildroot}/bin" +cp "spire-%{version}"/bin/* "%{buildroot}/bin" +git clone https://github.com/kfox1111/spire-examples +cd spire-examples +git checkout systemd +cd examples/systemd +make install DESTDIR="%{buildroot}" + +%clean +rm -rf %{buildroot} + +%files +/usr/lib/systemd/system/*.target + +%files -n spire-server +/usr/lib/systemd/system/spire-server@.service +/bin/spire-server + +%files -n spire-agent +/usr/lib/systemd/system/spire-agent@.service +/bin/spire-agent From 4b3032267de91d6565f73d26a81adcbf327cca83 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 06:34:51 -0700 Subject: [PATCH 02/10] More config Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index a090543..d395865 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -35,12 +35,35 @@ Requires: spire-common %description -n spire-server SPIRE Server +%preun -n spire-server +%if 0%{?suse_version} +%service_del_preun spire-server@\*.service spire-server.target +%endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} +%systemd_preun spire-server@\*.service spire-server.target +%endif + +%postun -n spire-server +%systemd_postun spire-server@\*.service spire-server.target + %package -n spire-agent Summary: SPIRE Agent Requires: spire-common %description -n spire-agent SPIRE Agent +%preun -n spire-agent +%if 0%{?suse_version} +%service_del_preun spire-agent@\*.service spire-agent.target +%endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} +%systemd_preun spire-agent@\*.service spire-agent.target +%endif + +%postun -n spire-agent +%systemd_postun spire-agent@\*.service spire-agent.target + +%global _missing_build_ids_terminate_build 0 %global debug_package %{nil} %prep From 99009988545443e4d45d8ce3e1cfb0aa14be6079 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 06:39:27 -0700 Subject: [PATCH 03/10] Add config files Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index d395865..ffa62e6 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -91,7 +91,9 @@ rm -rf %{buildroot} %files -n spire-server /usr/lib/systemd/system/spire-server@.service /bin/spire-server +%config(noreplace) /etc/spire/server/main.conf %files -n spire-agent /usr/lib/systemd/system/spire-agent@.service /bin/spire-agent +%config(noreplace) /etc/spire/agent/main.conf From ccbfcfc13c898d7289a5522af44bfb234986130d Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 06:51:25 -0700 Subject: [PATCH 04/10] Fix typo Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index ffa62e6..697b108 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -12,7 +12,7 @@ # is blasphemous, an terrible abomination, a crime against nature, and more. We # regret needing to produce it in order to attract enough users to find you. We # beseech thee, kind and generous package maintainer, please help us mend our -# wicked ways by joining is us and help us produce proper packaging. Your our +# wicked ways by joining us and help us produce proper packaging. Your our # only hope. # ############################################################################## From 401705a82443a91d71ef3830fd53265b55dc2c28 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 06:51:58 -0700 Subject: [PATCH 05/10] Fix typo Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index 697b108..9b56d7b 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -12,7 +12,7 @@ # is blasphemous, an terrible abomination, a crime against nature, and more. We # regret needing to produce it in order to attract enough users to find you. We # beseech thee, kind and generous package maintainer, please help us mend our -# wicked ways by joining us and help us produce proper packaging. Your our +# wicked ways by joining us and help us produce proper packaging. You are our # only hope. # ############################################################################## From 879d8384d375ae8c01e1c9e2d9a5946d2cbbcad9 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 07:03:46 -0700 Subject: [PATCH 06/10] Fix typo Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index 9b56d7b..7851f27 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -9,7 +9,7 @@ # don't. It is a horrible example. Please look elsewhere, # # If you are a package maintainer, please read on. We recognize this spec file -# is blasphemous, an terrible abomination, a crime against nature, and more. We +# is blasphemous, a terrible abomination, a crime against nature, and more. We # regret needing to produce it in order to attract enough users to find you. We # beseech thee, kind and generous package maintainer, please help us mend our # wicked ways by joining us and help us produce proper packaging. You are our From b3098e6869c234fdbc24cc3d2c83fbba54e5026b Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 9 Apr 2024 07:52:24 -0700 Subject: [PATCH 07/10] Fix typo Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index 7851f27..ae68b63 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -6,14 +6,14 @@ # the file your looking for. # # If you are looking at using this file as a base for your own work, please -# don't. It is a horrible example. Please look elsewhere, +# don't. It is a horrible example. Please look elsewhere. # # If you are a package maintainer, please read on. We recognize this spec file # is blasphemous, a terrible abomination, a crime against nature, and more. We -# regret needing to produce it in order to attract enough users to find you. We -# beseech thee, kind and generous package maintainer, please help us mend our -# wicked ways by joining us and help us produce proper packaging. You are our -# only hope. +# regret needing to produce it, but had to in order to attract enough users to +# find you. We beseech thee, kind and generous package maintainer, please help +# us mend our wicked ways by joining us and help us produce proper packaging. +# You are our only hope. # ############################################################################## From 4ed5c4b58f08651a2502887a989e2137f0623cbc Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Wed, 4 Dec 2024 11:37:51 -0800 Subject: [PATCH 08/10] Update examples/rpms/spire.spec Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index ae68b63..b71c586 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -76,7 +76,7 @@ SPIRE Agent mkdir -p "%{buildroot}/bin" cp "spire-%{version}"/bin/* "%{buildroot}/bin" -git clone https://github.com/kfox1111/spire-examples +git clone https://github.com/spiffe/spire-examples cd spire-examples git checkout systemd cd examples/systemd From f085049e26466932256cd5d0e62b297316959dd3 Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Thu, 5 Dec 2024 11:08:24 -0800 Subject: [PATCH 09/10] Apply suggestions from code review Signed-off-by: kfox1111 --- examples/rpms/spire.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index b71c586..5328fc2 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -19,7 +19,7 @@ Summary: SPIRE components Name: spire-common -Version: 1.9.4 +Version: 1.11.0 Release: 1 Group: Applications/Internet License: Apache-2.0 From c157342f4b85cf51cda1135834fdff4e5434bebd Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Thu, 5 Dec 2024 11:14:36 -0800 Subject: [PATCH 10/10] Systemd examples merged already Signed-off-by: Kevin Fox --- examples/rpms/spire.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/rpms/spire.spec b/examples/rpms/spire.spec index 5328fc2..00f1c49 100644 --- a/examples/rpms/spire.spec +++ b/examples/rpms/spire.spec @@ -78,7 +78,6 @@ mkdir -p "%{buildroot}/bin" cp "spire-%{version}"/bin/* "%{buildroot}/bin" git clone https://github.com/spiffe/spire-examples cd spire-examples -git checkout systemd cd examples/systemd make install DESTDIR="%{buildroot}"