summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenxuan Zhang2020-10-30 15:55:33 +0800
committerWenxuan Zhang2020-10-30 15:55:33 +0800
commit898de792dfe7c166ba9d6d1db14f1df51ef0c855 (patch)
tree28dd2a35b3319ad13c00c52c549db6771ba3a152
downloadaur-898de792dfe7c166ba9d6d1db14f1df51ef0c855.tar.gz
init commit
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore4
-rw-r--r--.pre-commit-config.yaml18
-rw-r--r--Makefile31
-rw-r--r--PKGBUILD31
-rw-r--r--PKGBUILD.tmpl31
6 files changed, 133 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0e6cb2a95cfe
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = rust-script
+ pkgdesc = Run Rust files and expressions without any setup or compilation necessary.
+ pkgver = 0.7.0
+ pkgrel = 1
+ url = https://github.com/fornwall/rust-script
+ arch = i686
+ arch = x86_64
+ license = MIT
+ license = APACHE
+ makedepends = rust
+ makedepends = cargo
+ conflicts = rust-script-git
+ conflicts = rust-script-bin
+ source = https://github.com/fornwall/rust-script/archive/v0.7.0.tar.gz
+ md5sums = 9889f3143125df5ae4a31afa2b901f50
+
+pkgname = rust-script
+
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..ac6362d4711a
--- /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: v3.1.0
+ 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..7b8f83596bd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+USER = fornwall
+REPO = rust-script
+PKGDESC = Run Rust files and expressions without any setup or compilation necessary.
+PKGVER = 0.7.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..68723e2800d3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Wenxuan Zhang <wenxuangm@gmail.com>
+_pkgname=rust-script
+pkgname=rust-script
+pkgver=0.7.0
+pkgrel=1
+pkgdesc="Run Rust files and expressions without any setup or compilation necessary."
+arch=(i686 x86_64)
+url='https://github.com/fornwall/rust-script'
+license=('MIT' 'APACHE')
+depends=()
+makedepends=('rust' 'cargo')
+conflicts=("rust-script-git" "rust-script-bin")
+provides=()
+
+source=("${url}/archive/v${pkgver}.tar.gz")
+md5sums=('9889f3143125df5ae4a31afa2b901f50')
+
+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 "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..ddd39316e06e
--- /dev/null
+++ b/PKGBUILD.tmpl
@@ -0,0 +1,31 @@
+# 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=("${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 "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: