oops. fixed path
[myplc.git] / build.functions
index 15277e4..cd9a80d 100644 (file)
@@ -46,37 +46,47 @@ set -e
 # Be verbose
 set -x
 
-# Make a basic chroot at the specified location given the specified
-# configuration.
-make_chroot_from_lst() {
-    root=$1
-    lst=$2
+# this is fragile, as the actual layout may vary from one mirror to the other
+# however this should be in line with the layouts obtained 
+# when running build/vbuild-fedora-mirror.sh
 
-    packages=$(pl_getPackagesOptions $lst)
-    groups=$(pl_getGroupsOptions $lst) 
+function yum_conf_fedora_core () {
+    BUILD_HOST=$1; shift
+    cat <<EOF
+[base]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/core/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/os/
 
-    pl_setup_chroot $root $packages $groups
+
+[updates]
+name=${pl_DISTRO_NAME} - updates
+baseurl=http://${BUILD_HOST}/fedora/linux/core/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+
+
+[extras]
+name=${pl_DISTRO_NAME} - extras
+baseurl=http://${BUILD_HOST}/fedora/linux/extras/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+EXTRAS
+EOF
 }
 
-# Move specified directories out of the chroot and into a "data"
-# directory that will be bind mounted on /data inside the chroot.
-#move_datadirs() {
-#    root=$1
-#    data=$2
-#    shift 2
-#    pl_move_dirs $root $data /data "$@"
-#}
-
-# Make loopback filesystem from specified location
-#make_image() {
-#    root=$1
-#    image=$2
-#    pl_make_image $root $image 100000000
-#}
+function yum_conf_fedora () {
+    BUILD_HOST=$1; shift
+    cat <<EOF
+[base]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/releases/${pl_DISTRO_RELEASE}/Everything/${pl_DISTRO_ARCH}/os/
+
+[updates]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+EOF
+}
 
 function yum_conf_to_build_host () {
    BUILD_HOST=$(hostname)
-   cat <<EOF
+
+          cat <<EOF
 [main]
 cachedir=/var/cache/yum
 debuglevel=2
@@ -92,31 +102,21 @@ gpgcheck=0
 # (e.g., from /etc/yum.repos.d/)
 reposdir=/dev/null
 
-[base]
-name=Fedora Core 4 - i386 - base
-baseurl=http://${BUILD_HOST}/fedora/linux/core/${PLC_DEVEL_FEDORA_RELEASE}/${PLC_DEVEL_FEDORA_ARCH}/os/
-
-
-[updates]
-name=Fedora Core 4 - i386 - updates
-baseurl=http://${BUILD_HOST}/fedora/linux/core/updates/${PLC_DEVEL_FEDORA_RELEASE}/${PLC_DEVEL_FEDORA_ARCH}/
-
-$(if [ "${PLC_DEVEL_FEDORA_RELEASE}" -le 6 ] ; then cat << EXTRAS
-[extras]
-name=Fedora Core 4 - i386 - extras
-baseurl=http://${BUILD_HOST}/fedora/linux/extras/${PLC_DEVEL_FEDORA_RELEASE}/${PLC_DEVEL_FEDORA_ARCH}/
-EXTRAS
-fi)
 EOF
 
-}
-
-function sudoers_bootcustom_apache () {
-    cat <<EOF
-User_Alias WWW = %apache,%root
-Cmnd_Alias BOOTCUSTOM = /usr/share/bootcd/bootcustom.sh
-WWW          ALL = NOPASSWD: BOOTCUSTOM 
-EOF
+   case "$pl_DISTRO" in
+       Fedora)
+          if [ "${pl_DISTRO_RELEASE}" -le 6 ] ; then 
+              yum_conf_fedora_core $BUILD_HOST
+          else
+              yum_conf_fedora $BUILD_HOST
+          fi
+    ;;
+       *)
+          echo "$0: no support for tuning yum.conf on this distribution $pl_DISTRO"
+          exit 1
+          ;;
+   esac
 }
 
 # quick and dirty - might break anytime if docbook html output changes