summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoaquin2018-01-29 23:03:33 -0500
committerJoaquin2018-01-29 23:03:33 -0500
commitf1864c47dc32a1fe7391670191d7044c153aa7bf (patch)
tree826e142fd6e4f62e515b733c073e60d88564da34
downloadaur-f1864c47dc32a1fe7391670191d7044c153aa7bf.tar.gz
Initial Upload: codeforces-parser-git r48.5287a01
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD39
-rw-r--r--codeforces-parser-git.install5
3 files changed, 65 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..1cec5daa0ec
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = codeforces-parser-git
+ pkgdesc = Parse sample tests of Codeforces competitions, and generate tests automatically.
+ pkgver = r48.5287a01
+ pkgrel = 1
+ url = https://github.com/johnathan79717/codeforces-parser
+ install = codeforces-parser-git.install
+ arch = any
+ license = unknown
+ makedepends = git
+ depends = python
+ depends = time
+ depends = python-urllib3
+ optdepends = go: for go support
+ optdepends = kotlin: for kotlin support
+ provides = codeforces-parser
+ conflicts = codeforces-parser
+ source = git+https://github.com/johnathan79717/codeforces-parser
+ sha256sums = SKIP
+
+pkgname = codeforces-parser-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..a81a0e88b93
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Joaquin Garmendia <joaquingc123 at gmail dot com>
+
+pkgname=codeforces-parser-git
+pkgver=r48.5287a01
+pkgrel=1
+pkgdesc="Parse sample tests of Codeforces competitions, and generate tests automatically."
+arch=("any")
+url="https://github.com/johnathan79717/${pkgname%-git}"
+license=('unknown')
+depends=('python' 'time' 'python-urllib3')
+makedepends=('git')
+optdepends=('go: for go support'
+ 'kotlin: for kotlin support')
+provides=(${pkgname%-git})
+conflicts=(${pkgname%-git})
+source=("git+${url}")
+sha256sums=('SKIP')
+install=${pkgname}.install
+
+
+pkgver() {
+ cd "${srcdir}/${pkgname%-git}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+
+prepare(){
+ cd ${pkgname%-git}
+ sed -i "s/main.cc/\/etc\/${pkgname%-git}\/main.cc/" parse.py
+ sed -i "s/main.go/\/etc\/${pkgname%-git}\/main.go/" parse.py
+ sed -i "s/main.kt/\/etc\/${pkgname%-git}\/main.kt/" parse.py
+}
+
+package() {
+ cd "${srcdir}/${pkgname%-git}"
+ install -Dm755 parse.py "${pkgdir}/usr/bin/codeforces-parser"
+ mkdir -p "${pkgdir}/etc/${pkgname%-git}"
+ cp main.{go,cc,kt} "${pkgdir}/etc/${pkgname%-git}/"
+}
diff --git a/codeforces-parser-git.install b/codeforces-parser-git.install
new file mode 100644
index 00000000000..de90eebcd92
--- /dev/null
+++ b/codeforces-parser-git.install
@@ -0,0 +1,5 @@
+post_install(){
+ echo "The templates are located in /etc/codeforces-parser/main.{cc,go,kt}"
+ echo "To change the path of the templates for {cc,go,kt} you need to"
+ echo "modify /usr/bin/codeforces-parser in line {25,31,37}"
+}