From 05006abcc8cde2359721cbee66a5417e6783765a Mon Sep 17 00:00:00 2001 From: Matthew Torr Date: Thu, 26 Oct 2023 17:14:45 +0100 Subject: [PATCH] Add LICENSE file to RPMs (#267) --- packaging/rpm/Makefile | 6 +++++- packaging/rpm/SPECS/cri-dockerd.spec | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packaging/rpm/Makefile b/packaging/rpm/Makefile index 8aa5b87ca..0ad393aaa 100644 --- a/packaging/rpm/Makefile +++ b/packaging/rpm/Makefile @@ -39,7 +39,7 @@ RPMBUILD_FLAGS?=-ba\ $(SPECS) RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) -SOURCE_FILES=app.tgz cri-docker.service cri-docker.socket +SOURCE_FILES=app.tgz cri-docker.service cri-docker.socket LICENSE SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) FEDORA_RELEASES := fedora-36 fedora-35 @@ -89,3 +89,7 @@ rpmbuild/SOURCES/cri-docker.service: ../systemd/cri-docker.service rpmbuild/SOURCES/cri-docker.socket: ../systemd/cri-docker.socket mkdir -p $(@D) cp $< $@ + +rpmbuild/SOURCES/LICENSE: ../../LICENSE + mkdir -p $(@D) + cp $< $@ diff --git a/packaging/rpm/SPECS/cri-dockerd.spec b/packaging/rpm/SPECS/cri-dockerd.spec index 932fc1eb6..a5be5a1c5 100644 --- a/packaging/rpm/SPECS/cri-dockerd.spec +++ b/packaging/rpm/SPECS/cri-dockerd.spec @@ -8,6 +8,7 @@ Epoch: 3 Source0: app.tgz Source1: cri-docker.service Source2: cri-docker.socket +Source3: LICENSE Summary: A CRI interface for Docker Group: Tools/Docker License: ASL 2.0 @@ -59,6 +60,7 @@ cri-dockerd is a lightweight implementation of the CRI specification which talks %setup -q -c -n src -a 0 %build +cp %{_topdir}/SOURCES/LICENSE /root/rpmbuild/BUILD/src/LICENSE export CRI_DOCKER_GITCOMMIT=%{_gitcommit} mkdir -p /go/src/github.com/Mirantis ln -s /root/rpmbuild/BUILD/src/app /go/src/github.com/Mirantis/cri-dockerd @@ -80,6 +82,7 @@ install -D -m 0644 %{_topdir}/SOURCES/cri-docker.socket $RPM_BUILD_ROOT/%{_unitd /%{_bindir}/cri-dockerd /%{_unitdir}/cri-docker.service /%{_unitdir}/cri-docker.socket +%license LICENSE %post %systemd_post cri-docker.service