From 6c4634a11d0c3f5736375d5c02ee89068ef4c06e Mon Sep 17 00:00:00 2001 From: r00t Date: Thu, 16 Jul 2015 04:22:22 -0400 Subject: [PATCH] mageia/(open)?SUSE pkgs list done, untested. also, i am an idiot. --- lib/00-depcheck.func.sh | 11 ++++++++ lib/07-centos_is_stupid.func.sh | 48 +++++++++++++++++++++++---------- lib/prereqs/Mageia/meta | 2 +- lib/prereqs/Mageia/pkgs | 10 +++++-- lib/prereqs/openSUSE/pkgs | 22 +++++++++++++++ 5 files changed, 76 insertions(+), 17 deletions(-) diff --git a/lib/00-depcheck.func.sh b/lib/00-depcheck.func.sh index bc4155f..9f503af 100755 --- a/lib/00-depcheck.func.sh +++ b/lib/00-depcheck.func.sh @@ -39,6 +39,17 @@ function so_check_me_out { exit 1 fi + ## TWEAKS GO HERE. ## + # stupid gentoo. good riddance. + if [[ "${HOST_DIST}" == "Gentoo" ]]; + then + grep -q 'app-arch/lzma' /etc/portage/package.accept_keywords + if [[ "${?}" != "0" ]]; + then + echo 'app-arch/lzma' >> /etc/portage/package.accept_keywords + fi + fi + # So we've validated the distro. Here, check for packages and install if necessary. maybe use an array, but it'd be better to soft-fail if one of the packages is missing. DISTRO_DIR="${BASEDIR}/lib/prereqs/${HOST_DIST}" diff --git a/lib/07-centos_is_stupid.func.sh b/lib/07-centos_is_stupid.func.sh index c26790d..944713f 100644 --- a/lib/07-centos_is_stupid.func.sh +++ b/lib/07-centos_is_stupid.func.sh @@ -2,23 +2,43 @@ function centos_is_stupid { FUNCNAME="centos_is_stupid" - rpm -qa | egrep "^xorriso-[0-9]" > /dev/null 2>&1 - if [[ "${?}" != "0" ]]; + if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]]; then - # Download/install the proper xorriso - EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')" - if (("${EL_VER}" < "7")); + rpm -qa | egrep -q "^xorriso-[0-9]" + if [[ "${?}" != "0" ]]; then - echo "Wow. Your CentOS/RHEL is too old. Sorry; this is only supported on CentOS/RHEL 7 and up." - exit 1 + # Download/install the proper xorriso + EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')" + if (("${EL_VER}" < "7")); + then + echo "Wow. Your CentOS/RHEL is too old. Sorry; this is only supported on CentOS/RHEL 7 and up." + exit 1 + fi + XORRISO_RPM=$(curl -s http://pkgs.repoforge.org/xorriso/ | egrep "\"xorriso-[0-9.-]*el${EL_VER}.rf.x86_64.rpm\"" | sed -re "s/^.*\"(xorriso[0-9.-]*el${EL_VER}.rf.x86_64.rpm).*$/\1/g") + echo "Since you're using either CentOS or RHEL, we need to install xorriso directly from an RPM. Please wait while we do this..." + curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM} + yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 + echo "Done." + echo fi - XORRISO_RPM=$(curl -s http://pkgs.repoforge.org/xorriso/ | egrep "\"xorriso-[0-9.-]*el${EL_VER}.rf.x86_64.rpm\"" | sed -re "s/^.*\"(xorriso[0-9.-]*el${EL_VER}.rf.x86_64.rpm).*$/\1/g") - echo "Since you're using either CentOS or RHEL, we need to install xorriso directly from an RPM. Please wait while we do this..." - curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM} - yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 - echo "Done." - echo + # We used to fetch and compile mksquashfs from source here, but no longer- because a new enough version is *finally* in CentOS repos as of CentOS 7. fi - # We used to fetch and compile mksquashfs from source here, but no longer- because a new enough version is *finally* in CentOS repos as of CentOS 7. + # UGH. And you know what? Fuck SUSE too. + if [[ "${HOST_DIST}" == "openSUSE" || "${HOST_DIST}" == "SUSE" ]]; + then + rpm -qa | egrep -q "^xorriso-[0-9]" + if [[ "${?}" != "0" ]]; + then + # Download/install the proper xorriso + source /etc/os-release + SUSE_VER="${VERSION_ID}" + XORRISO_RPM=$(curl -s "http://software.opensuse.org/download.html?project=home%3AKnolleblau&package=xorriso" | egrep "/openSUSE_${SUSE_VER}/x86_64/xorriso-[0-9.-]" | tail -n1 | sed -re 's|^.*x86_64/(xorriso-[0-9.-]*.x86_64.rpm).*$|\1|g') + echo "Since you're using openSUSE or SLED/SLES, we need to install xorriso directly from an RPM. Please wait while we do this..." + curl -sLo /tmp/${XORRISO_RPM} "http://download.opensuse.org/repositories/home:/Knolleblau/openSUSE_${SUSE_VER}/x86_64/${XORRISO_RPM}" + zypper install --no-confirm -l /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 + echo "Done." + echo + fi + fi } diff --git a/lib/prereqs/Mageia/meta b/lib/prereqs/Mageia/meta index c7e0156..4f235da 100644 --- a/lib/prereqs/Mageia/meta +++ b/lib/prereqs/Mageia/meta @@ -1,7 +1,7 @@ NAME='Mageia' SUPPORTED='yes' CHECK_METHOD='egrep "^Mageia\ release\ " /etc/mageia-release' -PKG_MGR='urpmi ${pkgname}' +PKG_MGR='urpmi --force ${pkgname}' PRE_RUN='urpmi.update -a' PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"' URL='https://www.mageia.org/' diff --git a/lib/prereqs/Mageia/pkgs b/lib/prereqs/Mageia/pkgs index ab94131..23a8380 100644 --- a/lib/prereqs/Mageia/pkgs +++ b/lib/prereqs/Mageia/pkgs @@ -3,7 +3,14 @@ binutils-devel curl gcc git -libisofs +lib64isofs6 +lib64apr1_0 +lib64apr-util1_0 +lib64lzma5 +lib64lzma-devel +lib64lzmalib1 +lib64lzmalib-devel +libstdc++-devel lynx make mtools @@ -16,6 +23,5 @@ syslinux syslinux-devel xorriso xz -xz-devel zlib zlib-devel diff --git a/lib/prereqs/openSUSE/pkgs b/lib/prereqs/openSUSE/pkgs index e69de29..534b61e 100644 --- a/lib/prereqs/openSUSE/pkgs +++ b/lib/prereqs/openSUSE/pkgs @@ -0,0 +1,22 @@ +binutils +binutils-devel +curl +gcc +gcc-32bit +git +libisoburn1 +libisofs6 +lynx +make +mtools +patch +perl +rsync +sed +squashfs +syslinux +xz +xz-devel +xz-devel-32bit +zlib-devel +zlib-devel-32bit