summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Koškár2017-09-05 13:47:08 +0200
committerMiroslav Koškár2017-09-05 13:47:08 +0200
commitde9c96ca2467d35416f6db818e7fec3cdecf8c1e (patch)
treecb184f04eff9faa2bbc84a3ba7a70abfb2d16bd2
downloadaur-de9c96ca2467d35416f6db818e7fec3cdecf8c1e.tar.gz
Initial
-rw-r--r--.SRCINFO20
-rw-r--r--01-echo-off.patch38
-rw-r--r--Makefile32
-rw-r--r--PKGBUILD40
-rw-r--r--away.pam2
5 files changed, 132 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a89a923189b8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = away
+ pkgdesc = Terminal locking program
+ pkgver = 0.9.5
+ pkgrel = 1
+ url = https://packages.debian.org/sid/away
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = pam
+ source = http://http.debian.net/debian/pool/main/a/away/away_0.9.5+ds.orig.tar.gz
+ source = 01-echo-off.patch
+ source = Makefile
+ source = away.pam
+ sha256sums = 14915180d963f1451730e31bdf7dc02e9978236f9839b9f0702474019f74e960
+ sha256sums = 31e1a4e2dd1bb0340dea709eabcc9fe0c87ddf57a17bd5d49b92af1017fb2d16
+ sha256sums = 9838c8fa00364e264615a9153247f7a4519bfa40ccabebc0c25a01cfc767a614
+ sha256sums = d6efaf99cf53af47ce9e48eda930a15a6a0c3a233a9aaa1b443495fbe2efad87
+
+pkgname = away
+
diff --git a/01-echo-off.patch b/01-echo-off.patch
new file mode 100644
index 000000000000..a15df0c51e3f
--- /dev/null
+++ b/01-echo-off.patch
@@ -0,0 +1,38 @@
+diff -ruN away-0.9.5-old/away.c away-0.9.5/away.c
+--- away-0.9.5-old/away.c 2002-08-22 07:23:39.000000000 +0200
++++ away-0.9.5/away.c 2002-10-08 15:55:50.000000000 +0200
+@@ -234,9 +234,23 @@
+
+ /* Stall */
+ void stall(void) {
++ struct termios old, new;
++
+ printf("\n You went away at %.20s", make_time());
+ printf("\n\n -- Press [Enter] to come back online --\n");
++
++ /* save term state */
++ tcgetattr(0, &old);
++ new = old;
++
++ /* turn off echo */
++ new.c_lflag &= ~ECHO;
++ tcsetattr(0, TCSANOW, &new);
+ getchar();
++
++ /* reset term */
++ tcsetattr(0, TCSANOW, &old);
++ printf("\n");
+ }
+
+ /* Get Current Time */
+diff -ruN away-0.9.5-old/away.h away-0.9.5/away.h
+--- away-0.9.5-old/away.h 2002-08-12 02:33:03.000000000 +0200
++++ away-0.9.5/away.h 2002-10-08 15:51:03.000000000 +0200
+@@ -58,6 +58,7 @@
+ #include <sys/stat.h>
+ #include <security/pam_appl.h>
+ #include <security/pam_misc.h>
++#include <termios.h>
+
+ /* Default conf file name */
+ char *rcfile = ".awayrc";
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..ee36fea339a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+# Makefile for Away
+
+# files and paths
+SHELL = /bin/sh
+PREFIX = /usr
+BINARY = away
+SRC = $(BINARY).c
+
+# compiler
+CC = gcc
+CFLAGS := -g -Wall -D_REENTRANT $(CFLAGS) $(CPPFLAGS)
+LIBS = $(LDFLAGS) -lpthread -lpam -lpam_misc
+
+# alias away
+all: $(BINARY)
+
+# away
+$(BINARY): $(SRC)
+ $(CC) $(CFLAGS) $(SRC) $(LIBS) -o $(BINARY)
+# @strip $(BINARY)
+
+# make install
+install: $(BINARY)
+ install -D -m755 -t $(DESTDIR)/$(PREFIX)/bin away
+ install -D -m644 -t $(DESTDIR)/$(PREFIX)/share/doc/away/examples data/awayrc
+ install -D -m644 -t $(DESTDIR)/$(PREFIX)/share/man/man1 doc/away.1
+ install -D -m644 -t $(DESTDIR)/$(PREFIX)/share/man/man5 doc/awayrc.5
+ install -D -m644 data/away.pam $(DESTDIR)/etc/pam.d/away
+
+# Clean up
+clean:
+ rm -f $(BINARY) *.o core
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..034f3eb700e6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Miroslav Koškár <http://mkoskar.com/>
+
+pkgname='away'
+pkgver=0.9.5
+pkgrel=1
+pkgdesc='Terminal locking program'
+url='https://packages.debian.org/sid/away'
+license=(GPL)
+arch=(i686 x86_64)
+depends=(pam)
+
+source=(
+ http://http.debian.net/debian/pool/main/a/away/away_0.9.5+ds.orig.tar.gz
+ 01-echo-off.patch
+ Makefile
+ away.pam
+)
+sha256sums=(
+ 14915180d963f1451730e31bdf7dc02e9978236f9839b9f0702474019f74e960
+ 31e1a4e2dd1bb0340dea709eabcc9fe0c87ddf57a17bd5d49b92af1017fb2d16
+ 9838c8fa00364e264615a9153247f7a4519bfa40ccabebc0c25a01cfc767a614
+ d6efaf99cf53af47ce9e48eda930a15a6a0c3a233a9aaa1b443495fbe2efad87
+)
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ patch -p1 <"$srcdir/01-echo-off.patch"
+ cp "$srcdir/Makefile" .
+ cp "$srcdir/away.pam" data
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
diff --git a/away.pam b/away.pam
new file mode 100644
index 000000000000..d7fe8ba8784c
--- /dev/null
+++ b/away.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+auth include system-auth