# Charliecloud fedora package spec file # # Contributors: # Dave Love @loveshack # Michael Jennings @mej # Jordan Ogas @jogas # Reid Priedhorksy @reidpr # Don't try to compile python3 files with /usr/bin/python. %{?el7:%global __python %__python3} # Python files should specify a version, e.g., python3, python2. %define versionize_script() (sed -i 's,/env python,/env %1,g' %2) Name: charliecloud Version: 0.10 Release: 1%{?dist} Summary: Lightweight user-defined software stacks for high-performance computing License: ASL 2.0 URL: https://hpc.github.io/%{name}/ Source0: https://github.com/hpc/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc rsync %if 0%{?el7} BuildRequires: /usr/bin/python2 %else BuildRequires: /usr/bin/python3 %endif %description Charliecloud uses Linux user namespaces to run containers with no privileged operations or daemons and minimal configuration changes on center resources. This simple approach avoids most security risks while maintaining access to the performance and functionality already on offer. Container images can be built using Docker or anything else that can generate a standard Linux filesystem tree. For more information: https://hpc.github.io/charliecloud/ %package doc Summary: %{name} html documentation License: BSD and MIT and ASL 2.0 BuildArch: noarch Obsoletes: %{name}-doc < %{version}-%{release} %if 0%{?el7} BuildRequires: python-sphinx python-sphinx_rtd_theme Patch: epel-doc.patch %else BuildRequires: python3-sphinx python3-sphinx_rtd_theme %endif %description doc Html documentation for %{name}. %prep %setup -q # The version of sphinx-build on epel is old; to build the docs we must perform # the following hacks: # 0. patch doc-src/conf.py to find sphinx_rtd_theme # 1. edit Makefile to not treat warnings as errors; # 2. remove the 'widths: auto' syntax from doc-src/install.rst; # 3. remove the 'dedent: 0' syntax from doc-src/dev.rst; and # 4. comment out the minimum sphinx-version doc-src/from conf.py %if 0%{?el7} %patch -p1 sed -i 's/ -W / /' doc-src/Makefile sed -i '/^ *:widths: auto/d' doc-src/*.rst sed -i '/^ *:dedent: 0/d' doc-src/*.rst sed -i 's@needs_sphinx@#needs_sphinx@g' doc-src/conf.py %endif %if 0%{?el7} %{versionize_script python2 test/make-auto} %{versionize_script python2 test/docs-sane} %{versionize_script python2 test/make-perms-test} %else %{versionize_script python3 test/make-auto} %{versionize_script python3 test/docs-sane} %{versionize_script python3 test/make-perms-test} %endif %build %make_build CFLAGS="-std=c11 -pthread -g" make -C doc-src -k || : %install %make_install PREFIX=%{_prefix} cat > README.EL7 </etc/sysctl.d/51-userns.conf reboot Note for versions below RHEL7.6, you will also need to enable user namespaces: grubby --args=namespace.unpriv_enable=1 --update-kernel=ALL reboot Please visit https://hpc.github.io/charliecloud/ for more information. EOF # Use python-sphinx_rtd_theme packaged fonts. %{__rm} -f %{buildroot}%{_docdir}/%{name}/LICENSE %{__rm} -f %{buildroot}%{_docdir}/%{name}/README.rst %{__rm} -rf %{buildroot}%{_docdir}/%{name}/html/_static/css %{__rm} -rf %{buildroot}%{_docdir}/%{name}/html/_static/fonts %{__rm} -rf %{buildroot}%{_docdir}/%{name}/html/_static/js %if 0%{?el7} sphinxdir=%{python_sitelib}/sphinx_rtd_theme/static %else sphinxdir=%{python3_sitelib}/sphinx_rtd_theme/static %endif ln -s "${sphinxdir}/css" %{buildroot}%{_docdir}/%{name}-%{version}/html/_static/css ln -s "${sphinxdir}/fonts" %{buildroot}%{_docdir}/%{name}-%{version}/html/_static/fonts ln -s "${sphinxdir}/js" %{buildroot}%{_docdir}/%{name}-%{version}/html/_static/js %if !%{?el7} %{__mv} %{buildroot}/%{_docdir}/%{name}-%{version} %{buildroot}%{_docdir}/%{name} %endif %files %license LICENSE %doc README.rst %{?el7:README.EL7} %{_mandir}/man1/ch* # Helper scripts and binaries %{_libexecdir}/%{name}-%{version}/base.sh %{_libexecdir}/%{name}-%{version}/version.sh %{_bindir}/ch-* # Exclude experimental builder, ch-grow, as: # 1. umoci (a go package dependency) is not resolvable on fedora/epel; and # 2. the lark-parser pip submodule is not resolvable on fedora/epel. %exclude %{_bindir}/ch-grow # Temporarly exclude test suite packaging. %exclude %{_libexecdir}/%{name}-%{version}/test %exclude %{_libexecdir}/%{name}-%{version}/examples %files doc %license LICENSE %{_pkgdocdir}/html %changelog * Tue Sep 03 2019 - 0.10-1 - Patch doc-src/conf.py for epel - Fix doc-src/dev.rst - Fix libexec and doc install path for 0.10 changes - Tidy comments - New release * Thu Aug 22 2019 - 0.9.10-12 - Upate doc subpackage obsoletes * Mon Aug 19 2019 Dave love - 0.9.10-11 - Use canonical form for Source0 - remove main package dependency from doc, and make it noarch * Fri Aug 02 2019 0.9.10-10 - Tidy comments; fix typo * Thu Jul 25 2019 0.9.10-9 - Use python site variable; fix doc file reference * Tue Jul 23 2019 0.9.10-8 - Remove bundled js, css, and font bits * Mon Jul 22 2019 0.9.10-6 - Temporarily remove test suite * Wed Jul 10 2019 0.9.10-5 - Revert test and example install path change - Update test readme * Wed Jul 3 2019 0.9.10-4 - Add doc package * Tue Jul 2 2019 0.9.10-3 - Tidy comments - Update source URL - Build html documentation; add rsync dependency - Add el7 conditionals for documentation - Remove libexecdir definition - Add test suite README.TEST * Wed May 15 2019 0.9.10-2 - Fix comment typo - Move test suite install path * Tue May 14 2019 0.9.10-1 - New version - Fix README.EL7 sysctl command instruction - Add pre-built html documentation - Fix python dependency - Remove temporary test-package readme - Fixed capitalization of change log messages * Tue Apr 30 2019 0.9.9-4 - Move global python declaration * Mon Apr 29 2019 0.9.9-3 - Match bin files with wildcard * Mon Apr 29 2019 0.9.9-2 - Update macro comment - Fix release tag history * Tue Apr 16 2019 0.9.9-1 - New version - Move temp readme creation to install segment - Fix spec file macro * Tue Apr 02 2019 0.9.8-2 - Remove python2 build option * Thu Mar 14 2019 0.9.8-1 - Add initial Fedora/EPEL package