From: Derrick Brashear Date: Tue, 13 Nov 2007 00:03:11 +0000 (+0000) Subject: DEVEL15-redhat-packaging-updates-20071112 X-Git-Tag: openafs-devel-1_5_28~56 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=aed1423c0e095e5aa4fc880ef886253f33804401;p=packages%2Fo%2Fopenafs.git DEVEL15-redhat-packaging-updates-20071112 FIXES 76890 various updates to deal with fedora 8 and remove obsolete stuff (cherry picked from commit 9f284c66a9ad685eab201e480372633d538938b3) --- diff --git a/src/packaging/RedHat/RPM-build-notes b/src/packaging/RedHat/RPM-build-notes new file mode 100644 index 000000000..bf6f187df --- /dev/null +++ b/src/packaging/RedHat/RPM-build-notes @@ -0,0 +1,35 @@ +Beginning with the 1.4.5 release, OpenAFS's prebuilt binaries use a new +mechanism for packaging kernel modules on Fedora Core (all versions) +and RHEL 5 (and derivatives). This new mechanism allows the +installation of modules for multiple kernel variants simultaneously, +and is identical to the technique used by Fedora and Red Hat's own +out of tree kernel modules. + +The difference is that instead of a single 'openafs-kernel' module, +multiple kmod-openafs- RPMs are produced. When manually +upgrading to OpenAFS 1.4.5, it may be necessary to remove any openafs- +kernel modules left behind by your old installation, and to ensure +that the appropriate kmod-openafs module is installed. + +If you wish to build 'kmod' modules for new kernel release, this may +be done by rebuilding the SRPM with 'fedorakmod' defined, and the +'kvariants' parameter set to the list of kernel variants you wish to +build modules for (a kernel-devel package must be installed for each +of these variants). Note that supplying '' as a variant will build +for a normal kernel. The 'kernvers' variable can be set to specify +what kernel release version you wish to build for. + +For example: + rpmbuild -bb --define "fedorakmod 1" \ + --target i686 \ + --define "build_modules 1" \ + --define "kvariants '' PAE" \ + openafs.spec + +would build a kernel module for the normal and PAE variants of the +currently running kernel. + +Old-style packages may still be built in the same way as previous +releases. However, note that you must use userland RPMs which match +the packaging of your kernel module. Old style kernel modules will +not work with a set of userland RPMs which expect kmod-style packages. diff --git a/src/packaging/RedHat/afs-krb5-2.0-com_err.patch b/src/packaging/RedHat/afs-krb5-2.0-com_err.patch deleted file mode 100644 index 7b496bbee..000000000 --- a/src/packaging/RedHat/afs-krb5-2.0-com_err.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in ---- afs-krb5.orig/src/configure.in 2005-04-14 16:06:15.597138000 -0400 -+++ afs-krb5/src/configure.in 2005-04-14 16:06:44.201789856 -0400 -@@ -143,7 +143,19 @@ - LIBS="$ac_save_LIBS"]) - if test "x$afs_cv_func_getDirPath" = "xyes"; then - AC_MSG_RESULT([Setting compilation parameters for AFS 3.5 and later]) -- AKLOG_EXTRA_OBJ=adderrtable.o -+ AC_MSG_CHECKING([for add_to_error_table]) -+dnl -+dnl We may be using libcom_err from Kerberos (shared libraries), and -+dnl already have add_to_error_table -+dnl -+ AC_TRY_LINK_FUNC(add_to_error_table, have_adderr=yes, have_adderr=no) -+ if test $have_adderr != yes; then -+ AC_MSG_RESULT([no, adding adderrtable.o]) -+ AKLOG_EXTRA_OBJ=adderrtable.o -+ else -+ AC_MSG_RESULT([yes]) -+ AKLOG_EXTRA_OBJ= -+ fi - else - AC_MSG_RESULT([Setting compilation parameters for pre-AFS 3.5]) - AC_DEFINE(PRE_AFS35) diff --git a/src/packaging/RedHat/afs-krb5-2.0-krb524.patch b/src/packaging/RedHat/afs-krb5-2.0-krb524.patch deleted file mode 100644 index 7503d4119..000000000 --- a/src/packaging/RedHat/afs-krb5-2.0-krb524.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- afs-krb5/src/configure.in-orig 2003-03-16 20:13:34.000000000 -0500 -+++ afs-krb5/src/configure.in 2005-09-14 17:20:46.000000000 -0400 -@@ -179,14 +197,20 @@ - [ EXTRA_INC="$EXTRA_INC -I$with_krb5_obj/include -I$with_krb5_obj/include/krb5" - KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_obj/lib/libdb.a#"`]) - dnl --dnl Sigh, why is this so complicated? Right now, just assume that --dnl the 524 library is always called krb524 and will be picked up by the --dnl Kerberos link line --dnl --dnl AC_CHECK_LIB(krb524, krb524_convert_princs, [KRB524LIB="-lkrb524"], [ --dnl AC_MSG_ERROR([Cannot find 524 library, exiting]) --dnl ]) --KRB524LIB=-lkrb524 -+dnl The krb524 functions may be included in libkrb5 itself, or else in a -+dnl separate library named libkrb524 -+dnl -+ac_save_LIBS="$LIBS" -+KRB524LIB= -+AC_MSG_CHECKING([for krb524 library]) -+AC_CHECK_FUNC(krb524_init_ets, have_krb524=yes, have_krb524=no) -+ -+if test "$have_krb524" = no; then -+ LIBS="$LIBS -lkrb524" -+ AC_CHECK_LIB(krb524, krb524_init_ets, [KRB524LIB="-lkrb524"], -+ [AC_MSG_ERROR([Unable to find krb524 library])]) -+fi -+LIBS="$ac_save_LIBS" - - dnl AC_CHECK_LIB(kdb5, krb5_db_fetch_mkey, [KD_LIBS="-lkdb5"],[ - dnl AC_MSG_WARN([Cannot find Kerberos 5 DB library, will not be able to build DB utilities]) diff --git a/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch b/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch deleted file mode 100644 index e39ef2cef..000000000 --- a/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in ---- afs-krb5.orig/src/configure.in 2003-03-16 20:13:34.000000000 -0500 -+++ afs-krb5/src/configure.in 2003-07-30 11:52:55.000000000 -0400 -@@ -44,14 +44,6 @@ - if test $retval -ne 0; then - AC_MSG_ERROR($krb5_config failed with error code of $retval) - fi --AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS]) --AC_MSG_RESULT([Adding $krb5_libs to LIBS]) --AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm]) --AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm]) --CFLAGS="$CFLAGS $krb5_cflags" --LIBS="$LIBS $krb5_libs" --KADM_CFLAGS="$krb5_cflags_kadm" --KADM_LIBS="$krb5_libs_kadm" - dnl - dnl Check for various network libraries - dnl -@@ -105,6 +97,20 @@ - AC_MSG_ERROR([Unable to find res_search function]) - fi - LIBS="$save_LIBS" -+ -+dnl -+dnl Don't add these to LIBS until after we've already looked for -+dnl libsocket, etc. Otherwise ka-forwarder won't build properly -+dnl -+AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS]) -+AC_MSG_RESULT([Adding $krb5_libs to LIBS]) -+AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm]) -+AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm]) -+CFLAGS="$CFLAGS $krb5_cflags" -+LIBS="$LIBS $krb5_libs" -+KADM_CFLAGS="$krb5_cflags_kadm" -+KADM_LIBS="$krb5_libs_kadm" -+ - dnl - dnl Optional support for AFS - dnl diff --git a/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch b/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch deleted file mode 100644 index 44045a067..000000000 --- a/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr afs-krb5.orig/src/asetkey.c afs-krb5/src/asetkey.c ---- afs-krb5.orig/src/asetkey.c 2005-04-08 15:55:35.637620000 -0400 -+++ afs-krb5/src/asetkey.c 2005-04-08 15:55:57.614279120 -0400 -@@ -81,7 +81,7 @@ - exit(1); - } - -- code = afsconf_AddKey(tdir, kvno, key->contents); -+ code = afsconf_AddKey(tdir, kvno, key->contents, 1); - if (code) { - printf("setkey: failed to set key, code %ld.\n", code); - exit(1); diff --git a/src/packaging/RedHat/afs-krb5-2.0-res_search.patch b/src/packaging/RedHat/afs-krb5-2.0-res_search.patch deleted file mode 100644 index fda5ba45b..000000000 --- a/src/packaging/RedHat/afs-krb5-2.0-res_search.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- afs-krb5/src/configure.in.res_search 2005-09-30 12:53:38.000000000 -0400 -+++ afs-krb5/src/configure.in 2005-09-30 14:40:38.000000000 -0400 -@@ -89,7 +89,10 @@ - if test "$have_res_search" != yes; then - AC_CHECK_LIB(${lib}, res_search, - [have_res_search=yes -- NETLIBS="$NETLIBS -l${lib}"]) -+ NETLIBS="$NETLIBS -l${lib}"], -+ [AC_CHECK_LIB(${lib}, __res_search, -+ [have_res_search=yes -+ NETLIBS="$NETLIBS -l${lib}"])]) - fi - done - fi diff --git a/src/packaging/RedHat/openafs-buildfedora.pl b/src/packaging/RedHat/openafs-buildfedora.pl index 3bbea02ce..69e37216e 100755 --- a/src/packaging/RedHat/openafs-buildfedora.pl +++ b/src/packaging/RedHat/openafs-buildfedora.pl @@ -24,15 +24,12 @@ foreach my $variant ('', 'PAE', 'kdump', 'xen') { $package=~/([^\-]*\-[^\-]*)\.([^\.]*)$/; my ($version, $arch) = ($1,$2); die "Couldn't extract version and architecture" if !$version or !$arch; - my @archs=map {/^.*\-([^\-]*)/;$1;} split(' ',`ls -d /usr/src/kernels/$version$append-*`); - foreach my $arch (@archs) { - print "Adding $variant, version $version for $arch\n"; - $list{$arch} = {} if !$list{$arch}; - $list{$arch}{$version} =[] if !$list{$arch}{$version}; - push @{$list{$arch}{$version}}, $variant; - } - } + $list{$arch} = {} if !$list{$arch}; + $list{$arch}{$version} =[] if !$list{$arch}{$version}; + push @{$list{$arch}{$version}}, $variant; + } } + # Build the base package print "Building the base system\n"; system("rpmbuild -ba --define \"fedorakmod 1\" --define \"osvers fc$fedoraversion\" $specdir/openafs.spec") == 0 or exit 1; diff --git a/src/packaging/RedHat/openafs-client.init b/src/packaging/RedHat/openafs-client.init index a2cdfb6ee..0b4a8a415 100644 --- a/src/packaging/RedHat/openafs-client.init +++ b/src/packaging/RedHat/openafs-client.init @@ -17,11 +17,6 @@ start() { /usr/vice/etc/CellServDB chmod 644 /usr/vice/etc/CellServDB echo - echo -n $"Updating SuidCells: " - cat /usr/vice/etc/SuidCells.local /usr/vice/etc/SuidCells.dist > \ - /usr/vice/etc/SuidCells - chmod 644 /usr/vice/etc/SuidCells - echo echo -n $"Starting openafs-client: " if [ -e /var/lock/subsys/openafs-client ] ; then echo -n $"cannot start openafs-client: already running" diff --git a/src/packaging/RedHat/openafs-krb5-2.0.tar.gz b/src/packaging/RedHat/openafs-krb5-2.0.tar.gz deleted file mode 100644 index f6b915c47..000000000 Binary files a/src/packaging/RedHat/openafs-krb5-2.0.tar.gz and /dev/null differ diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index 85b42cdc2..fef6c66e2 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -20,7 +20,7 @@ %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0} # Determine the version of the kernel to build against -# - automatically select the latest kernel with sources from /lib/modules +# - automatically select running kernel if there are sources in /lib/modules # - note that this can be overridden on the command line # %if !%{kernvers_on_cmdline} @@ -46,7 +46,7 @@ %endif %{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?paevar} %{?xenvar} %{?kdumpvar}} -%define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu} +%{!?ksrcdir: %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}} %else # Legacy kernel build stuff @@ -230,6 +230,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root Packager: Derek Atkins Group: Networking/Filesystems BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison +%if %{krb5support} +BuildRequires: krb5-devel +%endif %if %{build_userspace} BuildRequires: autoconf %endif @@ -459,7 +462,7 @@ you are using KAserver instead of Krb5. Summary: OpenAFS programs to use with krb5 Requires: openafs = %{PACKAGE_VERSION} Group: Networking/Filesystems -BuildRequires: krb5-devel, autoconf, automake +BuildRequires: autoconf, automake %description krb5 The AFS distributed filesystem. AFS is a distributed filesystem @@ -642,37 +645,6 @@ This package provides a precompiled AFS kernel module for %{kernvers}. # Patch openafs to build a kernel module named "openafs" instead of "libafs" %patch0 -p1 -b .kmod26 -%if %{build_userspace} -# Save some time -- install these if we're building userspace - -# Install the Krb5 Migration Kit -tar -xzf src/packaging/RedHat/openafs-krb5-2.0.tar.gz - -# -# patch afs-krb5 migration kit to work with openafs-1.3 and krb5-1.3; -# add some features and fix bugs -# - -# krb524 is no longer in a separate library as of krb5-1.3; handle this -patch -p0 -b -z .krb524 < src/packaging/RedHat/afs-krb5-2.0-krb524.patch - -# make sure NETLIBS gets added to the proper programs (seems to be -# needed only for Solaris) -patch -p0 -b -z .libsocket < src/packaging/RedHat/afs-krb5-2.0-libsocket.patch - -# find an existing libcom_err and use that -patch -p0 -b -z .com_err < src/packaging/RedHat/afs-krb5-2.0-com_err.patch - -# make afs-krb5 work with recent OpenAFS; includes and prototypes -patch -p0 -b -z .openafs13 < src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch - -# nothing in afs-krb5 actually uses res_search -patch -p0 -b -z .res_search < src/packaging/RedHat/afs-krb5-2.0-res_search.patch - -(cd afs-krb5/src && autoreconf) || exit 1 - -%endif - ############################################################################## # # building @@ -813,6 +785,22 @@ config_opts="--enable-redhat-buildsys \ # Configure AFS +# If we're using Fedora kmods, work out which is the best kernel module to +# use for the userland configuration step. If no variants have been specified, +# then use the standard kernel. If variants are specified, use the standard kernel +# if it's listed, otherwise pick the first listed kernel. +ksrc="" +%if %{fedorakmod} + for kvariant in %{kvariants} ; do + if [ -z "${kvariant}" -o -z "$ksrc" ] ; then + ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} + fi + done +%endif +if [ -z "$ksrc" ] ; then +ksrc=%{ksrcdir} +fi + CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS ./configure --with-afs-sysname=${sysname} \ @@ -821,7 +809,7 @@ CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ %if %{build_modules} - --with-linux-kernel-headers=%{ksrcdir} \ + --with-linux-kernel-headers=%{ksrc} \ %endif %if %{krb5support} --with-krb5-conf \ @@ -858,20 +846,6 @@ done %if %{build_userspace} # Build the user-space AFS stuff make dest_nolibafs || exit 1 - -%if %{krb5support} -# Now build ka-forwarder -(cd afs-krb5/src && - ./configure --prefix=%{_prefix} --with-krb5=%{_prefix}/kerberos \ - --libdir=%{_libdir} \ - --bindir=%{_bindir} \ - --sbindir=%{_sbindir} \ - --with-afs=`pwd`/../../${sysname}/dest/ && \ - make all PROGS="ka-forwarder" && \ - install -c -s ka-forwarder `pwd`/../../${sysname}/dest/etc ) \ - || exit 1 -%endif - %endif %if %{build_modules} @@ -1202,7 +1176,7 @@ do # Mark kernel modules as executable; otherwise they won't get stripped # by /usr/lib/rpm/brp-strip - install -m 744 ${srcdir}/${modname} ${dstdir}/openafs${kmodend} + install -m 644 ${srcdir}/${modname} ${dstdir}/openafs${kmodend} done %endif %endif @@ -1507,7 +1481,6 @@ fi %defattr(-,root,root) %{_bindir}/aklog %{_sbindir}/asetkey -%{_sbindir}/ka-forwarder %{_mandir}/man1/aklog.* %{_mandir}/man8/asetkey.* %endif