Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec file for rpms #65

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions examples/rpms/spire.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
##############################################################################
#
# 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, a terrible abomination, a crime against nature, and more. We
# 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.
#
##############################################################################

Summary: SPIRE components
Name: spire-common
Version: 1.9.4
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
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

%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

%setup -c

%build

%install

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}"

%clean
rm -rf %{buildroot}

%files
/usr/lib/systemd/system/*.target

%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
Loading