From 68321b85de4e1cfc6cc44b0ca54ff3b193bb4a13 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 14 Jun 2022 09:41:34 +0200 Subject: [PATCH] Keep .spec in git Give up on .spec.in and directly keep the .spec in git. This aligns a lot better with what packit wants to do, and avoids having explicit `specfile_path:` and `post-upstream-clone:` actions. We still want to build tarballs with a correct .spec (for using with `rpmbuild -bb` and VM image preparation), so make sure that they get the patched file. --- Makefile | 7 ++++--- packaging/{cockpit-podman.spec.in => cockpit-podman.spec} | 2 +- packit.yaml | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) rename packaging/{cockpit-podman.spec.in => cockpit-podman.spec} (98%) diff --git a/Makefile b/Makefile index 22bcaeb98..93924211c 100644 --- a/Makefile +++ b/Makefile @@ -75,8 +75,8 @@ po/LINGUAS: # Build/Install/dist # -%.spec: packaging/%.spec.in - sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@ +%.spec: packaging/%.spec + sed -e '/^Version:/ s/0/$(VERSION)/g' $< > $@ packaging/arch/PKGBUILD: packaging/arch/PKGBUILD.in sed 's/VERSION/$(VERSION)/; s/SOURCE/$(TARFILE)/' $< > $@ @@ -118,7 +118,8 @@ dist: $(TARFILE) $(TARFILE): export NODE_ENV=production $(TARFILE): $(WEBPACK_TEST) $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog tar --xz -cf $(TARFILE) --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \ - --exclude '*.in' --exclude test/reference --exclude node_modules \ + --transform 's,$(SPEC),packaging/$(SPEC),' \ + --exclude '*.in' --exclude test/reference --exclude node_modules --exclude packaging/$(SPEC) \ $$(git ls-files) $(COCKPIT_REPO_FILES) package-lock.json $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog dist/ # convenience target for developers diff --git a/packaging/cockpit-podman.spec.in b/packaging/cockpit-podman.spec similarity index 98% rename from packaging/cockpit-podman.spec.in rename to packaging/cockpit-podman.spec index 280c6b788..3545d84f1 100644 --- a/packaging/cockpit-podman.spec.in +++ b/packaging/cockpit-podman.spec @@ -16,7 +16,7 @@ # Name: cockpit-podman -Version: %{VERSION} +Version: 0 Release: 1%{?dist} Summary: Cockpit component for Podman containers License: LGPLv2+ diff --git a/packit.yaml b/packit.yaml index a948085a1..197947dde 100644 --- a/packit.yaml +++ b/packit.yaml @@ -1,14 +1,12 @@ upstream_project_url: https://github.com/cockpit-project/cockpit-podman # enable notification of failed downstream jobs as issues issue_repository: https://github.com/cockpit-project/cockpit-podman -specfile_path: cockpit-podman.spec upstream_package_name: cockpit-podman downstream_package_name: cockpit-podman # use the nicely formatted release description from our upstream release, instead of git shortlog copy_upstream_release_description: true actions: - post-upstream-clone: make cockpit-podman.spec create-archive: make dist srpm_build_deps: @@ -38,7 +36,6 @@ jobs: - centos-stream-8-x86_64 - centos-stream-9-x86_64 actions: - post-upstream-clone: make cockpit-podman.spec # HACK: tarball for releases (copr_build, koji, etc.), copying spec's Source0; this # really should be the default, see https://github.com/packit/packit-service/issues/1505 create-archive: