summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD49
-rw-r--r--locale_path.patch20
-rw-r--r--logintop10.install17
4 files changed, 69 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b8874ccfd5b..28f85460f9b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,19 @@
+# Generated by mksrcinfo v8
+# Sat Sep 8 21:38:00 UTC 2018
pkgbase = logintop10
- pkgdesc = Command-line utility that creates several top-10 lists from the wtmp (usually in /var/log/) on your system.
+ pkgdesc = Command-line utility that creates several top-10 lists from the wtmp (usually in /var/log/) on your system
pkgver = 1.9
- pkgrel = 2
+ pkgrel = 3
url = http://www.vanheusden.com/logintop10/
+ install = logintop10.install
arch = i686
arch = x86_64
license = GPL
depends = glibc
source = http://www.vanheusden.com/logintop10/logintop10-1.9.tgz
+ source = locale_path.patch
md5sums = e816ad4eb9f18b0f779241df1c4d971a
+ md5sums = 35db8797752b55042e5b4f28b14c40b1
pkgname = logintop10
diff --git a/PKGBUILD b/PKGBUILD
index 730dae69411..649b49f5dce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,36 +2,37 @@
# Contributor: karnath
pkgname=logintop10
pkgver=1.9
-pkgrel=2
-pkgdesc="Command-line utility that creates several top-10 lists from the wtmp (usually in /var/log/) on your system."
+pkgrel=3
+pkgdesc="Command-line utility that creates several top-10 lists from the wtmp (usually in /var/log/) on your system"
arch=('i686' 'x86_64')
license=('GPL')
-url=("http://www.vanheusden.com/logintop10/")
-source=(http://www.vanheusden.com/logintop10/logintop10-1.9.tgz)
+url="http://www.vanheusden.com/logintop10/"
+source=(http://www.vanheusden.com/logintop10/logintop10-${pkgver}.tgz
+ locale_path.patch)
depends=('glibc')
-md5sums=('e816ad4eb9f18b0f779241df1c4d971a')
+install=$pkgname.install
+md5sums=('e816ad4eb9f18b0f779241df1c4d971a'
+ '35db8797752b55042e5b4f28b14c40b1')
+
+prepare() {
+ cd ${srcdir}/$pkgname-$pkgver
+ patch -p0 < ${srcdir}/locale_path.patch
+}
build() {
- cd ${srcdir}/$pkgname-$pkgver
- sed -i "/LOCALE_PATH/s/\b\/local\b//" Makefile
- make
+ cd ${srcdir}/$pkgname-$pkgver
+ sed -i "/LOCALE_PATH/s/\b\/local\b//" Makefile
+ make
}
package() {
- mkdir -p ${pkgdir}/usr/{bin,share/locale/{nl,fr,es,ar,de}/LC_MESSAGES,share/man/man1}
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10 ${pkgdir}/usr/bin/
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10-nl.mo ${pkgdir}/usr/share/locale/nl/LC_MESSAGES/logintop10.mo
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10-fr.mo ${pkgdir}/usr/share/locale/fr/LC_MESSAGES/logintop10.mo
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10-es.mo ${pkgdir}/usr/share/locale/es/LC_MESSAGES/logintop10.mo
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10-ar.mo ${pkgdir}/usr/share/locale/ar/LC_MESSAGES/logintop10.mo
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10-de.mo ${pkgdir}/usr/share/locale/de/LC_MESSAGES/logintop10.mo
- mv -v ${srcdir}/${pkgname}-${pkgver}/logintop10.1 ${pkgdir}/usr/share/man/man1/logintop10.1
- gzip -9 ${pkgdir}/usr/share/man/man1/logintop10.1
- chmod 755 ${pkgdir}/usr/bin/logintop10
- chmod 644 ${pkgdir}/usr/share/locale/nl/LC_MESSAGES/logintop10.mo
- chmod 644 ${pkgdir}/usr/share/locale/fr/LC_MESSAGES/logintop10.mo
- chmod 644 ${pkgdir}/usr/share/locale/es/LC_MESSAGES/logintop10.mo
- chmod 644 ${pkgdir}/usr/share/locale/ar/LC_MESSAGES/logintop10.mo
- chmod 644 ${pkgdir}/usr/share/locale/de/LC_MESSAGES/logintop10.mo
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ mkdir -p ${pkgdir}/usr/{bin,share/locale/{nl,fr,es,ar,de}/LC_MESSAGES,share/man/man1}
+ for lang in nl fr es ar de
+ do
+ install -Dm644 logintop10-${lang}.mo ${pkgdir}/usr/share/locale/${lang}/LC_MESSAGES/logintop10.mo
+ done
+ install -Dm644 logintop10.1 ${pkgdir}/usr/share/man/man1/logintop10.1
+ gzip -9 ${pkgdir}/usr/share/man/man1/logintop10.1
+ install -Dm755 logintop10 ${pkgdir}/usr/bin/logintop10
}
-
diff --git a/locale_path.patch b/locale_path.patch
new file mode 100644
index 00000000000..df4c55bac11
--- /dev/null
+++ b/locale_path.patch
@@ -0,0 +1,20 @@
+--- logintop10.c.orig 2018-09-08 23:01:33.311690501 +0200
++++ logintop10.c 2018-09-08 23:34:35.585773279 +0200
+@@ -591,7 +591,7 @@
+ }
+
+ setlocale(LC_ALL, l);
+- bindtextdomain("logintop10", "/usr/local/share/locale");
++ bindtextdomain("logintop10", "/usr/share/locale");
+ textdomain("logintop10");
+
+ printf(_("logintop10, (c) 2003 by folkert@vanheusden.com\n"));
+@@ -605,7 +605,7 @@
+ if (help)
+ {
+ printf(_("Usage: %s -i wtmp -o fileout.html [-l locale] [-r]\n"), argv[0]);
+- printf(_("Example: logintop10 -i /var/log/wtmp -o ~/www/logintop10.html -l nl_NL\n"));
++ printf(_("Example: logintop10 -i /var/log/wtmp -o ~/www/logintop10.html -l nl_NL.utf8\n"));
+ return 1;
+ }
+
diff --git a/logintop10.install b/logintop10.install
new file mode 100644
index 00000000000..4e4ba280817
--- /dev/null
+++ b/logintop10.install
@@ -0,0 +1,17 @@
+post_install() {
+ echo "If you intend to use lang (-l) switch, make sure you have locales generated for the desired language."
+ /bin/true
+}
+
+post_upgrade() {
+ /bin/true
+}
+
+pre_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+
+$op "$@"