SHA256
1
0
forked from pool/nut

Accepting request 976497 from home:sbrabec:branches:nut-doc

- Build the basic documentation again (bsc#1197789#c7).
- Make possible to build PDF documentation.

OBS-URL: https://build.opensuse.org/request/show/976497
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=99
This commit is contained in:
Stanislav Brabec 2022-05-16 14:49:54 +00:00 committed by Git OBS Bridge
parent 4f5ecf4e70
commit 55c707f53d
2 changed files with 154 additions and 17 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed May 11 23:01:34 UTC 2022 - Stanislav Brabec <sbrabec@suse.com>
- Build the basic documentation again (bsc#1197789#c7).
- Make possible to build PDF documentation.
-------------------------------------------------------------------
Wed Apr 27 12:54:07 UTC 2022 - Jan Engelhardt <jengelh@inai.de>

165
nut.spec
View File

@ -16,8 +16,10 @@
#
%define CGIPATH %{apache_serverroot}/cgi-bin
%define HTMLPATH %{apache_serverroot}/htdocs
%bcond_with texdoc
%define CGIPATH %{apache_serverroot}/cgi-bin/nut
%define HTMLPATH %{apache_serverroot}/htdocs/nut
%define MODELPATH %{_libexecdir}/ups/driver
%define STATEPATH %{_localstatedir}/lib/ups
%define CONFPATH %{_sysconfdir}/ups
@ -98,13 +100,6 @@ Supplements: %{USBNONHIDDRIVERS}
Provides: nut-classic = %{version}
Obsoletes: nut-classic < %{version}
Obsoletes: nut-hal < %{version}
# Obsolete all the docu stuff with now disabled tex dependency
Obsoletes: %{name}-devel-doc-html
Obsoletes: %{name}-devel-doc-pdf
Obsoletes: %{name}-doc-asciidoc
Obsoletes: %{name}-doc-html
Obsoletes: %{name}-doc-images
Obsoletes: %{name}-doc-pdf
%{?systemd_requires}
BuildRequires: pkgconfig(bash-completion)
%ifarch %{ix86} x86_64 ia64
@ -113,6 +108,13 @@ BuildRequires: pkgconfig(libfreeipmi)
%if 0%{?suse_version} >= 1500
Requires(pre): user(upsd)
%endif
%if %{with texdoc}
BuildRequires: asciidoc-latex-backend
%else
# Obsolete all the docu stuff with disabled tex dependencies
Obsoletes: %{name}-devel-doc-pdf <= %{version}
Obsoletes: %{name}-doc-pdf <= %{version}
%endif
%description
Core package of Network UPS Tools.
@ -193,6 +195,94 @@ Requires: openssl-devel
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package doc-asciidoc
Summary: Network UPS Tools - Documentation in AsciiDoc Format
Group: Documentation/Other
Requires: %{name}-doc-images = %{version}
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description doc-asciidoc
NUT manuals in AsciiDoc format (human readable source).
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package devel-doc-html
Summary: Network UPS Tools - Documentation in HTML
# For CSS files:
Group: Documentation/HTML
Requires: %{name}-doc-html = %{version}
Requires: %{name}-doc-images = %{version}
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description devel-doc-html
Developer manual in HTML format.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package doc-html
Summary: Network UPS Tools - Documentation in HTML
Group: Documentation/HTML
Requires: %{name}-doc-images = %{version}
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description doc-html
User manual in HTML format.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package doc-images
Summary: Network UPS Tools - Images for Documentation
Group: Documentation/Other
Requires: %{name}-doc-images = %{version}
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description doc-images
Images for the documentation. It is a supplementary package for some NUT
documentation packages.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%if %{with texdoc}
%package doc-pdf
Summary: Network UPS Tools - Documentation in PDF
Group: Documentation/Other
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description doc-pdf
User manual in PDF format.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package devel-doc-pdf
Summary: Network UPS Tools - Documentation in PDF
Group: Documentation/Other
Recommends: %{name} = %{version}
Enhances: %{name}
BuildArch: noarch
%description devel-doc-pdf
Developer manual in PDF format.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%endif
%prep
%setup -q
cp -a %{SOURCE2} %{SOURCE6} %{SOURCE7} .
@ -223,7 +313,11 @@ export CXXFLAGS="%{optflags} -std=gnu++14"
--sysconfdir=%{CONFPATH} \
--datadir=%{_datadir}/nut \
--with-all \
--without-doc \
%if %{with texdoc}
--with-doc \
%else
--with-doc="html-single html-chunked" \
%endif
--with-ssl \
--with-openssl \
--without-nss \
@ -262,14 +356,20 @@ rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample
install -d %{buildroot}/usr/lib/systemd/system-sleep
install nut.system-sleep %{buildroot}/usr/lib/systemd/system-sleep/%{name}.sh
# Rename web pages to not conflict with apache2-example-pages or user home page:
mkdir %{buildroot}%{HTMLPATH}/nut %{buildroot}%{CGIPATH}/nut
mv %{buildroot}%{HTMLPATH}/*.{html,png} %{buildroot}%{HTMLPATH}/nut/
mv %{buildroot}%{CGIPATH}/*.cgi %{buildroot}%{CGIPATH}/nut
mkdir -p %{buildroot}%{bashcompletionsdir}
install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{bashcompletionsdir}/nut
# Documentation
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -a docs/*.txt docs/cables docs/images %{buildroot}%{_docdir}/%{name}/
cp -a docs/*.css docs/*.html %{buildroot}%{_docdir}/%{name}/
%if %{with texdoc}
cp -a docs/*.pdf %{buildroot}%{_docdir}/%{name}/
%endif
# Not needed for packaged contents:
rm %{buildroot}%{_docdir}/%{name}/packager-guide.*
# Create symlinks for man pages
%fdupes -s %{buildroot}%{_mandir}
@ -365,8 +465,8 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_libdir}/libupsclient.so.*
%files cgi
%{CGIPATH}/nut
%{HTMLPATH}/nut
%{CGIPATH}
%{HTMLPATH}
%config(noreplace) %{CONFPATH}/upsstats-single.html
%config(noreplace) %{CONFPATH}/upsstats.html
@ -376,4 +476,35 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/*%{ext_man}
%files doc-asciidoc
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/*.txt
%{_docdir}/%{name}/cables
%files devel-doc-html
%{_docdir}/%{name}/developer-guide.html
%files doc-html
%{_docdir}/%{name}/FAQ.html
%{_docdir}/%{name}/cables.html
%{_docdir}/%{name}/user-manual.html
%{_docdir}/%{name}/*.css
%files doc-images
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/images
%if %{with texdoc}
%files doc-pdf
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/FAQ.pdf
%{_docdir}/%{name}/cables.pdf
%{_docdir}/%{name}/user-manual.pdf
%files devel-doc-pdf
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/developer-guide.pdf
%endif
%changelog