commit:     982c1b03712a14ac0600317a1a99186df5bac921
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Sat Mar  8 09:07:16 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Apr  8 20:41:35 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=982c1b03

app-crypt/shash: add to tree

---
 app-crypt/shash/files/0.2.6-manpage-fixes.patch    | 30 ++++++++++++++++
 .../shash/files/shash-0.2.6-binary-files.patch     | 34 ++++++++++++++++++
 .../shash/files/shash-0.2.6-missing-includes.patch | 27 +++++++++++++++
 app-crypt/shash/files/shash.bash-completion        | 40 ++++++++++++++++++++++
 app-crypt/shash/metadata.xml                       | 10 ++++++
 app-crypt/shash/shash-0.2.6-r99.ebuild             | 37 ++++++++++++++++++++
 6 files changed, 178 insertions(+)

diff --git a/app-crypt/shash/files/0.2.6-manpage-fixes.patch 
b/app-crypt/shash/files/0.2.6-manpage-fixes.patch
new file mode 100644
index 0000000..0376e15
--- /dev/null
+++ b/app-crypt/shash/files/0.2.6-manpage-fixes.patch
@@ -0,0 +1,30 @@
+diff -pruN shash-0.2.6/doc/shash.1 shash-0.2.6-r1/doc/shash.1
+--- shash-0.2.6/doc/shash.1    2004-09-18 09:51:04.004647112 +0100
++++ shash-0.2.6-r1/doc/shash.1 2004-09-18 09:57:26.062565480 +0100
+@@ -31,7 +31,7 @@ Because of this shash also supports HMAC
+ a mechanism for message authentication using cryptographic hash functions.
+ So shash can use a key with a hash algorithm to produce hashes that can only
+ be verified with the key. This way you can securely check (i.e. you are sure
+-that nobody can modify the mac, without beeing detected)
++that nobody can modify the mac, without being detected)
+ if files in a filesystem were altered. 
+ 
+ If the list of files and digests, that shash produces, is stored as
+@@ -72,7 +72,7 @@ Suppress some not critical warnings.
+ .TP
+ .B \-b
+ Use binary mode. In unix environment, only difference between this and
+-the normal mode is an asterix preceding the filename in the output.
++the normal mode is an asterisk preceding the filename in the output.
+ .TP
+ .B \-c
+ Check the checksum of all files listed in
+@@ -94,7 +94,7 @@ Enter the keyword via the command line. 
+ keyword instead of prompting for it. Keep in mind that someone
+ may see the command you are executing and so your key.
+ .TP
+-.B \-c --config FILE
++.B \-i --config FILE
+ Use the specified configuration file. The default is .shashrc
+ in your home directory. The format of the configuration
+ file is the same as the parameters. An example file is:

diff --git a/app-crypt/shash/files/shash-0.2.6-binary-files.patch 
b/app-crypt/shash/files/shash-0.2.6-binary-files.patch
new file mode 100644
index 0000000..1eb0cba
--- /dev/null
+++ b/app-crypt/shash/files/shash-0.2.6-binary-files.patch
@@ -0,0 +1,34 @@
+--- shash-0.2.6/src/shash.c
++++ shash-0.2.6/src/shash.c
+@@ -631,11 +631,11 @@
+ 
+               if (nosalt == FALSE && hmac == 1) {
+                       if (sscanf
+-                          (linebuf, "%s %s  %s\n", hexbuffer, buffer,
+-                           buffer2) < 2) {
++                          (linebuf, "%s %s *%s\n", hexbuffer, buffer,
++                           buffer2) != 3) {
+                               if (sscanf
+-                                  (linebuf, "%s %s *%s\n", hexbuffer,
+-                                   buffer, buffer2) < 2)
++                                  (linebuf, "%s %s  %s\n", hexbuffer,
++                                   buffer, buffer2) != 3)
+                                       continue;
+                       }
+ 
+@@ -648,11 +648,11 @@
+                       key = pass2key(algorithm, keymode_buffer, &keylen, 
password, plen);
+ 
+               } else {
+-                      if (sscanf(linebuf, "%s  %s\n", buffer, buffer2) ==
+-                          0) {
++                      if (sscanf(linebuf, "%s *%s\n", buffer, buffer2) !=
++                          2) {
+                               if (sscanf
+-                                  (linebuf, "%s *%s\n", buffer,
+-                                   buffer2) == 0)
++                                  (linebuf, "%s  %s\n", buffer,
++                                   buffer2) != 2)
+                                       continue;
+                       }
+ 

diff --git a/app-crypt/shash/files/shash-0.2.6-missing-includes.patch 
b/app-crypt/shash/files/shash-0.2.6-missing-includes.patch
new file mode 100644
index 0000000..1d57934
--- /dev/null
+++ b/app-crypt/shash/files/shash-0.2.6-missing-includes.patch
@@ -0,0 +1,27 @@
+--- a/shash-0.2.6/src/errors.c
++++ b/shash-0.2.6/src/errors.c
+@@ -1,4 +1,5 @@
+ #include <defines.h>
++#include <stdio.h>
+ 
+ extern int quiet;
+ 
+--- a/shash-0.2.6/src/random.c
++++ b/shash-0.2.6/src/random.c
+@@ -18,6 +18,8 @@
+ #define DEFINES_H
+ #include <defines.h>
+ #endif
++#include <stdlib.h>
++#include <stdio.h>
+ 
+ #ifdef HAVE_DEV_RANDOM
+ 
+--- a/shash-0.2.6/src/extra.c
++++ b/shash-0.2.6/src/extra.c
+@@ -1,4 +1,5 @@
+ #include <defines.h>
++#include <strings.h>
+ 
+ #ifdef HAVE_STAT
+ 

diff --git a/app-crypt/shash/files/shash.bash-completion 
b/app-crypt/shash/files/shash.bash-completion
new file mode 100644
index 0000000..d57701f
--- /dev/null
+++ b/app-crypt/shash/files/shash.bash-completion
@@ -0,0 +1,40 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: 
/var/cvsroot/gentoo-x86/app-crypt/shash/files/shash.bash-completion,v 1.2 
2006/10/13 15:00:13 swegener Exp $
+#
+# shash(1) completion.
+
+have shash &&
+_shash() {
+       local cur prev
+
+       COMPREPLY=()
+       cur=${COMP_WORDS[COMP_CWORD]}
+       prev=${COMP_WORDS[COMP_CWORD-1]}
+
+       case "${prev}" in
+       -c|--config)
+               _filedir
+               return 0 ;;
+       -o|--keymode)
+               COMPREPLY=( $( compgen -W "$( shash --listkeygen | tail -n +2 
)" \
+                       -- ${cur} ) )
+               return ;;
+       -a|--algorithm)
+               COMPREPLY=( $( compgen -W "$( shash --list )" \
+                       -- ${cur} ) )
+               return ;;
+       *)
+               ;;
+       esac
+       
+       COMPREPLY=( $( compgen -W '-V -q -m -d -c -b -t -o -i -a -l -k -h -v \
+               -L \
+               --verbose --quiet --nosalt --time --hmac --doublecheck \
+               --check --binary --text --keymode --config --algorithm \
+               --list --key --listkeygen --help --version --license' \
+               -- ${cur} ) )
+       _filedir
+       return 0
+} &&
+complete -F _shash ${filenames} shash

diff --git a/app-crypt/shash/metadata.xml b/app-crypt/shash/metadata.xml
new file mode 100644
index 0000000..c6d4395
--- /dev/null
+++ b/app-crypt/shash/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer>
+               <email>[email protected]</email>
+               <name>Sven Wegener</name>
+               <description>primary maintainer</description>
+       </maintainer>
+       <longdescription>shash is a command-line interface for libmhash and is 
used to generate or check digests or MACs of files.</longdescription>
+</pkgmetadata>

diff --git a/app-crypt/shash/shash-0.2.6-r99.ebuild 
b/app-crypt/shash/shash-0.2.6-r99.ebuild
new file mode 100644
index 0000000..5bcd84f
--- /dev/null
+++ b/app-crypt/shash/shash-0.2.6-r99.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/shash/shash-0.2.6-r1.ebuild,v 
1.25 2014/01/18 05:39:58 vapier Exp $
+
+inherit bash-completion eutils
+
+DESCRIPTION="Generate or check digests or MACs of files"
+HOMEPAGE="http://mcrypt.hellug.gr/shash/";
+SRC_URI="ftp://mcrypt.hellug.gr/pub/mcrypt/${PN}/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips x86"
+IUSE="static"
+
+DEPEND=">=app-crypt/mhash-0.8.18-r1"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       epatch "${FILESDIR}"/${PV}-manpage-fixes.patch
+       epatch "${FILESDIR}"/${P}-binary-files.patch
+       epatch "${FILESDIR}"/${P}-missing-includes.patch
+}
+
+src_compile() {
+       econf $(use_enable static static-link) || die "econf failed"
+       emake || die "emake failed"
+}
+
+src_install() {
+       make install DESTDIR="${D}" || die "install failed"
+       dodoc AUTHORS ChangeLog INSTALL NEWS doc/sample.shashrc doc/FORMAT
+       dobashcompletion "${FILESDIR}"/shash.bash-completion ${PN}
+}

Reply via email to