aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO15
-rw-r--r--.gitattributes3
-rw-r--r--.gitignore2
-rw-r--r--Makefile44
-rw-r--r--PKGBUILD23
-rw-r--r--README.Arch16
6 files changed, 103 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 0000000..90b4a8b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = cmake-common
+ pkgdesc = Various utilities to help develop C++/CMake projects
+ pkgver = 3.4
+ pkgrel = 1
+ url = https://github.com/egor-tensin/cmake-common
+ arch = any
+ license = MIT
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
+ depends = python
+ source = https://files.pythonhosted.org/packages/source/c/cmake_common/cmake_common-3.4.tar.gz
+ md5sums = SKIP
+
+pkgname = cmake-common
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..d76765e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+* text=auto
+
+*.sh text eol=lf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9228191
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.tar.zst
+*.tar.gz
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..08c7500
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
+unexport MAKEFLAGS
+.DEFAULT_GOAL := all
+.DELETE_ON_ERROR:
+.SUFFIXES:
+SHELL := bash
+.SHELLFLAGS := -eu -o pipefail -c
+
+escape = $(subst ','\'',$(1))
+
+define noexpand
+ifeq ($$(origin $(1)),environment)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),environment override)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),command line)
+ override $(1) := $$(value $(1))
+endif
+endef
+
+PKG_NAME := cmake-common
+
+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: commit
+commit:
+ source PKGBUILD && git commit -am "aur: $$pkgver-$$pkgrel"
+
+.PHONY: push
+push:
+ git push 'ssh://aur@aur.archlinux.org/$(call escape,$(PKG_NAME)).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
new file mode 100644
index 0000000..2bead2b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,23 @@
+# Maintainer: Egor Tensin <Egor.Tensin@gmail.com>
+pkgname=cmake-common
+_name="${pkgname//-/_}"
+pkgver=3.4
+pkgrel=1
+pkgdesc='Various utilities to help develop C++/CMake projects'
+arch=(any)
+url='https://github.com/egor-tensin/cmake-common'
+license=(MIT)
+makedepends=(python-build python-installer python-wheel)
+depends=(python)
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$_name/$_name-$pkgver.tar.gz")
+md5sums=(SKIP)
+
+build() {
+ cd "$_name-$pkgver"
+ python -m build --wheel --no-isolation
+}
+
+package() {
+ cd "$_name-$pkgver"
+ python -m installer --destdir="$pkgdir" dist/*.whl
+}
diff --git a/README.Arch b/README.Arch
new file mode 100644
index 0000000..0149fe3
--- /dev/null
+++ b/README.Arch
@@ -0,0 +1,16 @@
+cmake-common on AUR
+===================
+
+There're a bunch of useful one-liners in Makefile.
+
+ * Make the package (this also updates .SRCINFO):
+
+ make package
+
+ * Commit the changes:
+
+ make commit
+
+ * Push to the AUR repository:
+
+ make push