packaging: add arch packaging
...adapted from cockpit-machines.
This commit is contained in:
parent
8860f5b423
commit
d557235f3c
2 changed files with 22 additions and 3 deletions
10
Makefile
10
Makefile
|
|
@ -81,6 +81,9 @@ $(SPEC): packaging/$(SPEC).in $(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)) = /'); \
|
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)"); gsub(/%{NPM_PROVIDES}/, p)}1' $< > $@
|
awk -v p="$$provides" '{gsub(/%{VERSION}/, "$(VERSION)"); gsub(/%{NPM_PROVIDES}/, p)}1' $< > $@
|
||||||
|
|
||||||
|
packaging/arch/PKGBUILD: packaging/arch/PKGBUILD.in
|
||||||
|
sed 's/VERSION/$(VERSION)/; s/SOURCE/$(TARFILE)/' $< > $@
|
||||||
|
|
||||||
$(DIST_TEST): $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP) $(shell find src/ -type f) package.json build.js
|
$(DIST_TEST): $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP) $(shell find src/ -type f) package.json build.js
|
||||||
NODE_ENV=$(NODE_ENV) ./build.js
|
NODE_ENV=$(NODE_ENV) ./build.js
|
||||||
|
|
||||||
|
|
@ -89,7 +92,7 @@ watch: $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
rm -f $(SPEC)
|
rm -f $(SPEC) packaging/arch/PKGBUILD
|
||||||
rm -f po/LINGUAS
|
rm -f po/LINGUAS
|
||||||
|
|
||||||
install: $(DIST_TEST) po/LINGUAS
|
install: $(DIST_TEST) po/LINGUAS
|
||||||
|
|
@ -121,11 +124,12 @@ dist: $(TARFILE)
|
||||||
# pre-built dist/ (so it's not necessary) and ship package-lock.json (so that
|
# pre-built dist/ (so it's not necessary) and ship package-lock.json (so that
|
||||||
# node_modules/ can be reconstructed if necessary)
|
# node_modules/ can be reconstructed if necessary)
|
||||||
$(TARFILE): export NODE_ENV=production
|
$(TARFILE): export NODE_ENV=production
|
||||||
$(TARFILE): $(DIST_TEST) $(SPEC)
|
$(TARFILE): $(DIST_TEST) $(SPEC) packaging/arch/PKGBUILD
|
||||||
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
|
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)/,' \
|
tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
|
||||||
--exclude packaging/$(SPEC).in --exclude node_modules \
|
--exclude packaging/$(SPEC).in --exclude node_modules \
|
||||||
$$(git ls-files) $(COCKPIT_REPO_FILES) $(NODE_MODULES_TEST) $(SPEC) dist/
|
$$(git ls-files) $(COCKPIT_REPO_FILES) $(NODE_MODULES_TEST) \
|
||||||
|
$(SPEC) packaging/arch/PKGBUILD dist/
|
||||||
|
|
||||||
$(NODE_CACHE): $(NODE_MODULES_TEST)
|
$(NODE_CACHE): $(NODE_MODULES_TEST)
|
||||||
tar --xz $(TAR_ARGS) -cf $@ node_modules
|
tar --xz $(TAR_ARGS) -cf $@ node_modules
|
||||||
|
|
|
||||||
15
packaging/arch/PKGBUILD.in
Normal file
15
packaging/arch/PKGBUILD.in
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
pkgname=cockpit-starter-kit
|
||||||
|
pkgver=VERSION
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Cockpit Starter Kit Example Module'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://github.com/cockpit-project/starter-kit'
|
||||||
|
license=(LGPL)
|
||||||
|
source=("SOURCE")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
package() {
|
||||||
|
depends=(cockpit)
|
||||||
|
cd $pkgname
|
||||||
|
make DESTDIR="$pkgdir" install PREFIX=/usr
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue