From befee9d0a20734902267290c3c972a6b22d83d85 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 `post-upstream-clone:` actions. We still want to build tarballs with a correct .spec (for using with `rpmbuild -tb` and VM image preparation), so make sure that they get a patched file with correct Version:. --- Makefile | 15 +++++++-------- ...cockpit-podman.spec.in => cockpit-podman.spec} | 2 +- packit.yaml | 3 --- 3 files changed, 8 insertions(+), 12 deletions(-) rename packaging/{cockpit-podman.spec.in => cockpit-podman.spec} (98%) diff --git a/Makefile b/Makefile index c38de3112..02f19ac27 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ endif export TEST_OS TARFILE=$(RPM_NAME)-$(VERSION).tar.xz NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz -SPEC=$(RPM_NAME).spec APPSTREAMFILE=org.cockpit-project.$(PACKAGE_NAME).metainfo.xml VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) # stamp file to check for node_modules/ @@ -77,9 +76,6 @@ po/LINGUAS: # Build/Install/dist # -%.spec: packaging/%.spec.in - sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@ - packaging/arch/PKGBUILD: packaging/arch/PKGBUILD.in sed 's/VERSION/$(VERSION)/; s/SOURCE/$(TARFILE)/' $< > $@ @@ -94,7 +90,7 @@ watch: clean: rm -rf dist/ - rm -f $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog + rm -f packaging/arch/PKGBUILD packaging/debian/changelog rm -f po/LINGUAS install: $(WEBPACK_TEST) po/LINGUAS @@ -133,13 +129,16 @@ dist: $(TARFILE) # we don't ship most node_modules for license and compactness reasons, only the ones necessary for running tests # we ship a pre-built dist/ (so it's not necessary) and ship package-lock.json (so that node_modules/ can be reconstructed if necessary) $(TARFILE): export NODE_ENV=production -$(TARFILE): $(WEBPACK_TEST) $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog +$(TARFILE): $(WEBPACK_TEST) packaging/arch/PKGBUILD packaging/debian/changelog + sed -e '/^Version:/ s/0/$(VERSION)/g' packaging/cockpit-podman.spec > cockpit-podman.spec if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \ - --exclude '*.in' --exclude test/reference \ + --transform 's,cockpit-podman.spec,packaging/cockpit-podman.spec,' \ + --exclude '*.in' --exclude test/reference packaging/cockpit-podman.spec \ $$(git ls-files | grep -v node_modules) \ - $(COCKPIT_REPO_FILES) $(NODE_MODULES_TEST) $(SPEC) $(TEST_NPMS) \ + $(COCKPIT_REPO_FILES) $(NODE_MODULES_TEST) $(TEST_NPMS) \ packaging/arch/PKGBUILD packaging/debian/changelog dist/ + rm cockpit-podman.spec # convenience target for developers rpm: $(TARFILE) 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 2242aae93..69ceab444 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: