Skip to content
Draft
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: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,20 @@ cockpit/devel: cockpit/devel-uninstall cockpit/build cockpit/devel-install
#

RPM_SPEC=cockpit/$(PACKAGE_NAME).spec
NODE_MODULES_TEST=package-lock.json
TARFILE=$(PACKAGE_NAME)-$(VERSION).tar.gz

$(RPM_SPEC): $(RPM_SPEC) $(NODE_MODULES_TEST)
provides=$$(npm ls --omit dev --package-lock-only --depth=Infinity | grep -Eo '[^[:space:]]+@[^[:space:]]+' | sort -u | sed 's/^/Provides: bundled(npm(/; s/\(.*\)@/\1)) = /'); \
awk -v p="$$provides" '{gsub(/%{VERSION}/, "$(VERSION)"); $(SUB_NODE_ENV) gsub(/%{NPM_PROVIDES}/, p)}1' $< > $@

$(TARFILE): export NODE_ENV ?= production
$(TARFILE): cockpit/download
npm ci --include=dev
$(TARFILE): cockpit/build
touch -r package.json package-lock.json
touch cockpit/public/*
tar czf $(TARFILE) --transform 'flags=r;s,^,$(PACKAGE_NAME)/,' \
$$(git ls-files) \
node_modules \
pkg
tar czf $(TARFILE) --transform 's,^,$(PACKAGE_NAME)/,' \
--exclude node_modules \
$$(git ls-files) $(RPM_SPEC) $(NODE_MODULES_TEST) cockpit/public/ cockpit/README.md cockpit/tmpfiles.d
realpath $(TARFILE)

dist: $(TARFILE)
Expand Down
3 changes: 1 addition & 2 deletions cockpit/cockpit-image-builder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ BuildRequires: gettext
BuildRequires: libappstream-glib
BuildRequires: make
BuildRequires: /usr/bin/node
BuildRequires: npm
# for _tmpfilesdir macro
BuildRequires: systemd-rpm-macros

Expand All @@ -34,7 +33,7 @@ as a frontend for osbuild.
%setup -q -n %{name}

%build
NODE_ENV=production npm run build:cockpit
# Nothing to build

%install
%make_install PREFIX=/usr
Expand Down
2 changes: 2 additions & 0 deletions packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ upstream_tag_template: v{version}

actions:
create-archive:
- npm ci
- make dist

srpm_build_deps:
Expand Down Expand Up @@ -55,6 +56,7 @@ jobs:
targets: *build_targets
actions:
create-archive:
- npm ci
- make dist

- job: propose_downstream
Expand Down
Loading