OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 13-Jan-2007 22:18:21 Branch: HEAD Handle: 2007011321181600 Added files: openpkg-src/heimdal fsl.heimdal heimdal-setup.sh heimdal.patch heimdal.spec kdc.conf krb5.conf rc.heimdal Log: new package: heimdal 0.7.2 (Kerberos Network Authentication System) Summary: Revision Changes Path 1.1 +16 -0 openpkg-src/heimdal/fsl.heimdal 1.1 +68 -0 openpkg-src/heimdal/heimdal-setup.sh 1.1 +21 -0 openpkg-src/heimdal/heimdal.patch 1.1 +238 -0 openpkg-src/heimdal/heimdal.spec 1.1 +12 -0 openpkg-src/heimdal/kdc.conf 1.1 +21 -0 openpkg-src/heimdal/krb5.conf 1.1 +101 -0 openpkg-src/heimdal/rc.heimdal ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/heimdal/fsl.heimdal ============================================================================ $ cvs diff -u -r0 -r1.1 fsl.heimdal --- /dev/null 2007-01-13 22:15:14 +0100 +++ fsl.heimdal 2007-01-13 22:18:17 +0100 @@ -0,0 +1,16 @@ +## +## fsl.heimdal -- OSSP fsl configuration +## + +ident (krlogind|krshd|login|ftpd|sserver|telnetd|kpropd)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/heimdal/heimdal.log", + perm=0644 + ) + } +}; + @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/heimdal-setup.sh ============================================================================ $ cvs diff -u -r0 -r1.1 heimdal-setup.sh --- /dev/null 2007-01-13 22:15:14 +0100 +++ heimdal-setup.sh 2007-01-13 22:18:17 +0100 @@ -0,0 +1,68 @@ [EMAIL PROTECTED]@ +## +## heimdal-setup -- Kerberos database setup procedure +## + +if [ $# -ne 2 ]; then + echo "USAGE: $0 <realm> <domain>" + echo "EXAMPLE: $0 EXAMPLE.COM example.com" + exit 1 +fi + +realm=`echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +domain=`echo "$2" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` [EMAIL PROTECTED]@/lib/openpkg/shtool echo -e "%h.$domain"` + +echo "++ configure Kerberos realm \"$realm\"" +sed <@l_prefix@/etc/heimdal/kdc.conf \ + >@l_prefix@/etc/heimdal/kdc.conf.new \ + -e "s;EXAMPLE\.COM;$realm;g" \ + -e "s;example\.com;$domain;g" +cp -p @l_prefix@/etc/heimdal/kdc.conf.new @l_prefix@/etc/heimdal/kdc.conf +rm -f @l_prefix@/etc/heimdal/kdc.conf.new +sed <@l_prefix@/etc/heimdal/krb5.conf \ + >@l_prefix@/etc/heimdal/krb5.conf.new \ + -e "s;kerberos1\.example\.com;$host;" \ + -e "s;kerberos2\.example\.com;$host;" \ + -e "s;EXAMPLE\.COM;$realm;g" \ + -e "s;example\.com;$domain;g" +cp -p @l_prefix@/etc/heimdal/krb5.conf.new @l_prefix@/etc/heimdal/krb5.conf +rm -f @l_prefix@/etc/heimdal/krb5.conf.new + +echo "++ initialize Kerberos database" [EMAIL PROTECTED]@/sbin/kstash --random-key [EMAIL PROTECTED]@/var/heimdal/heimdal.mkey +( echo -n "init" + echo -n " --realm-max-ticket-life=unlimited" + echo -n " --realm-max-renewable-life=unlimited" + echo -n " $realm" + echo "" +) | @l_prefix@/sbin/kadmin -l -p admin/admin + +echo "++ adding administrator \"[EMAIL PROTECTED]" to the ACL" +echo "*/[EMAIL PROTECTED] all" >@l_prefix@/etc/heimdal/heimdal.acl +chmod 600 @l_prefix@/etc/heimdal/heimdal.acl + +echo "++ adding administrator \"[EMAIL PROTECTED]" to the Kerberos database" +( echo -n "add" + echo -n " --password=admin" + echo -n " --max-ticket-life=1day --max-renewable-life=1week" + echo -n " --expiration-time=never --pw-expiration-time=never" + echo -n " --attributes=" + echo -n " admin/[EMAIL PROTECTED]" + echo "" +) | @l_prefix@/sbin/kadmin -l -p admin/admin + +echo "++ adding local host \"host/$host\" to the Kerberos database" +( echo -n "add" + echo -n " --random-key" + echo -n " --max-ticket-life=1day --max-renewable-life=1week" + echo -n " --expiration-time=never --pw-expiration-time=never" + echo -n " --attributes=" + echo -n " host/$host" + echo "" +) | @l_prefix@/sbin/kadmin -l -p admin/admin + +echo "++ creating keytab file for local host \"host/$host\"" +( echo "ext_keytab host/$host" +) | @l_prefix@/sbin/kadmin -l -p admin/admin + @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/heimdal.patch ============================================================================ $ cvs diff -u -r0 -r1.1 heimdal.patch --- /dev/null 2007-01-13 22:15:14 +0100 +++ heimdal.patch 2007-01-13 22:18:17 +0100 @@ -0,0 +1,21 @@ +Index: Makefile.in +--- Makefile.in.orig 2006-02-06 14:31:14 +0100 ++++ Makefile.in 2007-01-13 18:02:32 +0100 +@@ -105,7 +105,7 @@ + uninstall-recursive + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = include lib kuser kdc admin kadmin kpasswd kcm appl doc \ ++DIST_SUBDIRS = include lib kuser kdc admin kadmin kpasswd kcm doc \ + tools + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) +@@ -367,7 +367,7 @@ + @[EMAIL PROTECTED] = $(top_builddir)/lib/tsasl/libtsasl.la + @[EMAIL PROTECTED] = $(top_builddir)/lib/kdfs/libkdfs.la + @[EMAIL PROTECTED] = kcm +-SUBDIRS = include lib kuser kdc admin kadmin kpasswd $(kcm_dir) appl doc tools ++SUBDIRS = include lib kuser kdc admin kadmin kpasswd $(kcm_dir) doc tools + ACLOCAL_AMFLAGS = -I cf + EXTRA_DIST = Makefile.am.common krb5.conf + all: all-recursive @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/heimdal.spec ============================================================================ $ cvs diff -u -r0 -r1.1 heimdal.spec --- /dev/null 2007-01-13 22:15:14 +0100 +++ heimdal.spec 2007-01-13 22:18:17 +0100 @@ -0,0 +1,238 @@ +## +## heimdal.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/> +## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/> +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS 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. +## + +# package information +Name: heimdal +Summary: Kerberos Network Authentication System +URL: http://www.pdc.kth.se/heimdal/ +Vendor: KTH SE +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Cryptography +License: BSD +Version: 0.7.2 +Release: 20070113 + +# package options +%option with_fsl yes + +# list of sources +Source0: ftp://ftp.pdc.kth.se/pub/heimdal/src/heimdal-%{version}.tar.gz +Source1: rc.heimdal +Source2: fsl.heimdal +Source3: krb5.conf +Source4: kdc.conf +Source5: heimdal-setup.sh +Patch0: heimdal.patch +Patch1: ftp://ftp.pdc.kth.se/pub/heimdal/src/heimdal-%{version}-setuid-patch.txt + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823, bison, flex +PreReq: OpenPKG, openpkg >= 20060823 +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl >= 1.2.0 +PreReq: fsl >= 1.2.0 +%endif +BuildPreReq: readline, openssl, db +PreReq: readline, openssl, db +AutoReq: no +AutoReqProv: no +Conflicts: kerberos + +%description + Kerberos is a network authentication protocol. It is designed + to provide strong authentication for client/server applications + by using secret-key cryptography. This is the free Heimdal + implementation of this protocol, as available from KTH. Kerberos is + available in many commercial products as well. + +%track + prog heimdal = { + version = %{version} + url = ftp://ftp.pdc.kth.se/pub/heimdal/src/ + regex = heimdal-(__VER__)\.tar\.gz + } + +%prep + %setup -q + %patch -p0 -P 0 + %patch -p1 -P 1 + +%build + # configure toolkit + %{l_shtool} subst \ + -e 's;/krb5.conf:/etc/krb5.conf;%{l_prefix}/etc/heimdal/krb5.conf;g' \ + lib/krb5/constants.c + %{l_shtool} subst \ + -e 's;/var/heimdal;%{l_prefix}/var/heimdal/db;g' \ + lib/hdb/hdb.h + %{l_shtool} subst \ + -e 's;/var/run/;%{l_prefix}/var/heimdal/run/;g' \ + lib/roken/roken-common.h + %{l_shtool} subst \ + -e 's;HDB_DB_DIR "/kdc.conf";"%{l_prefix}/etc/heimdal/kdc.conf";g' \ + kadmin/kadmin.c kadmin/kadmind.c kdc/kdc_locl.h kpasswd/kpasswdd.c + ( echo "ac_cv_prog_COMPILE_ET=" + ) >config.cache + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + ./configure \ + --cache-file=./config.cache \ + --prefix=%{l_prefix} \ + --includedir=%{l_prefix}/include/heimdal \ + --libdir=%{l_prefix}/lib/heimdal \ + --libexecdir=%{l_prefix}/sbin \ + --localstatedir=%{l_prefix}/var/heimdal/db \ + --without-x \ + --with-readline=%{l_prefix} \ + --with-readline-lib=%{l_prefix}/lib \ + --with-readline-include=%{l_prefix}/include \ + --with-openssl=%{l_prefix} \ + --with-openssl-lib=%{l_prefix}/lib \ + --with-openssl-include=%{l_prefix}/include \ + --enable-berkeley-db \ + --disable-ndbm-db \ + --enable-kcm \ + --without-krb4 \ + --enable-pthread-support \ + --enable-otp + + # build toolkit + %{l_make} %{l_mflags -O} + +%install + # install toolkit + rm -rf $RPM_BUILD_ROOT + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + + # create additional directories + %{l_shtool} mkdir -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/heimdal/log \ + $RPM_BUILD_ROOT%{l_prefix}/var/heimdal/run \ + $RPM_BUILD_ROOT%{l_prefix}/var/heimdal/db \ + $RPM_BUILD_ROOT%{l_prefix}/etc/heimdal \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + + # strip down installation + rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir + rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/cat* + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/heimdal/libeditline* + rm -f $RPM_BUILD_ROOT%{l_prefix}/include/heimdal/editline.h + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man3/editline.3 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/compile_et + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true + + # install setup script + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + -e 's;@l_bash@;%{l_bash};g' \ + %{SOURCE heimdal-setup.sh} \ + $RPM_BUILD_ROOT%{l_prefix}/sbin/heimdal-setup + + # install run-command script + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.heimdal} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install default configuration files + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE krb5.conf} %{SOURCE kdc.conf} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/heimdal/ + + # install OSSP fsl configuration + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.heimdal} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%not %dir %{l_prefix}/etc/fsl' \ + '%config %{l_prefix}/etc/fsl/fsl.heimdal' \ + '%config %{l_prefix}/etc/heimdal/*.conf' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%pre + # before upgrade, save status and stop service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} heimdal status 2>/dev/null | tee %{l_tmpfile}` + %{l_rc} heimdal stop 2>/dev/null + exit 0 + +%post + # initial hints + if [ $1 -eq 1 ]; then + # display information about next steps + ( echo "Before you can use Heimdal you have to choose the" + echo "Kerberos realm (e.g. EXAMPLE.COM) and initialize the" + echo "Heimdal database with the command:" + echo " \$ $RPM_INSTALL_PREFIX/sbin/heimdal-setup <realm> <domain>" + echo "where <domain> is the primary DNS zone of this setup and" + echo "<realm> by convention is the upper-case version of <domain>." + echo "After this you should start the Kerberos server with:" + echo " \$ $RPM_INSTALL_PREFIX/etc/rc heimdal start" + echo "" + echo "Then you should add and attach all remote hosts to Heimdal" + echo "by running the following command on each remote host:" + echo " \$ $RPM_INSTALL_PREFIX/sbin/kadmin -p admin/admin" + echo " kadmin> add host/<hostname>.<domain>" + echo " kadmin> ext_keytab host/<hostname>.<domain>" + echo " kadmin> exit" + echo "" + echo "Then you should add all your users to Heimdal via:" + echo " \$ $RPM_INSTALL_PREFIX/sbin/kadmin -p admin/admin" + echo " kadmin> add <user>/<user>@<realm>" + echo " kadmin> exit" + echo "" + echo "After this, your users can authenticate against" + echo "Heimdal on all attached hosts via:" + echo " \$ $RPM_INSTALL_PREFIX/bin/kinit <user>/<user>" + echo " \$ $RPM_INSTALL_PREFIX/bin/klist" + ) | %{l_rpmtool} msg -b -t notice + fi + # after upgrade, restore status + [ $1 -eq 2 ] || exit 0 + eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} + [ ".$heimdal_active" = .yes ] && %{l_rc} heimdal start + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} heimdal stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/heimdal/log/*.log* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/heimdal/run/*.pid >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/heimdal/db/* >/dev/null 2>&1 || true + exit 0 + @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/kdc.conf ============================================================================ $ cvs diff -u -r0 -r1.1 kdc.conf --- /dev/null 2007-01-13 22:15:14 +0100 +++ kdc.conf 2007-01-13 22:18:18 +0100 @@ -0,0 +1,12 @@ + +[kdc] + addresses = 127.0.0.1 + ports = 750 88 + database = { + realm = EXAMPLE.COM + acl_file = @l_prefix@/etc/heimdal/heimdal.acl + dbname = @l_prefix@/var/heimdal/db/heimdal + mkey_file = @l_prefix@/var/heimdal/db/heimdal.mkey + log_file = @l_prefix@/var/heimdal/db/heimdal.log + } + @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/krb5.conf ============================================================================ $ cvs diff -u -r0 -r1.1 krb5.conf --- /dev/null 2007-01-13 22:15:14 +0100 +++ krb5.conf 2007-01-13 22:18:19 +0100 @@ -0,0 +1,21 @@ + +[logging] + kdc = FILE:@l_prefix@/var/heimdal/log/kdc.log + kadmin = FILE:@l_prefix@/var/heimdal/log/kadmin.log + default = FILE:@l_prefix@/var/heimdal/log/heimdal.log + +[libdefaults] + default_realm = EXAMPLE.COM + +[realms] + EXAMPLE.COM = { + kdc = kerberos1.example.com + kdc = kerberos2.example.com + admin_server = kerberos1.example.com + default_domain = example.com + } + +[domain_realm] + .example.com = EXAMPLE.COM + example.com = EXAMPLE.COM + @@ . patch -p0 <<'@@ .' Index: openpkg-src/heimdal/rc.heimdal ============================================================================ $ cvs diff -u -r0 -r1.1 rc.heimdal --- /dev/null 2007-01-13 22:15:14 +0100 +++ rc.heimdal 2007-01-13 22:18:19 +0100 @@ -0,0 +1,101 @@ [EMAIL PROTECTED]@/bin/openpkg rc +## +## rc.heimdal -- Run-Commands +## + +%config + heimdal_enable="$openpkg_rc_def" + heimdal_daemons="kdc kadmind kpasswdd" + heimdal_flags_kdc="" + heimdal_flags_kadmind="" + heimdal_flags_kpasswdd="" + heimdal_log_prolog="true" + heimdal_log_epilog="true" + heimdal_log_numfiles="10" + heimdal_log_minsize="1M" + heimdal_log_complevel="9" + +%common + heimdal_logdir="@l_prefix@/var/heimdal/log" + heimdal_pidfile_kdc="@l_prefix@/var/heimdal/run/kdc.pid" + heimdal_pidfile_kadmind="@l_prefix@/var/heimdal/run/kadmind.pid" + heimdal_pidfile_kpasswdd="@l_prefix@/var/heimdal/run/kpasswdd.pid" + heimdal_signal () { + [ -f $heimdal_pidfile_kdc ] \ + && kill -$1 `cat $heimdal_pidfile_kdc` + local rc_heimdal_kdc=$? + [ -f $heimdal_pidfile_kadmind ] \ + && kill -$1 `cat $heimdal_pidfile_kadmind` + local rc_heimdal_kadmind=$? + [ -f $heimdal_pidfile_kpasswdd ] \ + && kill -$1 `cat $heimdal_pidfile_kpasswdd` + local rc_heimdal_kpasswdd=$? + [ $rc_heimdal_kdc -eq 0 -o \ + $rc_heimdal_kadmind -eq 0 -o \ + $rc_heimdal_kpasswdd -eq 0 ] + } + +%status -u @l_susr@ -o + heimdal_usable="no" + heimdal_active="no" + rcService heimdal enable yes && \ + heimdal_signal 0 && heimdal_active="yes" + echo "heimdal_enable=\"$heimdal_enable\"" + echo "heimdal_usable=\"$heimdal_usable\"" + echo "heimdal_active=\"$heimdal_active\"" + +%start -u @l_susr@ + rcService heimdal enable yes || exit 0 + rcService heimdal active yes && exit 0 + for daemon in $heimdal_daemons; do + case "$daemon" in + kdc ) + nohup @l_prefix@/sbin/kdc $heimdal_flags_kdc & + echo $! >$heimdal_pidfile_kdc + ;; + kadmind ) + nohup @l_prefix@/sbin/kadmind $heimdal_flags_kadmind & + echo $! >$heimdal_pidfile_kadmind + ;; + kpasswdd ) + nohup @l_prefix@/sbin/kpasswdd $heimdal_flags_kpasswdd & + echo $! >$heimdal_pidfile_kpasswdd + ;; + esac + done + +%stop -u @l_susr@ + rcService heimdal enable yes || exit 0 + rcService heimdal active no && exit 0 + heimdal_signal TERM + sleep 5 + rm -f $heimdal_pidfile_kdc 2>/dev/null || true + rm -f $heimdal_pidfile_kadmind 2>/dev/null || true + rm -f $heimdal_pidfile_kpasswdd 2>/dev/null || true + +%restart -u @l_susr@ + rcService heimdal enable yes || exit 0 + rcService heimdal active no && exit 0 + rc heimdal stop + sleep 2 + rc heimdal start + +%daily -u @l_susr@ + rcService heimdal enable yes || exit 0 + rcTmp -i + hintfile=`rcTmp -f -n hint` + for daemon in $heimdal_daemons; do + if [ -f $heimdal_logdir/$daemon.log ]; then + shtool rotate -f \ + -n $heimdal_log_numfiles -s $heimdal_log_minsize -d \ + -z $heimdal_log_complevel -m 664 -o @l_rusr@ -g @l_rgrp@ \ + -P "$heimdal_log_prolog" \ + -E "$heimdal_log_epilog; echo 1 >$hintfile" \ + $heimdal_logdir/$daemon.log + fi + done + if [ -s $hintfile ]; then + rc heimdal restart + fi + rcTmp -k + @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org