From 5dd552d949c03059557f3cc3c6f7a320a0bf9e01 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 8 Mar 2021 12:54:21 +0300 Subject: aur: add Vagrantfile, Makefile, etc. --- .SRCINFO | 2 +- .gitignore | 2 ++ Makefile | 31 +++++++++++++++++++++++++++++++ PKGBUILD | 8 ++++++-- README.Arch | 19 +++++++++++++++++++ Vagrantfile | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 README.Arch create mode 100644 Vagrantfile diff --git a/.SRCINFO b/.SRCINFO index 78826a3..6979144 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = linux-status pkgdesc = Simple Linux status web page pkgver = 0.0.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/egor-tensin/linux-status install = linux-status.install arch = any diff --git a/.gitignore b/.gitignore index 9228191..caea8af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.tar.zst *.tar.gz + +.vagrant/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3ba30d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +MAKEFLAGS += --warn-undefined-variables +.DEFAULT_GOAL := all +.DELETE_ON_ERROR: +.SUFFIXES: +SHELL := bash +.SHELLFLAGS := -e -o pipefail -c + +escape = $(subst ','\'',$(1)) + +PKG_NAME := linux-status + +this_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +.PHONY: all +all: package + +.PHONY: package +package: + makepkg --clean --cleanbuild --force --syncdeps && makepkg --printsrcinfo > '$(call escape,$(this_dir))/.SRCINFO' + +.PHONY: tag +tag: + source PKGBUILD && git tag "aur/v$$pkgver-$$pkgrel" + +.PHONY: push +push: + git push ssh://aur@aur.archlinux.org/linux-status.git "$$( git symbolic-ref HEAD ):master" + +.PHONY: clean +clean: + find '$(call escape,$(this_dir))' -type f '-(' -name '*.tar.gz' -o -name '*.tar.zst' '-)' -delete diff --git a/PKGBUILD b/PKGBUILD index a41e874..06a699c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Egor Tensin pkgname=linux-status pkgver=0.0.2 -pkgrel=1 +pkgrel=2 pkgdesc='Simple Linux status web page' arch=(any) url='https://github.com/egor-tensin/linux-status' @@ -12,7 +12,11 @@ source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") md5sums=(SKIP) package() { - cd "$srcdir/$pkgname-$pkgver" + cd "$srcdir" + + install -D -m 0644 -t "$pkgdir/usr/share/doc/linux-status" "../README.Arch" + + cd "$pkgname-$pkgver" install -D -m 0644 -t "$pkgdir/usr/share/linux-status" LICENSE.txt diff --git a/README.Arch b/README.Arch new file mode 100644 index 0000000..2d8787c --- /dev/null +++ b/README.Arch @@ -0,0 +1,19 @@ +linux-status on AUR +=================== + +There's a Vagrantfile to make maintenance easier. To start, use `vagrant up`, +then `vagrant ssh`. + +There're a bunch of useful one-liners in Makefile. + + * Make the package: + + make package + + * Tag the last commit: + + make tag + + * Push to the AUR repository: + + make push diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..e9f3b7a --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,32 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +NAME = 'Egor Tensin' +EMAIL = 'Egor.Tensin@gmail.com' + +Vagrant.configure("2") do |config| + config.vm.box = "archlinux/archlinux" + + config.vm.provider "libvirt" do |v| + v.cpus = 2 + v.memory = 4096 + end + + # Install the required packages: + config.vm.provision "shell", inline: <<-SHELL +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +pacman --noconfirm -Syu base-devel git + SHELL + + # Working with the git repository: + config.vm.provision "shell", privileged: false, inline: <<-SHELL +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +git config --global user.name '#{NAME}' +git config --global user.email '#{EMAIL}' + SHELL + config.ssh.forward_agent = true + + config.vm.provision :reload +end -- cgit v1.2.3