Subject: [alpine-devel] new aports: kerberos authentication support for apache2

From: Francesco <[email-masked]>
Date: Mon, 3 Jan 2011 17:20:01 +0100

Please review and commit, thanks.

:: Francesco Colista
:: Email : [email-masked]
:: Jabber: [email-masked]
From 949ef6effca441981afb5b53df46adf9bc8e6dce Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Mon, 3 Jan 2011 16:20:16 +0000
Subject: [PATCH] New aports: apache-mod-auth-kerb

---
 testing/apache-mod-auth-kerb/APKBUILD            |   45 ++++++++++++++++++++++
 testing/apache-mod-auth-kerb/mod-auth-kerb.conf  |   26 ++++++++++++
 testing/apache-mod-auth-kerb/mod_auth_kerb.patch |   11 +++++
 3 files changed, 82 insertions(+), 0 deletions(-)
 create mode 100644 testing/apache-mod-auth-kerb/APKBUILD
 create mode 100644 testing/apache-mod-auth-kerb/mod-auth-kerb.conf
 create mode 100644 testing/apache-mod-auth-kerb/mod_auth_kerb.patch

diff --git a/testing/apache-mod-auth-kerb/APKBUILD b/testing/apache-mod-auth-kerb/APKBUILD
new file mode 100644
index 0000000..16bc7fb
--- /dev/null
+++ b/testing/apache-mod-auth-kerb/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor: Francesco Colista <[email-masked]> 
+# Maintainer: Francesco Colista <[email-masked]> 
+pkgname=apache-mod-auth-kerb
+_pkgname=mod_auth_kerb
+pkgver=5.4
+pkgrel=0
+pkgdesc="A Kerberos authentication module for the Apache Http Server"
+url="http://samba.org/ftp/unpacked/lorikeet/mod_auth_ntlm_winbind/"
+arch="x86 x86_64"
+license="custom"
+depends="apache2 heimdal"
+makedepends="apache2-dev heimdal-dev samba-dev bash"
+source="http://downloads.sourceforge.net/project/modauthkerb/$_pkgname/$_pkgname-$pkgver/$_pkgname-$pkgver.tar.gz
+	mod_auth_kerb.patch
+	mod-auth-kerb.conf
+	"
+prepare() {
+	cd $srcdir/$_pkgname-$pkgver
+	for i in "$srcdir"/*.patch; do
+		[ -f "$i" ] || continue
+		msg "Applying $i"
+		patch -p1 -i $i || return 1
+	done
+	sed -i -e 's:^ret.*:ret=`eval "$4" $5 $cppflags $ldflags src/mod_auth_kerb.c $3`:' apxs.sh	
+}
+
+build() {
+	cd $srcdir/$_pkgname-$pkgver
+		./configure --prefix=/usr \
+		--with-krb5=/usr
+	make -j6 || return 1
+}
+
+package() {
+	cd $srcdir/$_pkgname-$pkgver
+#	make DESTDIR="$pkgdir" install || return 1
+	mkdir -p "$pkgdir"/etc/apache2/conf.d
+	mkdir -p "$pkgdir"/usr/lib/apache2
+	install -D -m755 ./src/.libs/*.so "$pkgdir"/usr/lib/apache2
+	install -D -m644 ../../mod-auth-kerb.conf "$pkgdir"/etc/apache2/conf.d/mod-auth-kerb.conf
+}
+
+md5sums="642b81763ad3ca81dba359cb952da5e3  mod_auth_kerb-5.4.tar.gz
+3ef3cd9c723f34a2ee7ab350b7c653c9  mod_auth_kerb.patch
+7f9a0976ff101226fae4fd9b811b21a4  mod-auth-kerb.conf"
diff --git a/testing/apache-mod-auth-kerb/mod-auth-kerb.conf b/testing/apache-mod-auth-kerb/mod-auth-kerb.conf
new file mode 100644
index 0000000..24310d6
--- /dev/null
+++ b/testing/apache-mod-auth-kerb/mod-auth-kerb.conf
@@ -0,0 +1,26 @@
+#
+# The mod_auth_kerb module implements Kerberos authentication over
+# HTTP, following the "Negotiate" protocol.
+# 
+
+LoadModule auth_kerb_module modules/mod_auth_kerb.so
+
+#
+# Sample configuration: Kerberos authentication must only be
+# used over SSL to prevent replay attacks.  The keytab file
+# configured must be readable only by the "apache" user, and
+# must contain service keys for "HTTP/www.example.com", where
+# "www.example.com" is the FQDN of this server.
+#
+
+#<Location /private>
+#  SSLRequireSSL
+#  AuthType Kerberos
+#  AuthName "Kerberos Login"
+#  KrbMethodNegotiate On
+#  KrbMethodK5Passwd Off
+#  KrbAuthRealms EXAMPLE.COM
+#  Krb5KeyTab /etc/httpd/conf/keytab
+#  require valid-user
+#</Location>
+
diff --git a/testing/apache-mod-auth-kerb/mod_auth_kerb.patch b/testing/apache-mod-auth-kerb/mod_auth_kerb.patch
new file mode 100644
index 0000000..aa0c0a4
--- /dev/null
+++ b/testing/apache-mod-auth-kerb/mod_auth_kerb.patch
@@ -0,0 +1,11 @@
+--- mod_auth_kerb-5.4/src/mod_auth_kerb.c	2010-10-04 16:21:22.169285716 +0200
++++ mod_auth_kerb-5.4.new/src/mod_auth_kerb.c	2010-10-04 16:20:41.584250095 +0200
+@@ -89,6 +89,7 @@
+ #include <krb5.h>
+ #ifdef HEIMDAL
+ #  include <gssapi.h>
++#  include <gssapi/gssapi_krb5.h>
+ #else
+ #  include <gssapi/gssapi.h>
+ #  include <gssapi/gssapi_generic.h>
+
-- 
1.7.3.2

---

From: Natanael Copa <[email-masked]>
Date: Tue, 4 Jan 2011 09:09:07 +0100

On Mon, 3 Jan 2011 17:20:01 +0100

> Please review and commit, thanks.

Applied. Thanks!

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---