2010-03-14 20:57:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ldapvi < Formula
|
2010-03-14 20:57:13 +00:00
|
|
|
homepage 'http://www.lichteblau.com/ldapvi/'
|
2012-09-04 18:37:39 +00:00
|
|
|
url 'http://www.lichteblau.com/download/ldapvi-1.7.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'd1cde4cbb618180f9ae0e77c56a1520b8ad61c9a'
|
2010-03-14 20:57:13 +00:00
|
|
|
|
2013-02-10 06:28:12 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-03-14 20:57:13 +00:00
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'glib'
|
|
|
|
depends_on 'popt'
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on 'readline'
|
2010-03-14 20:57:13 +00:00
|
|
|
|
2011-09-05 09:34:54 +00:00
|
|
|
# Backporting the fix from the devel version
|
|
|
|
# (namespace conflict with Lion's getline function)
|
|
|
|
# http://www.lichteblau.com/git/?p=ldapvi.git;a=commit;h=256ced029c235687bfafdffd07be7d47bf7af39b
|
2012-08-15 15:17:32 +00:00
|
|
|
# Also fix compilation with clang by changing `return` to `return 0`.
|
2011-09-05 09:34:54 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2012-09-04 18:37:39 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-03-14 20:57:13 +00:00
|
|
|
end
|
2011-09-05 09:34:54 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff -rupN ldapvi-1.7-orig/common.h ldapvi-1.7-new/common.h
|
|
|
|
--- ldapvi-1.7-orig/common.h 2007-05-05 12:17:26.000000000 +0200
|
|
|
|
+++ ldapvi-1.7-new/common.h 2011-09-02 21:40:45.000000000 +0200
|
|
|
|
@@ -273,7 +273,7 @@ void pipeview_wait(int pid);
|
|
|
|
char *home_filename(char *name);
|
|
|
|
void read_ldapvi_history(void);
|
|
|
|
void write_ldapvi_history(void);
|
|
|
|
-char *getline(char *prompt, char *value);
|
|
|
|
+char *ldapvi_getline(char *prompt, char *value);
|
|
|
|
char *get_password();
|
|
|
|
char *append(char *a, char *b);
|
|
|
|
void *xalloc(size_t size);
|
|
|
|
diff -rupN ldapvi-1.7-orig/ldapvi.c ldapvi-1.7-new/ldapvi.c
|
|
|
|
--- ldapvi-1.7-orig/ldapvi.c 2007-05-05 12:17:26.000000000 +0200
|
|
|
|
+++ ldapvi-1.7-new/ldapvi.c 2011-09-02 21:41:17.000000000 +0200
|
|
|
|
@@ -470,7 +470,7 @@ change_mechanism(bind_options *bo)
|
|
|
|
bo->authmethod = LDAP_AUTH_SASL;
|
|
|
|
puts("Switching to SASL authentication.");
|
|
|
|
}
|
|
|
|
- bo->sasl_mech = getline("SASL mechanism", bo->sasl_mech);
|
|
|
|
+ bo->sasl_mech = ldapvi_getline("SASL mechanism", bo->sasl_mech);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
diff -rupN ldapvi-1.7-orig/misc.c ldapvi-1.7-new/misc.c
|
|
|
|
--- ldapvi-1.7-orig/misc.c 2007-05-05 12:17:26.000000000 +0200
|
|
|
|
+++ ldapvi-1.7-new/misc.c 2011-09-02 21:41:45.000000000 +0200
|
|
|
|
@@ -315,7 +315,7 @@ write_ldapvi_history()
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
-getline(char *prompt, char *value)
|
|
|
|
+ldapvi_getline(char *prompt, char *value)
|
|
|
|
{
|
|
|
|
tdialog d;
|
|
|
|
init_dialog(&d, DIALOG_DEFAULT, prompt, value);
|
2012-08-15 15:17:32 +00:00
|
|
|
--- ldapvi-1.7/ldapvi.c 2012-08-15 10:58:23.000000000 -0400
|
|
|
|
+++ ldapvi-1.7/ldapvi.c.new 2012-08-15 10:58:12.000000000 -0400
|
|
|
|
@@ -1465,7 +1465,7 @@
|
|
|
|
int line = 0;
|
|
|
|
int c;
|
|
|
|
|
|
|
|
- if (lstat(sasl, &st) == -1) return;
|
|
|
|
+ if (lstat(sasl, &st) == -1) return 0;
|
|
|
|
if ( !(in = fopen(sasl, "r"))) syserr();
|
|
|
|
|
|
|
|
if (st.st_size > 0) {
|