Skip to content

Commit

Permalink
Add Arch Linux packaging scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored and martinpitt committed Jan 12, 2024
1 parent 9561573 commit 6b98634
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ $(SPEC): packaging/$(SPEC).in $(NODE_MODULES_TEST)
$(DIST_TEST): $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP) $(shell find src/ -type f) package.json build.js
NODE_ENV=$(NODE_ENV) ./build.js

packaging/arch/PKGBUILD: packaging/arch/PKGBUILD.in
sed 's/VERSION/$(VERSION)/; s/SOURCE/$(TARFILE)/' $< > $@

packaging/debian/changelog: packaging/debian/changelog.in
sed 's/VERSION/$(VERSION)/' $< > $@

Expand All @@ -90,7 +93,7 @@ watch: $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP)

clean:
rm -rf dist/
rm -f $(SPEC) packaging/debian/changelog
rm -f $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog
rm -f po/LINGUAS

install: $(DIST_TEST) po/LINGUAS
Expand Down Expand Up @@ -122,12 +125,12 @@ dist: $(TARFILE)
# 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): $(DIST_TEST) $(SPEC) packaging/debian/changelog
$(TARFILE): $(DIST_TEST) $(SPEC) packaging/arch/PKGBUILD packaging/debian/changelog
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 packaging/$(SPEC).in --exclude node_modules \
$$(git ls-files) $(COCKPIT_REPO_FILES) $(NODE_MODULES_TEST) $(SPEC) \
packaging/debian/changelog dist/
packaging/arch/PKGBUILD packaging/debian/changelog dist/

$(NODE_CACHE): $(NODE_MODULES_TEST)
tar --xz $(TAR_ARGS) -cf $@ node_modules
Expand Down Expand Up @@ -170,7 +173,7 @@ endif

# build a VM with locally built distro pkgs installed
# disable networking, VM images have mock/pbuilder with the common build dependencies pre-installed
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) bots test/vm.install $(VM_DEPENDS)
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) packaging/arch/PKGBUILD bots test/vm.install $(VM_DEPENDS)
bots/image-customize --no-network --fresh \
$(VM_CUSTOMIZE_FLAGS) \
--upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
Expand Down
15 changes: 15 additions & 0 deletions packaging/arch/PKGBUILD.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pkgname=cockpit-navigator
pkgver=VERSION
pkgrel=1
pkgdesc='A filesystem browser for Cockpit'
arch=('any')
url='https://github.com/cockpit-project/cockpit-navigator'
license=(LGPL)
depends=(cockpit)
source=("SOURCE")
sha256sums=('SKIP')

package() {
cd $pkgname
make DESTDIR="$pkgdir" install PREFIX=/usr
}

0 comments on commit 6b98634

Please sign in to comment.