Update master of plcapi.
[build.git] / build.common
index 433d379..622bd80 100644 (file)
@@ -1,8 +1,5 @@
 # -*-Shell-script-*-
 #
-# $Id$
-# $URL$
-#
 # Common functions for build scripts used by various packages
 # incorporated (e.g., build, myplc, myplc-devel, vserver-reference)
 #
@@ -73,17 +70,20 @@ function pl_getReleaseName () {
 function pl_getKexcludes () {
     distroname=$1; shift
     case $distroname in
-       ### there is an ugly hack going on around here
-       # with f12, the dependencies somehow require kernel 2.6.29 but our own kernel is 2.6.27
-       # so the ugly workaround here is to let 'kernel-debug' get installed from the stock repos
-       # we then remove it manually after the image is done, look for kernel-debug below
-       # relyong on kernel-PAE for this trick won't work, as 64 bits distros don't have PAE of course
-       f*)
-           echo 'kernel kernel-PAE kernel-PAEdebug kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables iptables-ipv6 iproute drupal' ;;
-       centos5)
-           echo 'kernel kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables iproute drupal inotify-tools* libnl' ;;
-       *)
-           echo "pl_DISTRO_NAME=$pl_DISTRO_NAME not supported in getexcludes.sh" ; exit 1 ;;
+    # when using k27, we need our own flavour of iproute
+    # for now we build only for k32, regardless of fcdistro
+    f8)
+        echo 'kernel* util-vserver* iptables iptables-ipv6 drupal' ;;
+    f16)
+        echo 'drupal' ;;
+    f*)
+        echo 'util-vserver* drupal' ;;
+    centos5)
+        echo 'kernel kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables drupal inotify-tools* libnl' ;;
+    sl*)
+        echo 'kernel kernel-debug kernel-debug-devel kernel-devel kernel-doc kernel-firmware kernel-headers iptables' ;;
+    *)
+        echo "pl_DISTRO_NAME=$pl_DISTRO_NAME not supported in getexcludes.sh" ; exit 1 ;;
     esac
 }
 
@@ -382,6 +382,7 @@ fi
     if [ -n "$pkgs_packages" ] ; then
        echo "* Installing optional packages" $pkgs_packages
         # ignore yum's return code that is basically undefined
+        echo "* Install options" $vroot $yum_options 
        yum $yum_options install $pkgs_packages || :
        if ! rpm --root $vroot -q $pkgs_packages >/dev/null ; then
            echo "* Warning: Missing packages"
@@ -547,6 +548,7 @@ function pl_parsePkgs () {
     fcdistro=$1; shift
     pldistro=$1; shift
 
+    echo 1>&2 "pl_parsePkgs: using -a $target_arch -f $fcdistro -d $pldistro $keyword $@"
     pkgs.py -a $target_arch -f $fcdistro -d $pldistro $keyword "$@" 
 }
 # usage: pl_getPackages [-a arch] fcdistro pldistro pkg-file[..s]
@@ -744,15 +746,13 @@ $kexclude_line" $template > $dest_yumconf
     return 0
 }
 
-# from a yum.conf as generated above, computes the (first) gpgkey url
+# from a yum.conf as generated above, computes the gpgkey urls
 function yumconf_gpgkey () {
     dest_yumconf=$1; shift
 
-    first_line=$(grep '^gpgkey=' $dest_yumconf | head -1)
-    values=$(echo $first_line | sed -e s,gpgkey=,,)
-    value=$(echo $values | awk '{print $1;}' | sed -e 's,$basearch,'"$pl_DISTRO_ARCH",g)
-    [ -n "$value" ] || return 1
-    echo $value
+    values=$(grep -h '^gpgkey=' $dest_yumconf | sed -e s,gpgkey=,, | sed -e 's,$basearch,'"$pl_DISTRO_ARCH",g | sed -e 's, ,\n,g' | sort | uniq | xargs)
+    [ -n "$values" ] || return 1
+    echo $values
     return 0
 }