commit ad4861c962bee7d9b7f3e9e955aef687e1e3abfc
Author: Jakub Bogusz <[email protected]>
Date:   Sun Sep 17 11:48:32 2023 +0200

    - added apidocs, pass CC, BR: pkgconfig

 libtraceevent.spec | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
---
diff --git a/libtraceevent.spec b/libtraceevent.spec
index fb69b1f..f796080 100644
--- a/libtraceevent.spec
+++ b/libtraceevent.spec
@@ -1,5 +1,6 @@
 #
 # Conditional build:
+%bcond_without apidocs         # asciidoc documentation
 %bcond_without static_libs     # static libraries
 #
 Summary:       Linux kernel trace event library
@@ -12,6 +13,9 @@ Group:                Libraries
 Source0:       
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/%{name}-%{version}.tar.gz
 # Source0-md5: 5616c52896da1198f531e5612f35e2ca
 URL:           https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
+%{?with_apidocs:BuildRequires: asciidoc}
+BuildRequires: pkgconfig
+BuildRequires: rpm-build >= 4.6
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -44,16 +48,34 @@ Static %{name} library.
 %description static -l pl.UTF-8
 Statyczna biblioteka %{name}.
 
+%package apidocs
+Summary:       API documentation for libtraceevent in HTML format
+Summary(pl.UTF-8):     Dokumentacja API biblioteki libtraceevent w formacie 
HTML
+Group:         Documentation
+BuildArch:     noarch
+
+%description apidocs
+API documentation for libtraceevent in HTML format.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki libtraceevent w formacie HTML.
+
 %prep
 %setup -q
 
 %build
 %{__make} \
+       CC="%{__cc}" \
        CFLAGS="%{rpmcflags}" \
        VERBOSE=1 \
        prefix=%{_prefix} \
        libdir_relative=%{_lib}
 
+%if %{with apidocs}
+%{__make} doc \
+       V=1
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -63,6 +85,13 @@ rm -rf $RPM_BUILD_ROOT
        DESTDIR=$RPM_BUILD_ROOT \
        VERBOSE=1
 
+%if %{with apidocs}
+%{__make} doc-install \
+       prefix=%{_prefix} \
+       DESTDIR=$RPM_BUILD_ROOT \
+       V=1
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -83,9 +112,21 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libtraceevent.so
 %{_includedir}/traceevent
 %{_pkgconfigdir}/libtraceevent.pc
+%if %{with apidocs}
+%{_mandir}/man3/kbuffer_*.3*
+%{_mandir}/man3/libtraceevent.3*
+%{_mandir}/man3/tep_*.3*
+%{_mandir}/man3/trace_seq_*.3*
+%endif
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libtraceevent.a
 %endif
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%{_docdir}/libtraceevent-doc
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libtraceevent.git/commitdiff/ad4861c962bee7d9b7f3e9e955aef687e1e3abfc

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to