diff options
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 18 | ||||
-rw-r--r-- | Makefile | 31 | ||||
-rw-r--r-- | PKGBUILD | 33 | ||||
-rw-r--r-- | PKGBUILD.tmpl | 33 |
6 files changed, 136 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1ee08900227c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = ticli + pkgdesc = A modern cli for tikv. + pkgver = 0.1.0 + pkgrel = 1 + url = https://github.com/hackathon-2022-ticli/ticli + arch = i686 + arch = x86_64 + license = MIT + license = APACHE + makedepends = rust + makedepends = cargo + conflicts = ticli-git + conflicts = ticli-bin + source = ticli-0.1.0.tar.gz::https://github.com/hackathon-2022-ticli/ticli/archive/v0.1.0.tar.gz + md5sums = aae250d55905c55baa39acc8768aee32 + +pkgname = ticli diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..77a644323e65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/src +*.gz +*.zst +/pkg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000000..82f3484f3d1e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: mixed-line-ending +- repo: local + hooks: + - id: makepkg + name: makepkg + pass_filenames: false + always_run: true + language: system + entry: > + sh -c 'make codegen && git add PKGBUILD .SRCINFO' diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..60d4e127627d --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +USER = hackathon-2022-ticli +REPO = ticli +PKGDESC = A modern cli for tikv. +PKGVER = 0.1.0 +PKGREL = 1 + +MAINTAINER = $(shell git config user.name) <$(shell git config user.email)> +PKGNAME = $(REPO) +BINNAME = $(REPO) +CONFLICTS = ("$(REPO)-git" "$(REPO)-bin") +PROVIDES = () + +.PHONY: codegen +codegen: + @sed \ + -e 's#{{USER}}#$(USER)#g' \ + -e 's#{{REPO}}#$(REPO)#g' \ + -e 's#{{MAINTAINER}}#$(MAINTAINER)#g' \ + -e 's#{{PKGNAME}}#$(PKGNAME)#g' \ + -e 's#{{BINNAME}}#$(BINNAME)#g' \ + -e 's#{{PKGDESC}}#$(PKGDESC)#g' \ + -e 's#{{PKGVER}}#$(PKGVER)#g' \ + -e 's#{{PKGREL}}#$(PKGREL)#g' \ + -e 's#{{CONFLICTS}}#$(CONFLICTS)#g' \ + -e 's#{{PROVIDES}}#$(PROVIDES)#g' \ + PKGBUILD.tmpl > PKGBUILD + @sed -i "s/{{MD5SUM}}/$$(makepkg -g | grep -Po '[0-9a-f]{32}')/g" PKGBUILD + @makepkg --printsrcinfo > .SRCINFO + +package: codegen + @makepkg -f diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7cb55c6b78d8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Hongqi Yu <bowser1704@gmail.com> +_pkgname=ticli +pkgname=ticli +pkgver=0.1.0 +pkgrel=1 +pkgdesc="A modern cli for tikv." +arch=(i686 x86_64) +url='https://github.com/hackathon-2022-ticli/ticli' +license=('MIT' 'APACHE') +depends=() +makedepends=('rust' 'cargo') +conflicts=("ticli-git" "ticli-bin") +provides=() + +source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz") +md5sums=('aae250d55905c55baa39acc8768aee32') + +build() { + cd "$srcdir/${_pkgname}-${pkgver}" + cargo build --release --locked +} + +package() { + cd "$srcdir/${_pkgname}-${pkgver}" + install -Dm755 "target/release/${_pkgname}" "$pkgdir/usr/bin/${_pkgname}" + install -Dm644 "completions/fish/${_pkgname}.fish" "$pkgdir/usr/share/fish/vendor_completions.d/${_pkgname}.fish" + install -Dm644 "completions/zsh/_${_pkgname}" "$pkgdir/usr/share/zsh/site-functions/_${_pkgname}" + install -Dm644 "README.md" "$pkgdir/usr/share/doc/${_pkgname}/README.md" + install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE-MIT" + install -Dm644 "LICENSE-APACHE" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE-APACHE" +} + +# vim:set noet sts=0 sw=4 ts=4 ft=PKGBUILD: diff --git a/PKGBUILD.tmpl b/PKGBUILD.tmpl new file mode 100644 index 000000000000..532a13b92455 --- /dev/null +++ b/PKGBUILD.tmpl @@ -0,0 +1,33 @@ +# Maintainer: {{MAINTAINER}} +_pkgname={{BINNAME}} +pkgname={{PKGNAME}} +pkgver={{PKGVER}} +pkgrel={{PKGREL}} +pkgdesc="{{PKGDESC}}" +arch=(i686 x86_64) +url='https://github.com/{{USER}}/{{REPO}}' +license=('MIT' 'APACHE') +depends=() +makedepends=('rust' 'cargo') +conflicts={{CONFLICTS}} +provides={{PROVIDES}} + +source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz") +md5sums=('{{MD5SUM}}') + +build() { + cd "$srcdir/${_pkgname}-${pkgver}" + cargo build --release --locked +} + +package() { + cd "$srcdir/${_pkgname}-${pkgver}" + install -Dm755 "target/release/${_pkgname}" "$pkgdir/usr/bin/${_pkgname}" + install -Dm644 "completions/fish/${_pkgname}.fish" "$pkgdir/usr/share/fish/vendor_completions.d/${_pkgname}.fish" + install -Dm644 "completions/zsh/_${_pkgname}" "$pkgdir/usr/share/zsh/site-functions/_${_pkgname}" + install -Dm644 "README.md" "$pkgdir/usr/share/doc/${_pkgname}/README.md" + install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE-MIT" + install -Dm644 "LICENSE-APACHE" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE-APACHE" +} + +# vim:set noet sts=0 sw=4 ts=4 ft=PKGBUILD: |