#1 Add bcond_without docs
Merged 5 years ago by eclipseo. Opened 5 years ago by kanarip.
rpms/ kanarip/python-hyperlink epel8  into  master

Add bcond_without docs
Jeroen van Meeuwen (Kolab Systems) • 5 years ago  
file modified
+10
@@ -6,6 +6,8 @@ 

  used several just to read this text. Hyperlink is a featureful, pure-Python

  implementation of the URL, with an emphasis on correctness.}

  

+ %bcond_without docs

+ 

  Name:           python-%{pypi_name}

  Version:        18.0.0

  Release:        5%{?dist}
@@ -30,11 +32,13 @@ 

  BuildRequires:  python3dist(unittest2)

  BuildRequires:  python3dist(sphinx)

  

+ %if %{with docs}

  # Unbundle fonts and JS

  BuildRequires:  fontawesome-fonts

  BuildRequires:  fontawesome-fonts-web

  BuildRequires:  js-underscore

  BuildRequires:  js-jquery

+ %endif # with docs

  

  %{?python_enable_dependency_generator}

  
@@ -58,6 +62,7 @@ 

  %{common_description}

  

  

+ %if %{with docs}

  %package doc

  Summary:        Documentation for %{name}

  
@@ -70,6 +75,7 @@ 

  %{common_description}

  

  This is the documentation package for hyperlink.

+ %endif # with docs

  

  

  %prep
@@ -82,6 +88,7 @@ 

  %py2_build

  %py3_build

  

+ %if %{with docs}

  # generate html docs 

  PYTHONPATH=${PWD} sphinx-build-3 docs html

  # remove the sphinx-build leftovers
@@ -104,6 +111,7 @@ 

  ln -s /usr/share/javascript/jquery/3.2.1/jquery.min.js html/_static/jquery.js

  rm -f html/_static/jquery-3.2.1.js

  ln -s /usr/share/javascript/jquery/3.2.1/jquery.js html/_static/jquery-3.2.1.js

+ %endif # with docs

  

  

  %install
@@ -130,9 +138,11 @@ 

  %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

  

  

+ %if %{with docs}

  %files doc

  %doc html

  %license LICENSE

+ %endif # with docs

  

  

  %changelog

Allow package to be built without documentation, such as to avoid bringing in the node* penalty; requiring everything nodejs for the purposes of unbundling jquery and friends.

This package is in the recursive build dependency chain of fedpkg, meaning that it is important to be able to strip off build requirements and dependencies, so that ultimately something like fedpkg may be used in building everything node under the sun.

Pull-Request has been merged by eclipseo

5 years ago