aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
Diffstat (limited to 'community')
-rw-r--r--community/oath-toolkit/APKBUILD68
-rw-r--r--community/oath-toolkit/oath-toolkit-2.6.2-gcc7.patch160
2 files changed, 228 insertions, 0 deletions
diff --git a/community/oath-toolkit/APKBUILD b/community/oath-toolkit/APKBUILD
new file mode 100644
index 00000000000..e08966707f3
--- /dev/null
+++ b/community/oath-toolkit/APKBUILD
@@ -0,0 +1,68 @@
+# Contributor: Jann - Ove Risvik <jann.ove@dev.usaklig.com>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=oath-toolkit
+pkgver=2.6.2
+pkgrel=0
+pkgdesc="OATH Toolkit One-time password components"
+url="http://www.nongnu.org/oath-toolkit/index.html"
+arch="all"
+license="various"
+depends="perl cvs diffutils"
+makedepends="linux-pam-dev libxml2-dev xmlsec-dev autoconf automake libtool gtk-doc"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-liboath $pkgname-libpskc $pkgname-oathtool $pkgname-pam_oath"
+source="https://download.savannah.gnu.org/releases/oath-toolkit/oath-toolkit-${pkgver}.tar.gz
+ oath-toolkit-2.6.2-gcc7.patch"
+
+build() {
+ cd "$builddir"
+ autoreconf --force --install
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+liboath() {
+ pkgdesc="A shared and static C library for OATH handling."
+ license="LGPL-2.1-or-later"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/liboath.so* "$subpkgdir"/usr/lib
+}
+
+libpskc() {
+ pkgdesc="Library for Portable Symmetric Key Container"
+ license="LGPL-2.1-or-later"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libpskc.so* "$subpkgdir"/usr/lib
+}
+
+
+
+oathtool() {
+ depends="oath-toolkit-liboath"
+ pkgdesc="A command line tool for generating and validating OTPs."
+ license="GPL-3.0-or-later"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/oathtool "$subpkgdir"/usr/bin
+}
+
+pam_oath() {
+ depends="oath-toolkit-liboath"
+ license="GPL-3.0-or-later"
+ pkgdesc="A PAM module for pluggable login authentication for OATH."
+ mkdir -p "$subpkgdir"/lib/security
+ mv "$pkgdir"/usr/lib/security/pam_oath.so "$subpkgdir"/lib/security
+}
+
+
+sha512sums="201a702a05a2e9fb3a66d04750e1a34e293342126caf02c344954a0d9fd0daafe73ca7f1fe273be129ae555a29b82b72fa2b4770ea2ad10711924e1926ec2cfb oath-toolkit-2.6.2.tar.gz
+dda606ee9c32075f2268af76394ac886da419ed42e34a45bb528ff26e39faede420ec7201dc32308d9cbfbc253d27a5d603e7bb6eaffc96a88a6bd9b2b3c54d9 oath-toolkit-2.6.2-gcc7.patch"
diff --git a/community/oath-toolkit/oath-toolkit-2.6.2-gcc7.patch b/community/oath-toolkit/oath-toolkit-2.6.2-gcc7.patch
new file mode 100644
index 00000000000..68cc017b433
--- /dev/null
+++ b/community/oath-toolkit/oath-toolkit-2.6.2-gcc7.patch
@@ -0,0 +1,160 @@
+Bug: https://bugs.gentoo.org/618100
+Cherry-picked from upstream commits: https://github.com/coreutils/gnulib/commit/175b4e22f99e00996b72f822f5ae54dca8243d19
+ https://github.com/coreutils/gnulib/commit/abae112b34572cd3869ce4fc81dddb5c2a7394c4
+
+--- a/oathtool/gl/intprops.h
++++ b/oathtool/gl/intprops.h
+@@ -23,6 +23,10 @@
+ #include <limits.h>
+ #include <verify.h>
+
++#ifndef __has_builtin
++# define __has_builtin(x) 0
++#endif
++
+ /* Return a value with the common real type of E and V and the value of V. */
+ #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+
+@@ -222,20 +226,24 @@
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+-/* True if __builtin_add_overflow (A, B, P) works when P is null. */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
++#define _GL_HAS_BUILTIN_OVERFLOW \
++ (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
++
++#define _GL_HAS_BUILTIN_OVERFLOW_P \
++ (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
+
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max) \
++ __builtin_add_overflow_p (a, b, (a) + (b))
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
++ __builtin_sub_overflow_p (a, b, (a) - (b))
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
++ __builtin_mul_overflow_p (a, b, (a) * (b))
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+@@ -315,7 +323,7 @@
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW || _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +357,6 @@
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +373,7 @@
+ the operation. BUILTIN is the builtin operation, and OVERFLOW the
+ overflow predicate. Return 1 if the result overflows. See above
+ for restrictions. */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+Bug: https://bugs.gentoo.org/618100
+Cherry-picked from upstream commits: https://github.com/coreutils/gnulib/commit/175b4e22f99e00996b72f822f5ae54dca8243d19
+ https://github.com/coreutils/gnulib/commit/abae112b34572cd3869ce4fc81dddb5c2a7394c4
+
+--- a/libpskc/gl/intprops.h
++++ b/libpskc/gl/intprops.h
+@@ -23,6 +23,10 @@
+ #include <limits.h>
+ #include <verify.h>
+
++#ifndef __has_builtin
++# define __has_builtin(x) 0
++#endif
++
+ /* Return a value with the common real type of E and V and the value of V. */
+ #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+
+@@ -222,20 +226,24 @@
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+-/* True if __builtin_add_overflow (A, B, P) works when P is null. */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
++#define _GL_HAS_BUILTIN_OVERFLOW \
++ (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
++
++#define _GL_HAS_BUILTIN_OVERFLOW_P \
++ (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
+
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max) \
++ __builtin_add_overflow_p (a, b, (a) + (b))
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
++ __builtin_sub_overflow_p (a, b, (a) - (b))
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
++ __builtin_mul_overflow_p (a, b, (a) * (b))
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+@@ -315,7 +323,7 @@
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW || _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +357,6 @@
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +373,7 @@
+ the operation. BUILTIN is the builtin operation, and OVERFLOW the
+ overflow predicate. Return 1 if the result overflows. See above
+ for restrictions. */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \