From ef77b2bf81c60940af0a9aa42b5a14f5c61b8d33 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Thu, 19 Sep 2002 20:05:56 +0000 Subject: Add ruby-password, a Ruby library to create, verify and manipulate passwords. --- security/ruby-password/Makefile | 39 ++++++++++++++++ security/ruby-password/distinfo | 1 + security/ruby-password/files/patch-extconf.rb | 64 +++++++++++++++++++++++++++ security/ruby-password/files/patch-rbcrack.c | 15 +++++++ security/ruby-password/pkg-comment | 1 + security/ruby-password/pkg-descr | 6 +++ security/ruby-password/pkg-plist | 8 ++++ 7 files changed, 134 insertions(+) create mode 100644 security/ruby-password/Makefile create mode 100644 security/ruby-password/distinfo create mode 100644 security/ruby-password/files/patch-extconf.rb create mode 100644 security/ruby-password/files/patch-rbcrack.c create mode 100644 security/ruby-password/pkg-comment create mode 100644 security/ruby-password/pkg-descr create mode 100644 security/ruby-password/pkg-plist (limited to 'security/ruby-password') diff --git a/security/ruby-password/Makefile b/security/ruby-password/Makefile new file mode 100644 index 000000000000..7b306c980f30 --- /dev/null +++ b/security/ruby-password/Makefile @@ -0,0 +1,39 @@ +# New ports collection makefile for: Ruby/Password +# Date created: 18 September 2002 +# Whom: Akinori MUSHA aka knu +# +# $FreeBSD$ +# + +PORTNAME= password +PORTVERSION= 0.2.0 +CATEGORIES= security ruby +MASTER_SITES= http://www.caliban.org/files/ruby/ +PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} +DISTNAME= ruby-${PORTNAME}-${PORTVERSION} +DIST_SUBDIR= ruby + +MAINTAINER= knu@FreeBSD.org + +BUILD_DEPENDS= ${LOCALBASE}/lib/libcrack.a:${PORTSDIR}/security/cracklib +RUN_DEPENDS= ${RUBY_SITEARCHLIBDIR}/termios.so:${PORTSDIR}/comms/ruby-termios + +USE_RUBY= yes +USE_RUBY_EXTCONF= yes + +CONFIGURE_ARGS= --with-crack-dict="${LOCALBASE}/libdata/cracklib/pw_dict.pwd" +INSTALL_TARGET= site-install + +DOCS_EN= CHANGES README doc/password.html + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${RUBY_EXAMPLESDIR}/${PORTNAME} + ${INSTALL_DATA} ${WRKSRC}/examples/*.rb ${RUBY_EXAMPLESDIR}/${PORTNAME}/ + ${MKDIR} ${RUBY_DOCDIR}/${PORTNAME} +.for f in ${DOCS_EN} + ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_DOCDIR}/${PORTNAME}/ +.endfor +.endif + +.include diff --git a/security/ruby-password/distinfo b/security/ruby-password/distinfo new file mode 100644 index 000000000000..9534b2d62b45 --- /dev/null +++ b/security/ruby-password/distinfo @@ -0,0 +1 @@ +MD5 (ruby/ruby-password-0.2.0.tar.gz) = cb6525ae6ba61ed5dba07f0fd185094b diff --git a/security/ruby-password/files/patch-extconf.rb b/security/ruby-password/files/patch-extconf.rb new file mode 100644 index 000000000000..04476b3e990d --- /dev/null +++ b/security/ruby-password/files/patch-extconf.rb @@ -0,0 +1,64 @@ +--- extconf.rb.orig Wed Jun 19 09:29:52 2002 ++++ extconf.rb Fri Sep 20 04:47:59 2002 +@@ -4,34 +4,44 @@ + + require 'mkmf' + +-CRACK_DICT = 'cracklib_dict.pwd' ++search_dicts = %w( ++/usr/local/lib/pw_dict.pwd ++/usr/lib/pw_dict.pwd ++/opt/lib/pw_dict.pwd ++/usr/local/lib/cracklib_dict.pwd ++/usr/lib/cracklib_dict.pwd ++/opt/lib/cracklib_dict.pwd ++) + +-dict = [] +-search_dirs = %w(/usr/local /usr /opt) ++if dict = with_config('crack-dict') ++ search_dicts.unshift(dict) ++end + +-# find the crack dictionary +-print "checking for #{CRACK_DICT}... " +-search_dirs.each do |d| +- dict = Dir.glob(File.join(d, "lib", CRACK_DICT)) ++crack_dict = nil + ++# find the crack dictionary ++print "checking for cracklib dictionary... " ++search_dicts.each do |dict| + # create a header file pointing to the crack dictionary +- unless dict.empty? +- puts "yes" +- path = dict[0].sub(/\.pwd/, '') +- hfile = File.new("rbcrack.h", 'w') +- hfile.printf("#define CRACK_DICT \"%s\"\n", path) +- hfile.close ++ if File.exist?(dict) ++ puts dict ++ crack_dict = dict.sub(/\.pwd/, '') + break + end +- + end + +-if dict.empty? +- puts "no\nCouldn't find #{CRACK_DICT} on this system" ++if crack_dict.nil? ++ puts "no\nCouldn't find a cracklib dictionary on this system" + exit 1 + end + +-have_library('crack', 'FascistCheck') ++hfile = File.new("rbcrack.h", 'w') ++hfile.printf("#define CRACK_DICT \"%s\"\n", crack_dict) ++hfile.close ++ ++(have_header('packer.h') || have_header('crack.h')) && ++ have_library('crack', 'FascistCheck') or exit 1 ++ + create_makefile('crack') + + File.open('Makefile', 'a') do |f| diff --git a/security/ruby-password/files/patch-rbcrack.c b/security/ruby-password/files/patch-rbcrack.c new file mode 100644 index 000000000000..e47328ea5f62 --- /dev/null +++ b/security/ruby-password/files/patch-rbcrack.c @@ -0,0 +1,15 @@ +--- rbcrack.c.orig Wed Sep 18 16:45:57 2002 ++++ rbcrack.c Fri Sep 20 04:46:38 2002 +@@ -5,7 +5,11 @@ + */ + + #include "ruby.h" +-#include "crack.h" ++#ifdef HAVE_PACKER_H ++#include ++#else ++#include ++#endif + #include "rbcrack.h" + + #define CRACK_VERSION "0.2.0" diff --git a/security/ruby-password/pkg-comment b/security/ruby-password/pkg-comment new file mode 100644 index 000000000000..4e3bb15b3baf --- /dev/null +++ b/security/ruby-password/pkg-comment @@ -0,0 +1 @@ +A Ruby library to create, verify and manipulate passwords diff --git a/security/ruby-password/pkg-descr b/security/ruby-password/pkg-descr new file mode 100644 index 000000000000..985bbd94a5c7 --- /dev/null +++ b/security/ruby-password/pkg-descr @@ -0,0 +1,6 @@ +Ruby/Password comprises a set of useful methods for creating, +verifying and manipulating passwords. It includes an interface to +CrackLib, a library commonly used for checking password strength. + +WWW: http://www.caliban.org/ruby/ruby-password.shtml +Author: Ian Macdonald diff --git a/security/ruby-password/pkg-plist b/security/ruby-password/pkg-plist new file mode 100644 index 000000000000..82f55ed5ce3c --- /dev/null +++ b/security/ruby-password/pkg-plist @@ -0,0 +1,8 @@ +%%RUBY_SITEARCHLIBDIR%%/crack.so +%%RUBY_SITELIBDIR%%/password.rb +%%PORTDOCS%%%%RUBY_EXAMPLESDIR%%/password/example.rb +%%PORTDOCS%%@dirrm %%RUBY_EXAMPLESDIR%%/password +%%PORTDOCS%%%%RUBY_DOCDIR%%/password/CHANGES +%%PORTDOCS%%%%RUBY_DOCDIR%%/password/README +%%PORTDOCS%%%%RUBY_DOCDIR%%/password/password.html +%%PORTDOCS%%@dirrm %%RUBY_DOCDIR%%/password -- cgit v1.2.3