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

Keep .spec in git #1016

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -82,9 +81,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)/' $< > $@

Expand All @@ -103,7 +99,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
Expand Down Expand Up @@ -142,13 +138,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: cockpit-podman
Version: %{VERSION}
Version: 0
Release: 1%{?dist}
Summary: Cockpit component for Podman containers
License: LGPL-2.1-or-later
Expand Down
6 changes: 1 addition & 5 deletions packit.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/packit/packit-service/issues/1511 -- there's a bug that propose-downstream fails without an explicit specfile_path:, so we'll most likely have to bring that back anyway (with a bug ref). That will surface when testing the releasing, but until then we first need to sort out the packit srpm build.

upstream_package_name: cockpit-podman
downstream_package_name: cockpit-podman
specfile_path: packaging/cockpit-podman.spec
# 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:
Expand All @@ -30,7 +27,6 @@ jobs:
project: "cockpit-preview"
preserve_project: True
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:
Expand Down