From 20f675c28086258a24f63542524f0a064bc376e1 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 13 Oct 2018 10:46:02 +0000 Subject: [PATCH] make, scripts: Fix CentOS 7 build Signed-off-by: Jan Lindemann --- make/project.conf | 12 ++++++++---- make/projects-dir.mk | 3 +++ scripts/get-os.sh | 14 +++++++++++--- scripts/pgit.sh | 9 +++++++++ scripts/pkg-manager.sh | 7 +++++++ 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/make/project.conf b/make/project.conf index d76f4d66..ba0133d2 100644 --- a/make/project.conf +++ b/make/project.conf @@ -16,16 +16,20 @@ libname = none [pkg.requires.os] run = python -build = cvs, make, inkscape, pkg-config +build = cvs, make, inkscape + +[pkg.requires.centos] +run = hostname +build = epel-release, pkgconfig [pkg.requires.ubuntu-14] -build = realpath +build = realpath, pkg-config [pkg.requires.suse] -release = rpmbuild +release = rpmbuild, pkg-config [pkg.requires.debian] -release = devscripts, debhelper, dput, libparse-debcontrol-perl, fakeroot +release = devscripts, debhelper, dput, libparse-debcontrol-perl, fakeroot, pkg-config [pkg.run.post] rm -f /usr/bin/jcs diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 703db062..0490276d 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -141,6 +141,9 @@ clean-all-dirs: echo-prereq-build: @$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build" $(BUILD_PROJECTS) +echo-prereq-install: + @$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run" $(BUILD_PROJECTS) + echo-prereq-release: @$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run release" $(BUILD_PROJECTS) echo-os: diff --git a/scripts/get-os.sh b/scripts/get-os.sh index 1e5f900b..367c90f1 100755 --- a/scripts/get-os.sh +++ b/scripts/get-os.sh @@ -50,9 +50,15 @@ cmd_name_version() echo suse-tumbleweed exit 0 fi - if [ "$ID" != ubuntu ]; then - [ "$ID_LIKE" ] && ID=$ID_LIKE - fi + + case "$ID" in + ubuntu|centos) + ;; + *) + [ "$ID_LIKE" ] && ID=$ID_LIKE + ;; + esac + case "$ID" in debian) VERSION_NAME=`echo $PRETTY_NAME | awk 'NF>1{print $NF}' | sed 's%/.*%%' | tr '[A-Z]' '[a-z]'` @@ -73,6 +79,8 @@ cmd_name_version() ;; esac ;; + centos) + ;; ubuntu) ;; suse|opensuse) diff --git a/scripts/pgit.sh b/scripts/pgit.sh index 5c1d81c2..d19fcf17 100644 --- a/scripts/pgit.sh +++ b/scripts/pgit.sh @@ -45,6 +45,15 @@ config() run_git() { marker git "$@" + # sadly, CentOS 7 has git 1.8.3.1, which doesn't support -C + if [ "$1" = -C ]; then + ( + cd $2 + shift 2 + git "$@" + ) + return $? + fi git "$@" } diff --git a/scripts/pkg-manager.sh b/scripts/pkg-manager.sh index 50ae9844..4d28d7aa 100644 --- a/scripts/pkg-manager.sh +++ b/scripts/pkg-manager.sh @@ -67,6 +67,9 @@ cmd_install() } eval run sudo $env -S pacman $global_opts -S --needed "$@" ;; + centos) + eval run sudo $env -S yum $global_opts install -y "$@" + ;; *) fatal "Tried to install on unsupported platform \"$ID\"" ;; @@ -99,6 +102,10 @@ cmd_refresh() debian|ubuntu) eval run sudo $env -S apt-get $global_opts update "$@" ;; + centos) + eval run sudo $env -S yum $global_opts clean expire-cache "$@" + eval run sudo $env -S yum $global_opts makecache "$@" + ;; *) fatal "Tried to update unsupported platform \"$ID\"" ;;