summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNemo2018-03-31 17:02:16 +0530
committerNemo2018-03-31 22:08:49 +0530
commitf3b7cecfb9ee165f3a0331de6bb7d6d23ac3a681 (patch)
tree57181cce509d546be9539582e5201dd041431091
downloadaur-f3b7cecfb9ee165f3a0331de6bb7d6d23ac3a681.tar.gz
Initial commit (1.0.0)
-rw-r--r--.SRCINFO33
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD86
-rw-r--r--deny1
-rw-r--r--pam.d10
-rw-r--r--service11
6 files changed, 145 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..7bb3d847d97
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = shubhcron
+ pkgdesc = Cron runner for your auspicious jobs
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://razorpay.com/shubhcron/
+ arch = x86_64
+ license = custom:BSD
+ makedepends = go
+ makedepends = patch
+ depends = pam
+ depends = bash
+ depends = run-parts
+ optdepends = smtp-server: send job output via email
+ optdepends = smtp-forwarder: forward job output to email server
+ provides = cron
+ conflicts = cron
+ backup = etc/cron.deny
+ backup = etc/pam.d/crond
+ backup = etc/cron.d/0hourly
+ backup = etc/anacrontab
+ source = https://github.com/cronie-crond/cronie/releases/download/cronie-1.5.1/cronie-1.5.1.tar.gz
+ source = service
+ source = pam.d
+ source = deny
+ source = https://mac.captnemo.in/shubhcron-1.0.0.tar.gz
+ sha256sums = 6c73666102a6b5d35e2eaf1bd06925f2d4b0cef8d3323c37286dda3089a85338
+ sha256sums = 0d8721b91f6a8ce45ac6dce126757bfff4eb6f6ef68811b0f935eb5d3321afa1
+ sha256sums = 00864268b491bab8c66400a4a4b4bf85f168a6e44e85676105e084940924090c
+ sha256sums = ae6e533ecdfc1bd2dd80a9e25acb0260cbe9f00c4e4abee93d552b3660f263fc
+ sha256sums = 7a08d172292918dce2c05d2052d559b83cdb7a5d1339b0dbe3a6976b4485c546
+
+pkgname = shubhcron
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..b58e11574bf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.tar
+*.tar.gz
+pkg/
+src/ \ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..0644f7fa28c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,86 @@
+# Contributor: Kaiting Chen <kaiting.chen@kiwilight.com>
+# Contributor: Gaetan Bisson <bisson@archlinux.org>
+# Maintainer: Nemo <archlinux@captnemo.in>
+
+pkgname='shubhcron'
+pkgver=1.0.0
+pkgrel=1
+pkgdesc='Cron runner for your auspicious jobs'
+url='https://razorpay.com/shubhcron/'
+license=('custom:BSD')
+arch=('x86_64')
+depends=('pam' 'bash' 'run-parts')
+makedepends=('go' 'patch')
+optdepends=('smtp-server: send job output via email'
+ 'smtp-forwarder: forward job output to email server')
+source=('https://github.com/cronie-crond/cronie/releases/download/cronie-1.5.1/cronie-1.5.1.tar.gz'
+ 'service'
+ 'pam.d'
+ 'deny'
+ 'https://github.com/razorpay/shubhcron/releases/download/shubhcron-1.0.0/shubhcron-1.0.0.tar.gz')
+
+sha256sums=('6c73666102a6b5d35e2eaf1bd06925f2d4b0cef8d3323c37286dda3089a85338'
+ '62237132ccaf657f23b9c090b8cb10d7d003707a50d83b62f6cbc4c808766e44'
+ '00864268b491bab8c66400a4a4b4bf85f168a6e44e85676105e084940924090c'
+ 'ae6e533ecdfc1bd2dd80a9e25acb0260cbe9f00c4e4abee93d552b3660f263fc'
+ 'c6b77f733cf5b243cf6a49aede7cc36d7edb93c0fc2b9703a6a9280db7ccb44c')
+
+backup=('etc/cron.deny'
+ 'etc/pam.d/crond'
+ 'etc/cron.d/0hourly'
+ 'etc/anacrontab')
+
+conflicts=('cron')
+provides=('cron')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ GOPATH=`pwd`
+ go get github.com/kelvins/sunrisesunset
+}
+
+build() {
+ cp "${srcdir}/shubhcron-1.0.0/cronie.patch" "cronie-1.5.1/"
+ cd "${srcdir}/cronie-1.5.1"
+ patch -p1 < cronie.patch
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --sbindir=/usr/bin \
+ --enable-anacron \
+ --with-inotify \
+ --with-pam \
+
+ make
+
+ cd "${srcdir}/shubhcron-1.0.0"
+ GOPATH=`pwd`
+ go build shubh.go
+}
+
+package() {
+ cd "${srcdir}/cronie-1.5.1"
+
+ make DESTDIR="${pkgdir}" install
+
+ chmod u+s "${pkgdir}"/usr/bin/crontab
+ install -d "${pkgdir}"/var/spool/{ana,}cron
+ install -d "${pkgdir}"/etc/cron.{d,hourly,daily,weekly,monthly}
+
+ install -Dm644 ../deny "${pkgdir}"/etc/cron.deny
+ install -Dm644 ../pam.d "${pkgdir}"/etc/pam.d/crond
+ install -Dm644 ../service "${pkgdir}"/usr/lib/systemd/system/shubhcron.service
+
+ install -Dm644 contrib/anacrontab "${pkgdir}"/etc/anacrontab
+ install -Dm644 contrib/0hourly "${pkgdir}"/etc/cron.d/0hourly
+ install -Dm755 contrib/0anacron "${pkgdir}"/etc/cron.hourly/0anacron
+
+ install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/shubhcron/COPYING
+
+ mv "${pkgdir}/usr/bin/crond" "${pkgdir}/usr/bin/shubhcrond"
+
+ cd "${srcdir}/shubhcron-1.0.0"
+
+ install -Dm755 shubh "${pkgdir}/usr/bin/shubh"
+}
diff --git a/deny b/deny
new file mode 100644
index 00000000000..06e685cc888
--- /dev/null
+++ b/deny
@@ -0,0 +1 @@
+# without this file, only users listed in /etc/cron.allow can use crontab
diff --git a/pam.d b/pam.d
new file mode 100644
index 00000000000..9a254ebc0d4
--- /dev/null
+++ b/pam.d
@@ -0,0 +1,10 @@
+auth required pam_unix.so
+auth required pam_env.so
+
+account required pam_access.so
+account required pam_unix.so
+account required pam_time.so
+
+session required pam_loginuid.so
+session required pam_limits.so
+session required pam_unix.so
diff --git a/service b/service
new file mode 100644
index 00000000000..eb2f10a1668
--- /dev/null
+++ b/service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Shubh command scheduler
+
+[Service]
+ExecStart=/usr/bin/shubhcrond -n
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file