#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0-or-later
use strict;

# Copyright (c) 2017-2020 Mauro Carvalho Chehab <mchehab@kernel.org>
#

my $prefix = "./";
$prefix = "$ENV{'srctree'}/" if ($ENV{'srctree'});

my $conf = $prefix . "Documentation/conf.py";
my $requirement_file = $prefix . "Documentation/sphinx/requirements.txt";
my $virtenv_prefix = "sphinx_";

#
# Static vars
#

my %missing;
my $system_release;
my $need = 0;
my $optional = 0;
my $need_symlink = 0;
my $need_sphinx = 0;
my $need_pip = 0;
my $need_virtualenv = 0;
my $rec_sphinx_upgrade = 0;
my $verbose_warn_install = 1;
my $install = "";
my $virtenv_dir = "";
my $python_cmd = "";
my $activate_cmd;
my $min_version;
my $cur_version;
my $rec_version = "3.4.3";
my $latest_avail_ver;

#
# Command line arguments
#

my $pdf = 1;
my $virtualenv = 1;
my $version_check = 0;

#
# List of required texlive packages on Fedora and OpenSuse
#

my %texlive = (
	'amsfonts.sty'       => 'texlive-amsfonts',
	'amsmath.sty'        => 'texlive-amsmath',
	'amssymb.sty'        => 'texlive-amsfonts',
	'amsthm.sty'         => 'texlive-amscls',
	'anyfontsize.sty'    => 'texlive-anyfontsize',
	'atbegshi.sty'       => 'texlive-oberdiek',
	'bm.sty'             => 'texlive-tools',
	'capt-of.sty'        => 'texlive-capt-of',
	'cmap.sty'           => 'texlive-cmap',
	'ecrm1000.tfm'       => 'texlive-ec',
	'eqparbox.sty'       => 'texlive-eqparbox',
	'eu1enc.def'         => 'texlive-euenc',
	'fancybox.sty'       => 'texlive-fancybox',
	'fancyvrb.sty'       => 'texlive-fancyvrb',
	'float.sty'          => 'texlive-float',
	'fncychap.sty'       => 'texlive-fncychap',
	'footnote.sty'       => 'texlive-mdwtools',
	'framed.sty'         => 'texlive-framed',
	'luatex85.sty'       => 'texlive-luatex85',
	'multirow.sty'       => 'texlive-multirow',
	'needspace.sty'      => 'texlive-needspace',
	'palatino.sty'       => 'texlive-psnfss',
	'parskip.sty'        => 'texlive-parskip',
	'polyglossia.sty'    => 'texlive-polyglossia',
	'tabulary.sty'       => 'texlive-tabulary',
	'threeparttable.sty' => 'texlive-threeparttable',
	'titlesec.sty'       => 'texlive-titlesec',
	'ucs.sty'            => 'texlive-ucs',
	'upquote.sty'        => 'texlive-upquote',
	'wrapfig.sty'        => 'texlive-wrapfig',
	'ctexhook.sty'       => 'texlive-ctex',
);

#
# Subroutines that checks if a feature exists
#

sub check_missing(%)
{
	my %map = %{$_[0]};

	foreach my $prog (sort keys %missing) {
		my $is_optional = $missing{$prog};

		# At least on some LTS distros like CentOS 7, texlive doesn't
		# provide all packages we need. When such distros are
		# detected, we have to disable PDF output.
		#
		# So, we need to ignore the packages that distros would
		# need for LaTeX to work
		if ($is_optional == 2 && !$pdf) {
			$optional--;
			next;
		}

		if ($verbose_warn_install) {
			if ($is_optional) {
				print "Warning: better to also install \"$prog\".\n";
			} else {
				print "ERROR: please install \"$prog\", otherwise, build won't work.\n";
			}
		}
		if (defined($map{$prog})) {
			$install .= " " . $map{$prog};
		} else {
			$install .= " " . $prog;
		}
	}

	$install =~ s/^\s//;
}

sub add_package($$)
{
	my $package = shift;
	my $is_optional = shift;

	$missing{$package} = $is_optional;
	if ($is_optional) {
		$optional++;
	} else {
		$need++;
	}
}

sub check_missing_file($$$)
{
	my $files = shift;
	my $package = shift;
	my $is_optional = shift;

	for (@$files) {
		return if(-e $_);
	}

	add_package($package, $is_optional);
}

sub findprog($)
{
	foreach(split(/:/, $ENV{PATH})) {
		return "$_/$_[0]" if(-x "$_/$_[0]");
	}
}

sub find_python_no_venv()
{
	my $prog = shift;

	my $cur_dir = qx(pwd);
	$cur_dir =~ s/\s+$//;

	foreach my $dir (split(/:/, $ENV{PATH})) {
		next if ($dir =~ m,($cur_dir)/sphinx,);
		return "$dir/python3" if(-x "$dir/python3");
	}
	foreach my $dir (split(/:/, $ENV{PATH})) {
		next if ($dir =~ m,($cur_dir)/sphinx,);
		return "$dir/python" if(-x "$dir/python");
	}
	return "python";
}

sub check_program($$)
{
	my $prog = shift;
	my $is_optional = shift;

	return $prog if findprog($prog);

	add_package($prog, $is_optional);
}

sub check_perl_module($$)
{
	my $prog = shift;
	my $is_optional = shift;

	my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
	return if ($err == 0);

	add_package($prog, $is_optional);
}

sub check_python_module($$)
{
	my $prog = shift;
	my $is_optional = shift;

	return if (!$python_cmd);

	my $err = system("$python_cmd -c 'import $prog' 2>/dev/null /dev/null");
	return if ($err == 0);

	add_package($prog, $is_optional);
}

sub check_rpm_missing($$)
{
	my @pkgs = @{$_[0]};
	my $is_optional = $_[1];

	foreach my $prog(@pkgs) {
		my $err = system("rpm -q '$prog' 2>/dev/null >/dev/null");
		add_package($prog, $is_optional) if ($err);
	}
}

sub check_pacman_missing($$)
{
	my @pkgs = @{$_[0]};
	my $is_optional = $_[1];

	foreach my $prog(@pkgs) {
		my $err = system("pacman -Q '$prog' 2>/dev/null >/dev/null");
		add_package($prog, $is_optional) if ($err);
	}
}

sub check_missing_tex($)
{
	my $is_optional = shift;
	my $kpsewhich = findprog("kpsewhich");

	foreach my $prog(keys %texlive) {
		my $package = $texlive{$prog};
		if (!$kpsewhich) {
			add_package($package, $is_optional);
			next;
		}
		my $file = qx($kpsewhich $prog);
		add_package($package, $is_optional) if ($file =~ /^\s*$/);
	}
}

sub get_sphinx_fname()
{
	my $fname = "sphinx-build";
	return $fname if findprog($fname);

	$fname = "sphinx-build-3";
	if (findprog($fname)) {
		$need_symlink = 1;
		return $fname;
	}

	return "";
}

sub get_sphinx_version($)
{
	my $cmd = shift;
	my $ver;

	open IN, "$cmd --version 2>&1 |";
	while (<IN>) {
		if (m/^\s*sphinx-build\s+([\d\.]+)((\+\/[\da-f]+)|(b\d+))?$/) {
			$ver=$1;
			last;
		}
		# Sphinx 1.2.x uses a different format
		if (m/^\s*Sphinx.*\s+([\d\.]+)$/) {
			$ver=$1;
			last;
		}
	}
	close IN;
	return $ver;
}

sub check_sphinx()
{
	open IN, $conf or die "Can't open $conf";
	while (<IN>) {
		if (m/^\s*needs_sphinx\s*=\s*[\'\"]([\d\.]+)[\'\"]/) {
			$min_version=$1;
			last;
		}
	}
	close IN;

	die "Can't get needs_sphinx version from $conf" if (!$min_version);

	$virtenv_dir = $virtenv_prefix . "latest";

	my $sphinx = get_sphinx_fname();
	if ($sphinx eq "") {
		$need_sphinx = 1;
		return;
	}

	$cur_version = get_sphinx_version($sphinx);
	die "$sphinx didn't return its version" if (!$cur_version);

	if ($cur_version lt $min_version) {
		printf "ERROR: Sphinx version is %s. It should be >= %s\n",
		       $cur_version, $min_version;
		$need_sphinx = 1;
		return;
	}

	return if ($cur_version lt $rec_version);

	# On version check mode, just assume Sphinx has all mandatory deps
	exit (0) if ($version_check);
}

#
# Ancillary subroutines
#

sub catcheck($)
{
  my $res = "";
  $res = qx(cat $_[0]) if (-r $_[0]);
  return $res;
}

sub which($)
{
	my $file = shift;
	my @path = split ":", $ENV{PATH};

	foreach my $dir(@path) {
		my $name = $dir.'/'.$file;
		return $name if (-x $name );
	}
	return undef;
}

#
# Subroutines that check distro-specific hints
#

sub give_debian_hints()
{
	my %map = (
		"python-sphinx"		=> "python3-sphinx",
		"yaml"			=> "python3-yaml",
		"ensurepip"		=> "python3-venv",
		"virtualenv"		=> "virtualenv",
		"dot"			=> "graphviz",
		"convert"		=> "imagemagick",
		"Pod::Usage"		=> "perl-modules",
		"xelatex"		=> "texlive-xetex",
		"rsvg-convert"		=> "librsvg2-bin",
	);

	if ($pdf) {
		check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
				   "texlive-lang-chinese", 2);

		check_missing_file(["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"],
				   "fonts-dejavu", 2);

		check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
				    "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
				    "/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc"],
				   "fonts-noto-cjk", 2);
	}

	check_program("dvipng", 2) if ($pdf);
	check_missing(\%map);

	return if (!$need && !$optional);
	printf("You should run:\n") if ($verbose_warn_install);
	printf("\n\tsudo apt-get install $install\n");
}

sub give_redhat_hints()
{
	my %map = (
		"python-sphinx"		=> "python3-sphinx",
		"yaml"			=> "python3-pyyaml",
		"virtualenv"		=> "python3-virtualenv",
		"dot"			=> "graphviz",
		"convert"		=> "ImageMagick",
		"Pod::Usage"		=> "perl-Pod-Usage",
		"xelatex"		=> "texlive-xetex-bin",
		"rsvg-convert"		=> "librsvg2-tools",
	);

	my @fedora26_opt_pkgs = (
		"graphviz-gd",		# Fedora 26: needed for PDF support
	);

	my @fedora_tex_pkgs = (
		"texlive-collection-fontsrecommended",
		"texlive-collection-latex",
		"texlive-xecjk",
		"dejavu-sans-fonts",
		"dejavu-serif-fonts",
		"dejavu-sans-mono-fonts",
	);

	#
	# Checks valid for RHEL/CentOS version 7.x.
	#
	my $old = 0;
	my $rel;
	my $noto_sans_redhat = "google-noto-sans-cjk-ttc-fonts";
	$rel = $1 if ($system_release =~ /release\s+(\d+)/);

	if (!($system_release =~ /Fedora/)) {
		$map{"virtualenv"} = "python-virtualenv";

		if ($rel && $rel < 8) {
			$old = 1;
			$pdf = 0;

			printf("Note: texlive packages on RHEL/CENTOS <= 7 are incomplete. Can't support PDF output\n");
			printf("If you want to build PDF, please read:\n");
			printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n");
		}
	} else {
		if ($rel && $rel < 26) {
			$old = 1;
		}
		if ($rel && $rel >= 38) {
			$noto_sans_redhat = "google-noto-sans-cjk-fonts";
		}
	}
	if (!$rel) {
		printf("Couldn't identify release number\n");
		$old = 1;
		$pdf = 0;
	}

	if ($pdf) {
		check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
				    "/usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-Regular.ttc"],
				   $noto_sans_redhat, 2);
	}

	check_rpm_missing(\@fedora26_opt_pkgs, 2) if ($pdf && !$old);
	check_rpm_missing(\@fedora_tex_pkgs, 2) if ($pdf);
	check_missing_tex(2) if ($pdf);
	check_missing(\%map);

	return if (!$need && !$optional);

	if (!$old) {
		# dnf, for Fedora 18+
		printf("You should run:\n") if ($verbose_warn_install);
		printf("\n\tsudo dnf install -y $install\n");
	} else {
		# yum, for RHEL (and clones) or Fedora version < 18
		printf("You should run:\n") if ($verbose_warn_install);
		printf("\n\tsudo yum install -y $install\n");
	}
}

sub give_opensuse_hints()
{
	my %map = (
		"python-sphinx"		=> "python3-sphinx",
		"yaml"			=> "python3-pyyaml",
		"virtualenv"		=> "python3-virtualenv",
		"dot"			=> "graphviz",
		"convert"		=> "ImageMagick",
		"Pod::Usage"		=> "perl-Pod-Usage",
		"xelatex"		=> "texlive-xetex-bin",
	);

	# On Tumbleweed, this package is also named rsvg-convert
	$map{"rsvg-convert"} = "rsvg-view" if (!($system_release =~ /Tumbleweed/));

	my @suse_tex_pkgs = (
		"texlive-babel-english",
		"texlive-caption",
		"texlive-colortbl",
		"texlive-courier",
		"texlive-dvips",
		"texlive-helvetic",
		"texlive-makeindex",
		"texlive-metafont",
		"texlive-metapost",
		"texlive-palatino",
		"texlive-preview",
		"texlive-times",
		"texlive-zapfchan",
		"texlive-zapfding",
	);

	$map{"latexmk"} = "texlive-latexmk-bin";

	# FIXME: add support for installing CJK fonts
	#
	# I tried hard, but was unable to find a way to install
	# "Noto Sans CJK SC" on openSUSE

	check_rpm_missing(\@suse_tex_pkgs, 2) if ($pdf);
	check_missing_tex(2) if ($pdf);
	check_missing(\%map);

	return if (!$need && !$optional);
	printf("You should run:\n") if ($verbose_warn_install);
	printf("\n\tsudo zypper install --no-recommends $install\n");
}

sub give_mageia_hints()
{
	my %map = (
		"python-sphinx"		=> "python3-sphinx",
		"yaml"			=> "python3-yaml",
		"virtualenv"		=> "python3-virtualenv",
		"dot"			=> "graphviz",
		"convert"		=> "ImageMagick",
		"Pod::Usage"		=> "perl-Pod-Usage",
		"xelatex"		=> "texlive",
		"rsvg-convert"		=> "librsvg2",
	);

	my @tex_pkgs = (
		"texlive-fontsextra",
	);

	$map{"latexmk"} = "texlive-collection-basic";

	my $packager_cmd;
	my $noto_sans;
	if ($system_release =~ /OpenMandriva/) {
		$packager_cmd = "dnf install";
		$noto_sans = "noto-sans-cjk-fonts";
		@tex_pkgs = ( "texlive-collection-fontsextra" );
	} else {
		$packager_cmd = "urpmi";
		$noto_sans = "google-noto-sans-cjk-ttc-fonts";
	}


	if ($pdf) {
		check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
				    "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
				   $noto_sans, 2);
	}

	check_rpm_missing(\@tex_pkgs, 2) if ($pdf);
	check_missing(\%map);

	return if (!$need && !$optional);
	printf("You should run:\n") if ($verbose_warn_install);
	printf("\n\tsudo $packager_cmd $install\n");
}

sub give_arch_linux_hints()
{
	my %map = (
		"yaml"			=> "python-yaml",
		"virtualenv"		=> "python-virtualenv",
		"dot"			=> "graphviz",
		"convert"		=> "imagemagick",
		"xelatex"		=> "texlive-xetex",
		"latexmk"		=> "texlive-core",
		"rsvg-convert"		=> "extra/librsvg",
	);

	my @archlinux_tex_pkgs = (
		"texlive-core",
		"texlive-latexextra",
		"ttf-dejavu",
	);
	check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf);

	if ($pdf) {
		check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
				   "noto-fonts-cjk", 2);
	}

	check_missing(\%map);

	return if (!$need && !$optional);
	printf("You should run:\n") if ($verbose_warn_install);
	printf("\n\tsudo pacman -S $install\n");
}

sub give_gentoo_hints()
{
	my %map = (
		"yaml"			=> "dev-python/pyyaml",
		"virtualenv"		=> "dev-python/virtualenv",
		"dot"			=> "media-gfx/graphviz",
		"convert"		=> "media-gfx/imagemagick",
		"xelatex"		=> "dev-texlive/texlive-xetex media-fonts/dejavu",
		"rsvg-convert"		=> "gnome-base/librsvg",
	);

	check_missing_file(["/usr/share/fonts/dejavu/DejaVuSans.ttf"],
			   "media-fonts/dejavu", 2) if ($pdf);

	if ($pdf) {
		check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
				    "/usr/share/fonts/noto-cjk/NotoSerifCJK-Regular.ttc"],
				   "media-fonts/noto-cjk", 2);
	}

	check_missing(\%map);

	return if (!$need && !$optional);

	printf("You should run:\n") if ($verbose_warn_install);
	printf("\n");

	my $imagemagick = "media-gfx/imagemagick svg png";
	my $cairo = "media-gfx/graphviz cairo pdf";
	my $portage_imagemagick = "/etc/portage/package.use/imagemagick";
	my $portage_cairo = "/etc/portage/package.use/graphviz";

	if (qx(grep imagemagick $portage_imagemagick 2>/dev/null) eq "") {
		printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
	}
	if (qx(grep graphviz $portage_cairo 2>/dev/null) eq  "") {
		printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
	}

	printf("\tsudo emerge --ask $install\n");

}

sub check_distros()
{
	# Distro-specific hints
	if ($system_release =~ /Red Hat Enterprise Linux/) {
		give_redhat_hints;
		return;
	}
	if ($system_release =~ /CentOS/) {
		give_redhat_hints;
		return;
	}
	if ($system_release =~ /Scientific Linux/) {
		give_redhat_hints;
		return;
	}
	if ($system_release =~ /Oracle Linux Server/) {
		give_redhat_hints;
		return;
	}
	if ($system_release =~ /Fedora/) {
		give_redhat_hints;
		return;
	}
	if ($system_release =~ /Ubuntu/) {
		give_debian_hints;
		return;
	}
	if ($system_release =~ /Debian/) {
		give_debian_hints;
		return;
	}
	if ($system_release =~ /openSUSE/) {
		give_opensuse_hints;
		return;
	}
	if ($system_release =~ /Mageia/) {
		give_mageia_hints;
		return;
	}
	if ($system_release =~ /OpenMandriva/) {
		give_mageia_hints;
		return;
	}
	if ($system_release =~ /Arch Linux/) {
		give_arch_linux_hints;
		return;
	}
	if ($system_release =~ /Gentoo/) {
		give_gentoo_hints;
		return;
	}

	#
	# Fall-back to generic hint code for other distros
	# That's far from ideal, specially for LaTeX dependencies.
	#
	my %map = (
		"sphinx-build" => "sphinx"
	);
	check_missing_tex(2) if ($pdf);
	check_missing(\%map);
	print "I don't know distro $system_release.\n";
	print "So, I can't provide you a hint with the install procedure.\n";
	print "There are likely missing dependencies.\n";
}

#
# Common dependencies
#

sub deactivate_help()
{
	printf "\n    If you want to exit the virtualenv, you can use:\n";
	printf "\tdeactivate\n";
}

sub get_virtenv()
{
	my $ver;
	my $min_activate = "$ENV{'PWD'}/${virtenv_prefix}${min_version}/bin/activate";
	my @activates = glob "$ENV{'PWD'}/${virtenv_prefix}*/bin/activate";

	@activates = sort {$b cmp $a} @activates;

	foreach my $f (@activates) {
		next if ($f lt $min_activate);

		my $sphinx_cmd = $f;
		$sphinx_cmd =~ s/activate/sphinx-build/;
		next if (! -f $sphinx_cmd);

		my $ver = get_sphinx_version($sphinx_cmd);

		if (!$ver) {
			$f =~ s#/bin/activate##;
			print("Warning: virtual environment $f is not working.\nPython version upgrade? Remove it with:\n\n\trm -rf $f\n\n");
		}

		if ($need_sphinx && ($ver ge $min_version)) {
			return ($f, $ver);
		} elsif ($ver gt $cur_version) {
			return ($f, $ver);
		}
	}
	return ("", "");
}

sub recommend_sphinx_upgrade()
{
	my $venv_ver;

	# Avoid running sphinx-builds from venv if $cur_version is good
	if ($cur_version && ($cur_version ge $rec_version)) {
		$latest_avail_ver = $cur_version;
		return;
	}

	# Get the highest version from sphinx_*/bin/sphinx-build and the
	# corresponding command to activate the venv/virtenv
	($activate_cmd, $venv_ver) = get_virtenv();

	# Store the highest version from Sphinx existing virtualenvs
	if (($activate_cmd ne "") && ($venv_ver gt $cur_version)) {
		$latest_avail_ver = $venv_ver;
	} else {
		$latest_avail_ver = $cur_version if ($cur_version);
	}

	# As we don't know package version of Sphinx, and there's no
	# virtual environments, don't check if upgrades are needed
	if (!$virtualenv) {
		return if (!$latest_avail_ver);
	}

	# Either there are already a virtual env or a new one should be created
	$need_pip = 1;

	return if (!$latest_avail_ver);

	# Return if the reason is due to an upgrade or not
	if ($latest_avail_ver lt $rec_version) {
		$rec_sphinx_upgrade = 1;
	}

	return $latest_avail_ver;
}

#
# The logic here is complex, as it have to deal with different versions:
#	- minimal supported version;
#	- minimal PDF version;
#	- recommended version.
# It also needs to work fine with both distro's package and venv/virtualenv
sub recommend_sphinx_version($)
{
	my $virtualenv_cmd = shift;

	# Version is OK. Nothing to do.
	if ($cur_version && ($cur_version ge $rec_version)) {
		return;
	};

	if (!$need_sphinx) {
		# sphinx-build is present and its version is >= $min_version

		#only recommend enabling a newer virtenv version if makes sense.
		if ($latest_avail_ver gt $cur_version) {
			printf "\nYou may also use the newer Sphinx version $latest_avail_ver with:\n";
			printf "\tdeactivate\n"  if ($ENV{'PWD'} =~ /${virtenv_prefix}/);
			printf "\t. $activate_cmd\n";
			deactivate_help();

			return;
		}
		return if ($latest_avail_ver ge $rec_version);
	}

	if (!$virtualenv) {
		# No sphinx either via package or via virtenv. As we can't
		# Compare the versions here, just return, recommending the
		# user to install it from the package distro.
		return if (!$latest_avail_ver);

		# User doesn't want a virtenv recommendation, but he already
		# installed one via virtenv with a newer version.
		# So, print commands to enable it
		if ($latest_avail_ver gt $cur_version) {
			printf "\nYou may also use the Sphinx virtualenv version $latest_avail_ver with:\n";
			printf "\tdeactivate\n"  if ($ENV{'PWD'} =~ /${virtenv_prefix}/);
			printf "\t. $activate_cmd\n";
			deactivate_help();

			return;
		}
		print "\n";
	} else {
		$need++ if ($need_sphinx);
	}

	# Suggest newer versions if current ones are too old
	if ($latest_avail_ver && $latest_avail_ver ge $min_version) {
		# If there's a good enough version, ask the user to enable it
		if ($latest_avail_ver ge $rec_version) {
			printf "\nNeed to activate Sphinx (version $latest_avail_ver) on virtualenv with:\n";
			printf "\t. $activate_cmd\n";
			deactivate_help();

			return;
		}

		# Version is above the minimal required one, but may be
		# below the recommended one. So, print warnings/notes

		if ($latest_avail_ver lt $rec_version) {
			print "Warning: It is recommended at least Sphinx version $rec_version.\n";
		}
	}

	# At this point, either it needs Sphinx or upgrade is recommended,
	# both via pip

	if ($rec_sphinx_upgrade) {
		if (!$virtualenv) {
			print "Instead of install/upgrade Python Sphinx pkg, you could use pip/pypi with:\n\n";
		} else {
			print "To upgrade Sphinx, use:\n\n";
		}
	} else {
		print "\nSphinx needs to be installed either:\n1) via pip/pypi with:\n\n";
	}

	$python_cmd = find_python_no_venv();

	printf "\t$virtualenv_cmd $virtenv_dir\n";

	printf "\t. $virtenv_dir/bin/activate\n";
	printf "\tpip install -r $requirement_file\n";
	deactivate_help();

	printf "\n2) As a package with:\n";

	my $old_need = $need;
	my $old_optional = $optional;
	%missing = ();
	$pdf = 0;
	$optional = 0;
	$install = "";
	$verbose_warn_install = 0;

	add_package("python-sphinx", 0);

	check_distros();

	$need = $old_need;
	$optional = $old_optional;

	printf "\n    Please note that Sphinx >= 3.0 will currently produce false-positive\n";
	printf "   warning when the same name is used for more than one type (functions,\n";
	printf "   structs, enums,...). This is known Sphinx bug. For more details, see:\n";
	printf "\thttps://github.com/sphinx-doc/sphinx/pull/8313\n";
}

sub check_needs()
{
	# Check if Sphinx is already accessible from current environment
	check_sphinx();

	if ($system_release) {
		print "Detected OS: $system_release.\n";
	} else {
		print "Unknown OS\n";
	}
	printf "Sphinx version: %s\n\n", $cur_version if ($cur_version);

	# Check python command line, trying first python3
	$python_cmd = findprog("python3");
	$python_cmd = check_program("python", 0) if (!$python_cmd);

	# Check the type of virtual env, depending on Python version
	if ($python_cmd) {
		if ($virtualenv) {
			my $tmp = qx($python_cmd --version 2>&1);
			if ($tmp =~ m/(\d+\.)(\d+\.)/) {
				if ($1 < 3) {
					# Fail if it finds python2 (or worse)
					die "Python 3 is required to build the kernel docs\n";
				}
				if ($1 == 3 && $2 < 3) {
					# Need Python 3.3 or upper for venv
					$need_virtualenv = 1;
				}
			} else {
				die "Warning: couldn't identify $python_cmd version!";
			}
		} else {
			add_package("python-sphinx", 0);
		}
	}

	my $venv_ver = recommend_sphinx_upgrade();

	my $virtualenv_cmd;

	if ($need_pip) {
		# Set virtualenv command line, if python < 3.3
		if ($need_virtualenv) {
			$virtualenv_cmd = findprog("virtualenv-3");
			$virtualenv_cmd = findprog("virtualenv-3.5") if (!$virtualenv_cmd);
			if (!$virtualenv_cmd) {
				check_program("virtualenv", 0);
				$virtualenv_cmd = "virtualenv";
			}
		} else {
			$virtualenv_cmd = "$python_cmd -m venv";
			check_python_module("ensurepip", 0);
		}
	}

	# Check for needed programs/tools
	check_perl_module("Pod::Usage", 0);
	check_python_module("yaml", 0);
	check_program("make", 0);
	check_program("gcc", 0);
	check_program("dot", 1);
	check_program("convert", 1);

	# Extra PDF files - should use 2 for is_optional
	check_program("xelatex", 2) if ($pdf);
	check_program("rsvg-convert", 2) if ($pdf);
	check_program("latexmk", 2) if ($pdf);

	# Do distro-specific checks and output distro-install commands
	check_distros();

	if (!$python_cmd) {
		if ($need == 1) {
			die "Can't build as $need mandatory dependency is missing";
		} elsif ($need) {
			die "Can't build as $need mandatory dependencies are missing";
		}
	}

	# Check if sphinx-build is called sphinx-build-3
	if ($need_symlink) {
		printf "\tsudo ln -sf %s /usr/bin/sphinx-build\n\n",
		       which("sphinx-build-3");
	}

	recommend_sphinx_version($virtualenv_cmd);
	printf "\n";

	print "All optional dependencies are met.\n" if (!$optional);

	if ($need == 1) {
		die "Can't build as $need mandatory dependency is missing";
	} elsif ($need) {
		die "Can't build as $need mandatory dependencies are missing";
	}

	print "Needed package dependencies are met.\n";
}

#
# Main
#

while (@ARGV) {
	my $arg = shift(@ARGV);

	if ($arg eq "--no-virtualenv") {
		$virtualenv = 0;
	} elsif ($arg eq "--no-pdf"){
		$pdf = 0;
	} elsif ($arg eq "--version-check"){
		$version_check = 1;
	} else {
		print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
		print "Where:\n";
		print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
		print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
		print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
		exit -1;
	}
}

#
# Determine the system type. There's no standard unique way that would
# work with all distros with a minimal package install. So, several
# methods are used here.
#
# By default, it will use lsb_release function. If not available, it will
# fail back to reading the known different places where the distro name
# is stored
#

$system_release = qx(lsb_release -d) if which("lsb_release");
$system_release =~ s/Description:\s*// if ($system_release);
$system_release = catcheck("/etc/system-release") if !$system_release;
$system_release = catcheck("/etc/redhat-release") if !$system_release;
$system_release = catcheck("/etc/lsb-release") if !$system_release;
$system_release = catcheck("/etc/gentoo-release") if !$system_release;

# This seems more common than LSB these days
if (!$system_release) {
	my %os_var;
	if (open IN, "cat /etc/os-release|") {
		while (<IN>) {
			if (m/^([\w\d\_]+)=\"?([^\"]*)\"?\n/) {
				$os_var{$1}=$2;
			}
		}
		$system_release = $os_var{"NAME"};
		if (defined($os_var{"VERSION_ID"})) {
			$system_release .= " " . $os_var{"VERSION_ID"} if (defined($os_var{"VERSION_ID"}));
		} else {
			$system_release .= " " . $os_var{"VERSION"};
		}
	}
}
$system_release = catcheck("/etc/issue") if !$system_release;
$system_release =~ s/\s+$//;

check_needs;
