app-admin/apg: EAPI7, improve ebuild
authorMichael Mair-Keimberger <m.mairkeimberger@gmail.com>
Sun, 8 Jul 2018 16:14:53 +0000 (18:14 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 20 Jul 2018 12:50:55 +0000 (14:50 +0200)
Closes: https://github.com/gentoo/gentoo/pull/9146

app-admin/apg/apg-2.3.0b-r6.ebuild [new file with mode: 0644]
app-admin/apg/files/apg-2.3.0b-cracklib.patch
app-admin/apg/files/apg-2.3.0b-crypt_password.patch
app-admin/apg/files/apg-glibc-2.4.patch

diff --git a/app-admin/apg/apg-2.3.0b-r6.ebuild b/app-admin/apg/apg-2.3.0b-r6.ebuild
new file mode 100644 (file)
index 0000000..34ea033
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Another Password Generator"
+HOMEPAGE="http://www.adel.nursat.kz/apg/"
+SRC_URI="http://www.adel.nursat.kz/apg/download/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="cracklib"
+
+DEPEND="cracklib? ( sys-libs/cracklib )"
+
+src_prepare() {
+       default
+       if use cracklib; then
+               eapply "${FILESDIR}"/${P}-cracklib.patch
+       fi
+       eapply "${FILESDIR}"/${PN}-glibc-2.4.patch
+       eapply "${FILESDIR}"/${P}-crypt_password.patch
+
+       sed -i 's,^#\(APG_CS_CLIBS += -lnsl\)$,\1,' Makefile \
+               || die "Sed failed"
+       if [[ ${CHOST} == *-darwin* ]]; then
+               sed -i 's,^APG_CLIBS += -lcrypt,APG_CLIBS += ,' Makefile \
+                       || die "Sed failed"
+       fi
+}
+
+src_compile() {
+       emake \
+               FLAGS="${CFLAGS} ${LDFLAGS}" CFLAGS="${CFLAGS} ${LDFLAGS}" \
+               CC="$(tc-getCC)" standalone
+       emake FLAGS="${CFLAGS} ${LDFLAGS}" CC="$(tc-getCC)" \
+               -C bfconvert
+}
+
+src_install() {
+       dobin apg apgbfm bfconvert/bfconvert
+       dodoc CHANGES INSTALL README THANKS TODO \
+               doc/{APG_TIPS,pronun.txt,rfc0972.txt,rfc1750.txt}
+       doman doc/man/{apg.1,apgbfm.1}
+}
index a1c34a14f5a0b3d308486ef3f71b0a84b8184c50..d297495b3211b9acbdb702248ed22b9ac26778e3 100644 (file)
@@ -1,5 +1,5 @@
---- Makefile   2003-08-07 09:40:39.000000000 -0600
-+++ Makefile.cracklib  2004-10-14 07:16:17.288530686 -0600
+--- a/Makefile 2003-08-07 09:40:39.000000000 -0600
++++ b/Makefile 2004-10-14 07:16:17.288530686 -0600
 @@ -44,10 +44,10 @@
  # If you want to use cracklib for password quality check then you
  # must uncomment the folowing 4 lines (you must not do this for WIN32)
index 93f3f152a2b45e45e7df44ebbc26c20e7c2e0ec5..64a7fdcb37d319f9a4b86647ce6c692fe0840ee9 100644 (file)
@@ -1,5 +1,5 @@
---- restrict.c 2007-03-09 13:48:27.000000000 +0300
-+++ restrict.c 2007-03-09 13:49:31.000000000 +0300
+--- a/restrict.c       2007-03-09 13:48:27.000000000 +0300
++++ b/restrict.c       2007-03-09 13:49:31.000000000 +0300
 @@ -33,6 +33,9 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -10,8 +10,8 @@
  #include "restrict.h"
  extern struct sym smbl[94];
  /*
---- apg.c      2007-03-08 17:32:40.000000000 +0300
-+++ apg.c      2007-03-08 17:34:07.000000000 +0300
+--- a/apg.c    2007-03-08 17:32:40.000000000 +0300
++++ b/apg.c    2007-03-08 17:34:07.000000000 +0300
 @@ -100,6 +100,7 @@
  #else /* CLISERV */
  #if defined(APG_USE_CRACKLIB)
index be90c6355e666a0630839dcbf377cc91a61a9361..43b5874fa2b686a025d1d1e6037bf82909f34df5 100644 (file)
@@ -1,5 +1,5 @@
---- restrict.h.orig    2006-03-26 03:33:50.168661936 +0400
-+++ restrict.h 2006-03-26 03:34:10.427582112 +0400
+--- a/restrict.h       2006-03-26 03:33:50.168661936 +0400
++++ b/restrict.h       2006-03-26 03:34:10.427582112 +0400
 @@ -33,6 +33,8 @@
  #ifndef APG_RESTRICT_H
  #define APG_RESTRICT_H        1