From 59fa2dcdee8e277429bca809e7334c7ac53fc1a3 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 12 Apr 2015 18:48:17 +0200 Subject: update to samba4, simplify package, support subpackages later --- package/heimdal/Makefile | 38 +++++ .../heimdal/patches/patch-cf_check-compile-et_m4 | 17 ++ .../heimdal/patches/patch-lib_com_err_Makefile_am | 11 ++ package/heimdal/patches/patch-lib_roken_roken_h_in | 11 ++ package/heimdal/src/cf/roken-h-process.pl | 184 +++++++++++++++++++++ 5 files changed, 261 insertions(+) create mode 100644 package/heimdal/Makefile create mode 100644 package/heimdal/patches/patch-cf_check-compile-et_m4 create mode 100644 package/heimdal/patches/patch-lib_com_err_Makefile_am create mode 100644 package/heimdal/patches/patch-lib_roken_roken_h_in create mode 100644 package/heimdal/src/cf/roken-h-process.pl (limited to 'package/heimdal') diff --git a/package/heimdal/Makefile b/package/heimdal/Makefile new file mode 100644 index 000000000..dcf648db2 --- /dev/null +++ b/package/heimdal/Makefile @@ -0,0 +1,38 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= heimdal +PKG_VERSION:= 1.5.3 +PKG_RELEASE:= 1 +PKG_HASH:= aac27bedb33c341b6aed202af07ccc816146a893148721f8123abbbf93bbfea5 +PKG_DESCR:= kerberos server +PKG_SECTION:= app/crypto +PKG_URL:= http://www.h5l.org/ +PKG_SITES:= http://www.h5l.org/dist/src/ + +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz + +PKG_CFLINE_HEIMDAL:= depends on ADK_HOST_ONLY + +include $(ADK_TOPDIR)/mk/host.mk +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call HOST_template,HEIMDAL,heimdal,$(PKG_VERSION)-${PKG_RELEASE})) + +HOST_CONFIGURE_ARGS+= --disable-pk-init \ + --without-openldap \ + --disable-kcm \ + --disable-kx509 \ + --disable-ndbm-db \ + --without-berkeley-db \ + --disable-sqlite-cache \ + --disable-otp + +hostpost-install: + $(CP) $(STAGING_HOST_DIR)/usr/libexec/heimdal/asn1_compile \ + $(STAGING_HOST_DIR)/usr/bin + +include ${ADK_TOPDIR}/mk/host-bottom.mk +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/heimdal/patches/patch-cf_check-compile-et_m4 b/package/heimdal/patches/patch-cf_check-compile-et_m4 new file mode 100644 index 000000000..0211e2b8f --- /dev/null +++ b/package/heimdal/patches/patch-cf_check-compile-et_m4 @@ -0,0 +1,17 @@ +--- heimdal-1.5.3.orig/cf/check-compile-et.m4 2012-12-09 23:06:44.000000000 +0100 ++++ heimdal-1.5.3/cf/check-compile-et.m4 2014-04-24 11:55:02.000000000 +0200 +@@ -3,12 +3,12 @@ dnl + dnl CHECK_COMPILE_ET + AC_DEFUN([CHECK_COMPILE_ET], [ + +-AC_CHECK_PROG(COMPILE_ET, compile_et, [compile_et]) ++AC_CHECK_PROG(COMPILE_ET, compile_et, [compile_et],[no]) + + krb_cv_compile_et="no" + krb_cv_com_err_need_r="" + krb_cv_compile_et_cross=no +-if test "${COMPILE_ET}" = "compile_et"; then ++if test "${COMPILE_ET}" != no; then + + dnl We have compile_et. Now let's see if it supports `prefix' and `index'. + AC_MSG_CHECKING(whether compile_et has the features we need) diff --git a/package/heimdal/patches/patch-lib_com_err_Makefile_am b/package/heimdal/patches/patch-lib_com_err_Makefile_am new file mode 100644 index 000000000..9c2faa8d8 --- /dev/null +++ b/package/heimdal/patches/patch-lib_com_err_Makefile_am @@ -0,0 +1,11 @@ +--- heimdal-1.5.3.orig/lib/com_err/Makefile.am 2012-12-09 23:06:44.000000000 +0100 ++++ heimdal-1.5.3/lib/com_err/Makefile.am 2014-05-27 11:51:26.000000000 +0200 +@@ -13,7 +13,7 @@ endif + + libcom_err_la_LIBADD = $(LIB_libintl) + +-bin_PROGRAMS = compile_et ++libexec_heimdal_PROGRAMS = compile_et + + include_HEADERS = com_err.h com_right.h + diff --git a/package/heimdal/patches/patch-lib_roken_roken_h_in b/package/heimdal/patches/patch-lib_roken_roken_h_in new file mode 100644 index 000000000..b571cc428 --- /dev/null +++ b/package/heimdal/patches/patch-lib_roken_roken_h_in @@ -0,0 +1,11 @@ +--- heimdal-1.5.3.orig/lib/roken/roken.h.in 2012-12-09 23:06:44.000000000 +0100 ++++ heimdal-1.5.3/lib/roken/roken.h.in 2014-04-24 10:36:35.000000000 +0200 +@@ -551,7 +551,7 @@ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL ge + ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL strerror(int); + #endif + +-#if (!defined(HAVE_STRERROR_R) && !defined(strerror_r)) || (!defined(STRERROR_R_PROTO_COMPATIBLE) && defined(HAVE_STRERROR_R)) ++#if (defined(HAVE_STRERROR_R) && !defined(strerror_r)) || (!defined(STRERROR_R_PROTO_COMPATIBLE) && defined(HAVE_STRERROR_R)) + int ROKEN_LIB_FUNCTION rk_strerror_r(int, char *, size_t); + #else + #define rk_strerror_r strerror_r diff --git a/package/heimdal/src/cf/roken-h-process.pl b/package/heimdal/src/cf/roken-h-process.pl new file mode 100644 index 000000000..aa371a364 --- /dev/null +++ b/package/heimdal/src/cf/roken-h-process.pl @@ -0,0 +1,184 @@ +#!/usr/bin/perl + +require 'getopts.pl'; + +my $debug = 0; + +Getopts('dc:p:o:') || die "foo"; + +if ($opt_d) { + $debug = 1; +} + +die "missing arg" if (!defined $opt_c || !defined $opt_p || !defined $opt_o); + +my %defines; +my $IN; +my $OUT; + +print "parse config.h\n" if ($debug); + +open IN, $opt_c || die "failed open ${opt_c}"; + +my @nesting; + +push @nesting, 1; + +while () { + if (m/\s*#ifdef\s+(.*)/) { + my $var = $1; + if (defined $defines{$var}) { + push @nesting, 1; + } else { + push @nesting, 0; + } + next; + } elsif (m/\s*#ifndef\s+(.*)/) { + my $var = $1; + if (defined $defines{$var}) { + push @nesting, 0; + } else { + push @nesting, 1; + } + next; + } elsif (m/\s*#else/) { + my $var = pop @nesting; + $var = !$var; + push @nesting, $var; + next; + } elsif ($nesting[$#nesting] and m/\s*#define\s+(\w+)\s+(\S+)/) { + my $res = $2; + $res = 1 if (!defined $res); + $defines{$1} = $res; + } +} + +close IN; + +if ($debug) { + foreach my $i (keys %defines) { + print "k: $i v: $defines{$i}\n"; + } +} + +open IN, "$opt_p" || die "failed open ${opt_p}"; +open OUT, ">$opt_o" || die "failed open ${opt_o}"; + +print "parse roken.h.in\n" if ($debug); + +print OUT "/* This is an OS dependent, generated file */\n"; +print OUT "\n"; +print OUT "\n"; +print OUT "#ifndef __ROKEN_H__\n"; +print OUT "#define __ROKEN_H__\n"; +print OUT "\n"; + +@nesting = (1); + +while () { + if (m/\s*#ifdef\s+(.*)/) { + my $var = $1; + if (defined $defines{$var}) { + push @nesting, 1; + } else { + push @nesting, 0; + } + next; + } elsif (m/\s*#ifndef\s+(.*)/) { + my $var = $1; + if (defined $defines{$var}) { + push @nesting, 0; + } else { + push @nesting, 1; + } + next; + } elsif (m/\s*#if\s+(.*)/) { + my $res = parse_if($1); + print "line = $res: $1\n" if ($debug); + push @nesting, $res; + next; + } elsif (m/\s*#elif\s+(.*)/) { + my $res = pop @nesting; + if ($res gt 0) { + $res = -1; + } else { + my $res = parse_if($1); + } + push @nesting, $res; + next; + } elsif (m/\s*#else/) { + my $var = pop @nesting; + $var = !$var; + push @nesting, $var; + next; + } elsif (m/\s*#endif/) { + pop @nesting; + next; + } + print "line: $_\n" if ($debug); + print "nesting dep $#{nesting}\n" if ($debug); + my $i = 0, $t = 1; + while ($i le $#nesting) { + $t = 0 if ($nesting[$i] le 0); + print "nesting $i val $nesting[$i] -> $t\n" if ($debug); + $i++; + } + if ($t) { + print OUT; + } +} + +print OUT "\n"; +print OUT "#endif /* __ROKEN_H__ */\n"; + + +close IN; + +exit 0; + +sub parse_if +{ + my ($neg, $var); + + $_ = shift; + + if (m/^\s*$/) { + print "end $_\n" if ($debug); + return 1; + } elsif (m/^\(([^&]+)\&\&(.*)$/) { + print "$1 and $2\n" if ($debug); + return parse_if($1) and parse_if($2); + } elsif (m/^([^&]+)\&\&(.*)$/) { + print "$1 and $2\n" if ($debug); + return parse_if($1) and parse_if($2); + } elsif (m/^([^\|]+)\|\|(.*)$/) { + print "$1 or $2\n" if ($debug); + return parse_if($1) or parse_if($2); + } elsif (m/^\s*(\!)?\s*defined\((\w+)\)/) { + ($neg, $var) = ($1, $2); + print "def: ${neg}-defined(${var})\n" if ($debug); + my $res = defined $defines{$var}; + if ($neg eq "!") { + if ($res) { + $res = 0; + } else { + $res = 1; + } + } + print "res: $res\n" if ($debug); + return $res; + } elsif (m/^\s*(\!)?(\w+)/) { + ($neg, $var) = ($1, $2); + print "var: $neg $var\n" if ($debug); + my $res; + if (defined $defines{$var}) { + $res = $defines{$var}; + } else { + $res = 0; + } + $res = ! $res if ($neg =~ m/!/); + print "res: $res\n" if ($debug); + return $res; + } + die "failed parse: $_\n"; +} -- cgit v1.2.3