From d368be8948a43b52c6a86656c6ddce8eca6fa406 Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Sat, 17 Oct 2015 23:12:23 +0700 Subject: libraries/libu2f-host: Added (Yubico 2UF C Library). Signed-off-by: Willy Sudiarto Raharjo --- libraries/libu2f-host/README | 4 + libraries/libu2f-host/libu2f-host.SlackBuild | 108 +++++++++++++++++++++++++++ libraries/libu2f-host/libu2f-host.info | 10 +++ libraries/libu2f-host/makefile.patch | 26 +++++++ libraries/libu2f-host/slack-desc | 19 +++++ 5 files changed, 167 insertions(+) create mode 100644 libraries/libu2f-host/README create mode 100644 libraries/libu2f-host/libu2f-host.SlackBuild create mode 100644 libraries/libu2f-host/libu2f-host.info create mode 100644 libraries/libu2f-host/makefile.patch create mode 100644 libraries/libu2f-host/slack-desc (limited to 'libraries') diff --git a/libraries/libu2f-host/README b/libraries/libu2f-host/README new file mode 100644 index 0000000000..2673e9fda8 --- /dev/null +++ b/libraries/libu2f-host/README @@ -0,0 +1,4 @@ +Yubico Universal 2nd Factor (U2F) Host C Library + +Libu2f-host provide a C library and command-line tool that implements +the host-side of the U2F protocol. diff --git a/libraries/libu2f-host/libu2f-host.SlackBuild b/libraries/libu2f-host/libu2f-host.SlackBuild new file mode 100644 index 0000000000..1b973391f7 --- /dev/null +++ b/libraries/libu2f-host/libu2f-host.SlackBuild @@ -0,0 +1,108 @@ +#!/bin/sh + +# Slackware build script for libu2f-host + +# Copyright 2015 Willy Sudiarto Raharjo +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=libu2f-host +SRCNAM=libu2f-host-libu2f-host +VERSION=${VERSION:-1.0.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $SRCNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 < $CWD/makefile.patch + +autoreconf -fi +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --enable-static=no \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/etc/udev/rules.d/ +cp 70-u2f.rules $PKG/etc/udev/rules.d/ + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS BLURB COPYING* NEWS README THANKS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/libraries/libu2f-host/libu2f-host.info b/libraries/libu2f-host/libu2f-host.info new file mode 100644 index 0000000000..a58bfee85e --- /dev/null +++ b/libraries/libu2f-host/libu2f-host.info @@ -0,0 +1,10 @@ +PRGNAM="libu2f-host" +VERSION="1.0.0" +HOMEPAGE="https://github.com/Yubico/libu2f-host" +DOWNLOAD="https://github.com/Yubico/libu2f-host/archive/libu2f-host-1.0.0.tar.gz" +MD5SUM="34041578e81e6fe7017402908e30e768" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="hidapi json-c gengetopt" +MAINTAINER="Willy Sudiarto Raharjo" +EMAIL="willysr@slackbuilds.org" diff --git a/libraries/libu2f-host/makefile.patch b/libraries/libu2f-host/makefile.patch new file mode 100644 index 0000000000..7a73947b7e --- /dev/null +++ b/libraries/libu2f-host/makefile.patch @@ -0,0 +1,26 @@ +From f241518e0dfd896eee6886aad2f3f6f8ef83f6da Mon Sep 17 00:00:00 2001 +From: Christian Hesse +Date: Tue, 14 Oct 2014 11:25:54 +0200 +Subject: [PATCH 1/1] Makefile: make help2man depend on u2f-host, not + u2f-host.c + +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index e9159a7..1afdddd 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -35,7 +35,7 @@ MAINTAINERCLEANFILES = $(BUILT_SOURCES) + dist_man_MANS = u2f-host.1 + DISTCLEANFILES = $(dist_man_MANS) + +-u2f-host.1: $(srcdir)/u2f-host.c $(srcdir)/cmdline.ggo $(top_srcdir)/configure.ac ++u2f-host.1: $(builddir)/u2f-host$(EXEEXT) $(srcdir)/cmdline.ggo $(top_srcdir)/configure.ac + $(AM_V_GEN)$(HELP2MAN) \ + --output=$@ $(builddir)/u2f-host$(EXEEXT) \ + --name="Yubico Universal 2nd Factor (U2F) Host Tool" \ +-- +2.1.2 + diff --git a/libraries/libu2f-host/slack-desc b/libraries/libu2f-host/slack-desc new file mode 100644 index 0000000000..bb25452896 --- /dev/null +++ b/libraries/libu2f-host/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +libu2f-host: libu2f-host (Yubico 2UF C Library) +libu2f-host: +libu2f-host: Libu2f-host provide a C library and command-line tool that implements +libu2f-host: the host-side of the U2F protocol. +libu2f-host: +libu2f-host: +libu2f-host: +libu2f-host: Project URL: https://github.com/Yubico/libu2f-host +libu2f-host: +libu2f-host: +libu2f-host: -- cgit v1.2.3