Discussion:
[SATYR PATCH 1/2] Build python api manpage conditionally
Martin Milata
2013-08-30 13:19:55 UTC
Permalink
Related to #100.

Signed-off-by: Martin Milata <mmilata-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
configure.ac | 7 +++++++
python/doc/Makefile.am | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 2b16250..63769b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,13 @@ PKG_CHECK_MODULES([PYTHON], [python2],,[
PYTHON_CFLAGS='-I/usr/include/python2.6'
])

+AC_ARG_ENABLE([python-manpage],
+ [AS_HELP_STRING([--disable-python-manpage],
+ [Disable python bindings manpage build])],
+ [enable_python_manpage=$enableval],
+ [enable_python_manpage=yes])
+AM_CONDITIONAL(ENABLE_PYTHON_MANPAGE, [test $enable_python_manpage = yes])
+
AC_CHECK_LIB([opcodes], [main], [have_libopcodes=yes], [have_libopcodes=no])
[if test "$have_libopcodes" = "no" -a "$target_cpu" = "x86_64"; then]
[echo "The libopcodes library was not found in the search path. The core stacktrace support "]
diff --git a/python/doc/Makefile.am b/python/doc/Makefile.am
index 4dc6221..a0350cf 100644
--- a/python/doc/Makefile.am
+++ b/python/doc/Makefile.am
@@ -133,6 +133,8 @@ EXTRA_DIST = \
stacktrace.rst \
clustering.rst

-man3_MANS = _build/man/satyr-python.3
+if ENABLE_PYTHON_MANPAGE
+ man3_MANS = _build/man/satyr-python.3
+endif

_build/man/satyr-python.3: conf.py man
--
1.8.3.1
Martin Milata
2013-08-30 13:19:56 UTC
Permalink
Related to #100.

Signed-off-by: Martin Milata <mmilata-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
satyr.spec.in | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/satyr.spec.in b/satyr.spec.in
index 795d007..71b738f 100644
--- a/satyr.spec.in
+++ b/satyr.spec.in
@@ -1,5 +1,12 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

+# rhel6's python-sphinx cannot build manual pages
+%if 0%{?rhel} && 0%{?rhel} <= 6
+ %define enable_python_manpage 0
+%else
+ %define enable_python_manpage 1
+%endif
+
Name: satyr
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
@@ -11,7 +18,10 @@ Source0: https://fedorahosted.org/released/abrt/satyr-%{version}.tar.xz
BuildRequires: python2-devel
BuildRequires: elfutils-devel, elfutils-libelf-devel, binutils-devel
BuildRequires: rpm-devel
+
+%if %{?enable_python_manpage}
BuildRequires: python-sphinx
+%endif

%description
Satyr is a library that can be used to create and process microreports.
@@ -42,7 +52,12 @@ Python bindings for %{name}.
%setup -q

%build
-%configure --disable-static
+%configure \
+%if ! %{?enable_python_manpage}
+ --disable-python-manpage \
+%endif
+ --disable-static
+
make %{?_smp_mflags}

%install
@@ -71,7 +86,10 @@ make check
%files python
%dir %{python_sitearch}/%{name}
%{python_sitearch}/%{name}/*
+
+%if %{?enable_python_manpage}
%{_mandir}/man3/satyr-python.3*
+%endif

%changelog
* Wed Aug 28 2013 Richard Marko<rmarko-H+wXaHxf7aLQT0dZR+***@public.gmane.org> 0.8-1
--
1.8.3.1
Michal Toman
2013-08-30 13:29:48 UTC
Permalink
both patches work, pushed
Post by Martin Milata
Related to #100.
---
configure.ac | 7 +++++++
python/doc/Makefile.am | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 2b16250..63769b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,13 @@ PKG_CHECK_MODULES([PYTHON], [python2],,[
PYTHON_CFLAGS='-I/usr/include/python2.6'
])
+AC_ARG_ENABLE([python-manpage],
+ [AS_HELP_STRING([--disable-python-manpage],
+ [Disable python bindings manpage build])],
+ [enable_python_manpage=$enableval],
+ [enable_python_manpage=yes])
+AM_CONDITIONAL(ENABLE_PYTHON_MANPAGE, [test $enable_python_manpage = yes])
+
AC_CHECK_LIB([opcodes], [main], [have_libopcodes=yes], [have_libopcodes=no])
[if test "$have_libopcodes" = "no" -a "$target_cpu" = "x86_64"; then]
[echo "The libopcodes library was not found in the search path. The core stacktrace support "]
diff --git a/python/doc/Makefile.am b/python/doc/Makefile.am
index 4dc6221..a0350cf 100644
--- a/python/doc/Makefile.am
+++ b/python/doc/Makefile.am
@@ -133,6 +133,8 @@ EXTRA_DIST = \
stacktrace.rst \
clustering.rst
-man3_MANS = _build/man/satyr-python.3
+if ENABLE_PYTHON_MANPAGE
+ man3_MANS = _build/man/satyr-python.3
+endif
_build/man/satyr-python.3: conf.py man
Loading...