diff --git a/security/pcsc-cyberjack/Makefile b/security/pcsc-cyberjack/Makefile new file mode 100644 index 000000000000..48d3e4acf535 --- /dev/null +++ b/security/pcsc-cyberjack/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +PORTNAME= pcsc-cyberjack +PORTVERSION= 3.99.5.12 +DISTVERSION= 3.99.5final.SP12 +CATEGORIES= security +MASTER_SITES= http://downloads.reiner-sct.de/LINUX/V3.99.5_SP12/ +DISTNAME= pcsc-cyberjack-${DISTVERSION} + +MAINTAINER= netchild@FreeBSD.org +COMMENT= Reiner SCT cyberJack card reader pcsc driver + +LIB_DEPENDS= libpcsclite.so:devel/pcsc-lite \ + libxml2.so:textproc/libxml2 + +LICENSE= GPLv2 LGPL20 +LICENSE_COMB= dual +LICENSE_FILE_GPLv2= ${WRKSRC}/COPYRIGHT.GPL +LICENSE_FILE_LGPL20= ${WRKSRC}/COPYRIGHT.LGPL + +WRKSRC= ${WRKDIR}/pcsc-cyberjack-${DISTVERSION} + +USES= gmake libtool tar:bzip2 autoreconf compiler:gcc-c++11-lib + +GNU_CONFIGURE= yes + +CONFIGURE_ARGS= --enable-release --with-usbdropdir=${PREFIX}/lib/pcsc/drivers +CONFIGURE_ENV= LIBUSB_CFLAGS="-I${LOCALBASE}/include" \ + LIBUSB_LIBS="-L${LOCALBASE}/lib -lusb" +CXXFLAGS+= -Wno-c++11-narrowing +CPPFLAGS+= -I${LOCALBASE}/include ${PTHREAD_CFLAGS} +LDFLAGS+= ${PTHREAD_LIBS} + +PLIST_SUB= VER=${PORTVERSION} + +MAN8= cyberjack.8 + +.include diff --git a/security/pcsc-cyberjack/distinfo b/security/pcsc-cyberjack/distinfo new file mode 100644 index 000000000000..07eb4ca3b72d --- /dev/null +++ b/security/pcsc-cyberjack/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1530015110 +SHA256 (pcsc-cyberjack-3.99.5final.SP12.tar.bz2) = 32dc370111119a86ca598154b82b72d8c0a003dd09342a6d2fda14aa96aff312 +SIZE (pcsc-cyberjack-3.99.5final.SP12.tar.bz2) = 957583 diff --git a/security/pcsc-cyberjack/files/patch-Platform_unix.h b/security/pcsc-cyberjack/files/patch-Platform_unix.h new file mode 100644 index 000000000000..ad62a13fb5c7 --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-Platform_unix.h @@ -0,0 +1,11 @@ +--- include/driver/Platform_unix.h.orig 2013-01-19 22:19:15.826736863 +0100 ++++ include/driver/Platform_unix.h 2013-01-19 22:20:42.815736285 +0100 +@@ -39,7 +39,7 @@ + #include + #include + +-#ifndef OS_DARWIN ++#if !defined(OS_DARWIN) && !defined(OS_FREEBSD) + # include + #endif + diff --git a/security/pcsc-cyberjack/files/patch-cm_distri.cpp b/security/pcsc-cyberjack/files/patch-cm_distri.cpp new file mode 100644 index 000000000000..9df449febb21 --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-cm_distri.cpp @@ -0,0 +1,24 @@ +--- libcyberjack/checksuite/cm_distri.cpp.orig 2018-06-26 14:29:27.056505000 +0200 ++++ libcyberjack/checksuite/cm_distri.cpp 2018-06-26 14:30:14.869438000 +0200 +@@ -10,8 +10,9 @@ + ***************************************************************************/ + + ++#include "config.h" ++#include "Platform.h" + +- + #include "cm_distri.h" + #include "checksuite.h" + +@@ -21,6 +22,10 @@ + #include + #include + ++#ifdef OS_FREEBSD ++#include ++#include ++#endif + + + bool CM_Distri::check(std::string &xmlString, diff --git a/security/pcsc-cyberjack/files/patch-configure.ac b/security/pcsc-cyberjack/files/patch-configure.ac new file mode 100644 index 000000000000..2eee6ab044a6 --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-configure.ac @@ -0,0 +1,10 @@ +--- configure.ac.orig 2018-06-26 15:26:28.648441000 +0200 ++++ configure.ac 2018-06-26 15:26:51.565030000 +0200 +@@ -219,6 +219,7 @@ + AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"]) + AM_CONDITIONAL(IS_OSX, [test "$OSYSTEM" = "osx"]) + AM_CONDITIONAL(IS_LINUX, [test "$OSYSTEM" = "linux"]) ++AM_CONDITIONAL(IS_FREEBSD, [test "$OSYSTEM" = "freebsd"]) + + AC_SUBST(cyberjack_sys_is_windows) + AC_SUBST(cyberjack_config_file) diff --git a/security/pcsc-cyberjack/files/patch-dialog.c b/security/pcsc-cyberjack/files/patch-dialog.c new file mode 100644 index 000000000000..f663a8b866f1 --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-dialog.c @@ -0,0 +1,87 @@ +--- libcyberjack/libdialog/dialog.c.orig 2011-11-11 08:13:13.000000000 +0100 ++++ libcyberjack/libdialog/dialog.c 2013-01-19 23:05:27.659736536 +0100 +@@ -22,7 +22,7 @@ + * * + ***************************************************************************/ + +- ++#include "config.h" + #include "Platform.h" + #include "dialog_p.h" + #include "network.h" +@@ -30,7 +30,11 @@ + #include + #include + #include ++#ifdef OS_FREEBSD ++#include ++#else + #include ++#endif + + #include + #include +@@ -120,11 +124,19 @@ + + static int rsct_dialog_mk_socket() { + char buffer[256]; ++#ifdef OS_FREEBSD ++ struct utmpx *u_tmp_p; ++#else + struct utmp *u_tmp_p; ++#endif + struct passwd *pw; + int sk; + ++#ifdef OS_FREEBSD ++ while ((u_tmp_p = getutxent()) != NULL) { ++#else + while ((u_tmp_p = getutent()) != NULL) { ++#endif + DEBUGPI("RSCT: ut_type=%d, ut_line=[%s]\n", + u_tmp_p->ut_type, + u_tmp_p->ut_line); +@@ -136,7 +148,11 @@ + + if (u_tmp_p==NULL) { + DEBUGPE("RSCT: No user logged in at XServer :0 (%s (%d))\n", strerror(errno), errno); ++#ifdef OS_FREEBSD ++ endutxent(); ++#else + endutent(); ++#endif + return -1; + } + +@@ -144,18 +160,31 @@ + if (pw==NULL) { + DEBUGPE("RSCT: Could not get home folder for user [%s]: %s (%d)\n", + u_tmp_p->ut_user, strerror(errno), errno); ++#ifdef OS_FREEBSD ++ endutxent(); ++#else + endutent(); ++#endif + return -1; + } + + if (pw->pw_dir==NULL || *(pw->pw_dir)==0) { + DEBUGPE("RSCT: User [%s] has no home folder\n", u_tmp_p->ut_user); ++#ifdef OS_FREEBSD ++ endutxent(); ++#else + endutent(); ++#endif + return -1; + } + strncpy(buffer, pw->pw_dir, sizeof(buffer)-1); + strncat(buffer, "/.cyberJack_gui_sock", sizeof(buffer)-1); ++#ifdef OS_FREEBSD ++ endutxent(); ++#else + endutent(); ++#endif ++ + + sk=rsct_net_connect_by_path(buffer); + if (sk==-1) { diff --git a/security/pcsc-cyberjack/files/patch-ifd-Makefile.am b/security/pcsc-cyberjack/files/patch-ifd-Makefile.am new file mode 100644 index 000000000000..565a3bf9751b --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-ifd-Makefile.am @@ -0,0 +1,14 @@ +--- ifd/Makefile.am.orig 2018-06-26 15:11:01.895689000 +0200 ++++ ifd/Makefile.am 2018-06-26 15:11:49.437588000 +0200 +@@ -23,6 +23,11 @@ + bundleosx_LTLIBRARIES=libifd-cyberjack.la + endif + ++if IS_FREEBSD ++bundlefreebsddir=$(usbdropdir)/libifd-cyberjack.bundle/Contents/FreeBSD ++bundlefreebsd_LTLIBRARIES=libifd-cyberjack.la ++endif ++ + libifd_cyberjack_la_SOURCES=ifd.cpp + libifd_cyberjack_la_LDFLAGS=-version-info @CYBERJACK_SO_CURRENT@:@CYBERJACK_SO_REVISION@:@CYBERJACK_SO_AGE@ -no-undefined + #libifd_cyberjack_la_LIBADD=$(top_builddir)/cjeca32/libeca.la $(top_builddir)/cjeca32/ausb/libausb.la diff --git a/security/pcsc-cyberjack/files/patch-os_freebsd b/security/pcsc-cyberjack/files/patch-os_freebsd new file mode 100644 index 000000000000..bdd1fac180f6 --- /dev/null +++ b/security/pcsc-cyberjack/files/patch-os_freebsd @@ -0,0 +1,41 @@ +--- cjeca32/Debug.cpp.orig 2013-01-19 22:30:58.983736881 +0100 ++++ cjeca32/Debug.cpp 2013-01-19 22:35:24.457770463 +0100 +@@ -139,7 +139,7 @@ + + + +-#elif defined(OS_LINUX) || defined(OS_DARWIN) ++#elif defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD) + + #if defined(OS_DARWIN) + # define DEBUG_DEFAULT_LOGFILE "/Library/Logs/cj.log" +--- cjeca32/RSCTCriticalSection.cpp.orig 2013-01-19 22:30:58.986736570 +0100 ++++ cjeca32/RSCTCriticalSection.cpp 2013-01-19 22:33:42.206737418 +0100 +@@ -22,7 +22,7 @@ + LeaveCriticalSection(&m_hCritSec); + } + +-#elif defined(OS_LINUX) ++#elif defined(OS_LINUX) || defined(OS_FREEBSD) + + CRSCTCriticalSection::CRSCTCriticalSection(void){ + } +--- include/driver/Debug.h.orig 2013-01-19 22:30:58.992736009 +0100 ++++ include/driver/Debug.h 2013-01-19 22:35:43.141747628 +0100 +@@ -42,14 +42,14 @@ + public: + ~CDebug(void); + +-#if defined(OS_LINUX) || defined(OS_DARWIN) ++#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD) + void setLevelMask(unsigned int nLevelMask); + void setLogFileName(const char *fname); + #endif + + private: + unsigned int m_nLevelMask; +-#if defined(OS_LINUX) || defined(OS_DARWIN) ++#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD) + char *m_logFileName; + #endif + }; diff --git a/security/pcsc-cyberjack/pkg-descr b/security/pcsc-cyberjack/pkg-descr new file mode 100644 index 000000000000..bd4c56407c49 --- /dev/null +++ b/security/pcsc-cyberjack/pkg-descr @@ -0,0 +1 @@ +pcsc-lite driver for the Reiner SCT cyberJack card readers diff --git a/security/pcsc-cyberjack/pkg-plist b/security/pcsc-cyberjack/pkg-plist new file mode 100644 index 000000000000..9437d2c26dc3 --- /dev/null +++ b/security/pcsc-cyberjack/pkg-plist @@ -0,0 +1,6 @@ +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/FreeBSD/libifd-cyberjack.a +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/FreeBSD/libifd-cyberjack.so +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/FreeBSD/libifd-cyberjack.so.6 +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/FreeBSD/libifd-cyberjack.so.6.0.0 +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/Info.plist +lib/pcsc/drivers/libifd-cyberjack.bundle/Contents/PkgInfo