RHEL 7.x and clone distros are shipped with Sphinx 1.1.x, with is incompatible with Kernel ReST markups. So, on those systems, the only alternative is to install it via a Python virtual environment. While seeking for "pip" on CentOS 7.3, I noticed that it is not really needed, as python-virtualenv has its version packaged there already. So, remove this from the list of requirements for all distributions. With regards to PDF, we need at least texlive-tabulary extension, but that is not shipped there (at least on CentOS). So, disable PDF packages as a whole. Please notice, however, that texlive + amsmath is needed for ReST to properly handle ReST ".. math::" tags. Yet, Sphinx fall back to display the LaTeX math expressions as-is, if such extension is not available. So, let's just disable all texlive packages as a whole.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -216,7 +216,6 @@ sub check_sphinx() · 215 unmodified lines | ||
| 216 | 216 | $prog = findprog("virtualenv-3.5") if (!$prog); |
| 217 | 217 | |
| 218 | 218 | check_program("virtualenv", 0) if (!$prog); |
| 219 | − check_program("pip", 0) if (!findprog("pip3")); | |
| 220 | 219 | $need_sphinx = 1; |
| 221 | 220 | } else { |
| 222 | 221 | add_package("python-sphinx", 0); |
| @@ -256,7 +255,6 @@ sub give_debian_hints() · 33 unmodified lines | ||
| 256 | 255 | "python-sphinx" => "python3-sphinx", |
| 257 | 256 | "sphinx_rtd_theme" => "python3-sphinx-rtd-theme", |
| 258 | 257 | "virtualenv" => "virtualenv", |
| 259 | − "pip" => "python3-pip", | |
| 260 | 258 | "dot" => "graphviz", |
| 261 | 259 | "convert" => "imagemagick", |
| 262 | 260 | "Pod::Usage" => "perl-modules", |
| @@ -282,7 +280,6 @@ sub give_redhat_hints() · 19 unmodified lines | ||
| 282 | 280 | "python-sphinx" => "python3-sphinx", |
| 283 | 281 | "sphinx_rtd_theme" => "python3-sphinx_rtd_theme", |
| 284 | 282 | "virtualenv" => "python3-virtualenv", |
| 285 | − "pip" => "python3-pip", | |
| 286 | 283 | "dot" => "graphviz", |
| 287 | 284 | "convert" => "ImageMagick", |
| 288 | 285 | "Pod::Usage" => "perl-Pod-Usage", |
| @@ -302,6 +299,13 @@ sub give_redhat_hints() · 13 unmodified lines | ||
| 302 | 299 | "dejavu-sans-mono-fonts", |
| 303 | 300 | ); |
| 304 | 301 | |
| 302 | + # | |
| 303 | + # Checks valid for RHEL/CentOS version 7.x. | |
| 304 | + # | |
| 305 | + if (! $system_release =~ /Fedora/) { | |
| 306 | + $map{"virtualenv"} = "python-virtualenv"; | |
| 307 | + } | |
| 308 | + | |
| 305 | 309 | my $release; |
| 306 | 310 | |
| 307 | 311 | $release = $1 if ($system_release =~ /Fedora\s+release\s+(\d+)/); |
| @@ -312,7 +316,14 @@ sub give_redhat_hints() · 4 unmodified lines | ||
| 312 | 316 | check_missing(\%map); |
| 313 | 317 | |
| 314 | 318 | return if (!$need && !$optional); |
| 315 | − printf("You should run:\n\n\tsudo dnf install -y $install\n"); | |
| 319 | + | |
| 320 | + if ($release >= 18) { | |
| 321 | + # dnf, for Fedora 18+ | |
| 322 | + printf("You should run:\n\n\tsudo dnf install -y $install\n"); | |
| 323 | + } else { | |
| 324 | + # yum, for RHEL (and clones) or Fedora version < 18 | |
| 325 | + printf("You should run:\n\n\tsudo yum install -y $install\n"); | |
| 326 | + } | |
| 316 | 327 | } |
| 317 | 328 | |
| 318 | 329 | sub give_opensuse_hints() |
| @@ -321,7 +332,6 @@ sub give_opensuse_hints() · 2 unmodified lines | ||
| 321 | 332 | "python-sphinx" => "python3-sphinx", |
| 322 | 333 | "sphinx_rtd_theme" => "python3-sphinx_rtd_theme", |
| 323 | 334 | "virtualenv" => "python3-virtualenv", |
| 324 | − "pip" => "python3-pip", | |
| 325 | 335 | "dot" => "graphviz", |
| 326 | 336 | "convert" => "ImageMagick", |
| 327 | 337 | "Pod::Usage" => "perl-Pod-Usage", |
| @@ -360,7 +370,6 @@ sub give_mageia_hints() · 32 unmodified lines | ||
| 360 | 370 | "python-sphinx" => "python3-sphinx", |
| 361 | 371 | "sphinx_rtd_theme" => "python3-sphinx_rtd_theme", |
| 362 | 372 | "virtualenv" => "python3-virtualenv", |
| 363 | − "pip" => "python3-pip", | |
| 364 | 373 | "dot" => "graphviz", |
| 365 | 374 | "convert" => "ImageMagick", |
| 366 | 375 | "Pod::Usage" => "perl-Pod-Usage", |
| @@ -372,8 +381,6 @@ sub give_mageia_hints() · 5 unmodified lines | ||
| 372 | 381 | "texlive-fontsextra", |
| 373 | 382 | ); |
| 374 | 383 | |
| 375 | − my $release; | |
| 376 | − | |
| 377 | 384 | check_rpm_missing(\@tex_pkgs, 1) if ($pdf); |
| 378 | 385 | check_missing(\%map); |
| 379 | 386 | |
| @@ -386,7 +393,6 @@ sub give_arch_linux_hints() · 6 unmodified lines | ||
| 386 | 393 | my %map = ( |
| 387 | 394 | "sphinx_rtd_theme" => "python-sphinx_rtd_theme", |
| 388 | 395 | "virtualenv" => "python-virtualenv", |
| 389 | − "pip" => "python-pip", | |
| 390 | 396 | "dot" => "graphviz", |
| 391 | 397 | "convert" => "imagemagick", |
| 392 | 398 | "xelatex" => "texlive-bin", |
| @@ -410,7 +416,6 @@ sub give_gentoo_hints() · 17 unmodified lines | ||
| 410 | 416 | my %map = ( |
| 411 | 417 | "sphinx_rtd_theme" => "dev-python/sphinx_rtd_theme", |
| 412 | 418 | "virtualenv" => "dev-python/virtualenv", |
| 413 | − "pip" => "dev-python/pip", | |
| 414 | 419 | "dot" => "media-gfx/graphviz", |
| 415 | 420 | "convert" => "media-gfx/imagemagick", |
| 416 | 421 | "xelatex" => "dev-texlive/texlive-xetex media-fonts/dejavu", |
| @@ -438,6 +443,18 @@ sub check_distros() · 21 unmodified lines | ||
| 438 | 443 | give_redhat_hints; |
| 439 | 444 | return; |
| 440 | 445 | } |
| 446 | + if ($system_release =~ /CentOS/) { | |
| 447 | + give_redhat_hints; | |
| 448 | + return; | |
| 449 | + } | |
| 450 | + if ($system_release =~ /Scientific Linux/) { | |
| 451 | + give_redhat_hints; | |
| 452 | + return; | |
| 453 | + } | |
| 454 | + if ($system_release =~ /Oracle Linux Server/) { | |
| 455 | + give_redhat_hints; | |
| 456 | + return; | |
| 457 | + } | |
| 441 | 458 | if ($system_release =~ /Fedora/) { |
| 442 | 459 | give_redhat_hints; |
| 443 | 460 | return; |
| @@ -488,9 +505,22 @@ sub check_distros() · 44 unmodified lines | ||
| 488 | 505 | sub check_needs() |
| 489 | 506 | { |
| 490 | 507 | if ($system_release) { |
| 491 | − print "Checking if the needed tools for $system_release are available\n"; | |
| 508 | + print "Detected OS: $system_release.\n"; | |
| 492 | 509 | } else { |
| 493 | − print "Checking if the needed tools are present\n"; | |
| 510 | + print "Unknown OS\n"; | |
| 511 | + } | |
| 512 | + | |
| 513 | + # RHEL 7.x and clones have Sphinx version 1.1.x and incomplete texlive | |
| 514 | + if (($system_release =~ /Red Hat Enterprise Linux/) || | |
| 515 | + ($system_release =~ /CentOS/) || | |
| 516 | + ($system_release =~ /Scientific Linux/) || | |
| 517 | + ($system_release =~ /Oracle Linux Server/)) { | |
| 518 | + $virtualenv = 1; | |
| 519 | + $pdf = 0; | |
| 520 | + | |
| 521 | + printf("NOTE: On this distro, Sphinx and TexLive shipped versions are incompatible\n"); | |
| 522 | + printf("with doc build. So, use Sphinx via a Python virtual environment.\n\n"); | |
| 523 | + printf("This script can't install a TexLive version that would provide PDF.\n"); | |
| 494 | 524 | } |
| 495 | 525 | |
| 496 | 526 | # Check for needed programs/tools |