---
abrt.spec.in | 98 +++++++++++++++++++++++++++++++++++--------------
configure.ac | 29 +++++++++++++++
doc/Makefile.am | 2 +
src/plugins/Makefile.am | 10 +++--
4 files changed, 108 insertions(+), 31 deletions(-)
diff --git a/abrt.spec.in b/abrt.spec.in
index f8433c2..23be8b1 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -1,26 +1,42 @@
%{!?python_site: %global python_site %(%{__python} -c "from distutils.sysconfig
import get_python_lib; print get_python_lib(0)")}
# platform-dependent
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from
distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-%if 0%{?fedora} >= 14
- %bcond_without systemd
-%else
+
+%if 0%{?fedora:%{fedora} < 14}
%bcond_with systemd
+%else
+ %bcond_without systemd
%endif
-# systemd wasn't set by the code above - so we're on old Fedora or we're not
on Fedora at all
-%if %{without systemd}
- %if 0%{?rhel} >= 7
- %bcond_without systemd
- %else
- %bcond_with systemd
- %endif
+%if 0%{?rhel}%{?suse_version}
+ %bcond_with bodhi
+%else
+ %bcond_without bodhi
%endif
%if 0%{?rhel} >= 6
%define desktopvendor redhat
%else
+%if 0%{?suse_version}
+%define desktopvendor suse
+%else
%define desktopvendor fedora
%endif
+%endif
+
+%if 0%{?suse_version}
+%define dbus_devel dbus-1-devel
+%define libjson_devel libjson-devel
+%define nss_devel mozilla-nss-devel
+%define systemd_units systemd
+%define shadow_utils pwdutils
+%else
+%define dbus_devel dbus-devel
+%define libjson_devel json-c-devel
+%define nss_devel nss-devel
+%define systemd_units systemd-units
+%define shadow_utils shadow-utils
+%endif
Summary: Automatic bug detection and reporting tool
Name: abrt
@@ -30,7 +46,7 @@ License: GPLv2+
Group: Applications/System
URL:
https://fedorahosted.org/abrt/
Source:
https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
-BuildRequires: dbus-devel
+BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
BuildRequires: rpm-devel >= 4.6
BuildRequires: desktop-file-utils
@@ -41,20 +57,25 @@ BuildRequires: gettext
BuildRequires: libxml2-devel
BuildRequires: intltool
BuildRequires: libtool
-BuildRequires: nss-devel
+BuildRequires: %{nss_devel}
BuildRequires: asciidoc
BuildRequires: doxygen
BuildRequires: xmlto
BuildRequires: libreport-devel >= 2.1.0
BuildRequires: btparser-devel
+# these only exist on suse
+%if 0%{?suse_version}
+BuildRequires: dbus-1-glib-devel
+Requires: dbus-1-glib
+%endif
Requires: libreport >= 2.1.0
%if %{with systemd}
-Requires: systemd-units
+Requires: %{systemd_units}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: %{name}-libs = %{version}-%{release}
-Requires(pre): shadow-utils
+Requires(pre): %{shadow_utils}
Obsoletes: abrt-plugin-sqlite3 > 0.0.1
# required for transition from 1.1.13, can be removed after some time
Obsoletes: abrt-plugin-runapp > 0.0.1
@@ -152,9 +173,10 @@ Requires: crash
%description addon-vmcore
This package contains plugin for collecting kernel crash information from vmcore files.
+%if %{with bodhi}
%package plugin-bodhi
Summary: %{name}'s bodhi plugin
-BuildRequires: json-c-devel
+BuildRequires: %{libjson_devel}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
BuildRequires: libreport-web-devel >= 2.0.10
@@ -163,6 +185,7 @@ Provides: libreport-plugin-bodhi
%description plugin-bodhi
Search for a new updates in bodhi server.
+%endif
%package addon-python
Summary: %{name}'s addon for catching and analyzing Python exceptions
@@ -192,7 +215,10 @@ Requires: %{name} = %{version}-%{release}
Requires: abrt-tui
Requires: abrt-addon-kerneloops
Requires: abrt-addon-ccpp, abrt-addon-python
-Requires: libreport-plugin-bugzilla, libreport-plugin-logger
+Requires: libreport-plugin-logger
+%if 0%{?suse_version}
+Requires: libreport-plugin-bugzilla
+%endif
%description cli
Virtual package to make easy default installation on non-graphical environments.
@@ -216,8 +242,14 @@ Requires: abrt-addon-xorg
Requires: gdb >= 7.0-3
Requires: abrt-gui
Requires: gnome-abrt
+Requires: libreport-plugin-logger
+%if %{with bodhi}
Requires: abrt-plugin-bodhi
-Requires: libreport-plugin-logger, libreport-plugin-bugzilla
+%endif
+%if 0%{?suse_version}
+%else
+Requires: libreport-plugin-bugzilla
+%endif
Requires: libreport-plugin-ureport
Requires: libreport-fedora
#Requires: abrt-plugin-firefox
@@ -256,24 +288,32 @@ problems handled by ABRT in Python.
%build
autoconf
-%if 0%{?fedora} < 18
- %if 0%{?rhel} < 7
+
+%define var_base_dir tmp
+
+CFLAGS="%{optflags} -Werror" %configure \
+%if 0%{?suse_version}
+ --with-systemdsystemunitdir="%{_unitdir}" \
+%endif
+%if %{without bodhi}
+ --without-bodhi \
+%endif
+%if 0%{?rhel:%{rhel} < 7}
%define var_base_dir spool
- CFLAGS="%{optflags} -Werror" %configure --enable-doxygen-docs
--with-defaultdumplocation=/var/%{var_base_dir}/abrt --disable-silent-rules
- %else
- %define var_base_dir tmp
- CFLAGS="%{optflags} -Werror" %configure --enable-doxygen-docs
--disable-silent-rules
- %endif
-%else
- %define var_base_dir tmp
- CFLAGS="%{optflags} -Werror" %configure --enable-doxygen-docs
--disable-silent-rules
+ --with-defaultdumplocation=/var/%{var_base_dir}/abrt
%endif
+ --enable-doxygen-docs \
+ --disable-silent-rules
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
+make install DESTDIR=$RPM_BUILD_ROOT \
+ mandir=%{_mandir} \
+ dbusabrtdocdir=%{_defaultdocdir}/%{name}-dbus-%{version}/html/ \
+ example_pythondir=%{_defaultdocdir}/%{name}-python-%{version}/examples
+
%find_lang %{name}
# remove all .la and .a files
@@ -664,10 +704,12 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null
|| :
%files desktop
%defattr(-,root,root,-)
+%if %{with bodhi}
%files plugin-bodhi
%defattr(-,root,root,-)
%{_bindir}/abrt-bodhi
%{_mandir}/man1/abrt-bodhi.1.gz
+%endif
%files dbus
%defattr(-,root,root,-)
diff --git a/configure.ac b/configure.ac
index 9c6b9c7..8b33670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,20 @@
+# copy-pasted from libreport
+# ABRT_PARSE_WITH(PACKAGE)
+# -----------------------
+# For use in AC_ARG_WITH action-if-found, for packages default ON.
+# * Set NO_PACKAGE=YesPlease for --without-PACKAGE
+# * Unset NO_PACKAGE for --with-PACKAGE without ARG
+AC_DEFUN([ABRT_PARSE_WITH],
+ [m4_pushdef([ABRT_UC_PACKAGE], m4_toupper([$1]))dnl
+ if test "$withval" = "no"; then
+ NO_[]ABRT_UC_PACKAGE=YesPlease
+ elif test "$withval" = "yes"; then
+ NO_[]ABRT_UC_PACKAGE=
+ else
+ NO_[]ABRT_UC_PACKAGE=
+ fi
+ m4_popdef([ABRT_UC_PACKAGE])])
+
AC_INIT([abrt],
m4_esyscmd([cat ./abrt-version]),
[crash-catcher(a)fedorahosted.org])
@@ -161,6 +178,18 @@ AC_SUBST(EVENTS_DIR)
AC_SUBST(DEFAULT_DUMP_LOCATION)
AC_SUBST(DEFAULT_DUMP_DIR_MODE)
+AC_ARG_WITH(bodhi,
+AS_HELP_STRING([--with-bodhi],[use Bodhi plugin (default is YES)]),
+ABRT_PARSE_WITH([bodhi]))
+
+if test -z "$NO_BODHI"
+then
+PKG_CHECK_MODULES([JSON_C], [json])
+AM_CONDITIONAL(BUILD_BODHI, true)
+else
+AM_CONDITIONAL(BUILD_BODHI, false)
+fi dnl end NO_BODHI
+
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index ea3b47e..0f89599 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -18,7 +18,9 @@ MAN1_TXT += abrt-cli.txt
MAN1_TXT += abrt-action-save-package-data.txt
MAN1_TXT += abrt-install-ccpp-hook.txt
MAN1_TXT += abrt-action-analyze-vmcore.txt
+if BUILD_BODHI
MAN1_TXT += abrt-bodhi.txt
+endif
MAN1_TXT += abrt-action-analyze-ccpp-local.txt
MAN5_TXT =
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 33f201d..11672ae 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -22,8 +22,11 @@ bin_PROGRAMS = \
abrt-action-generate-core-backtrace \
abrt-action-analyze-backtrace \
abrt-retrace-client \
- abrt-dedup-client \
- abrt-bodhi
+ abrt-dedup-client
+
+if BUILD_BODHI
+bin_PROGRAMS += abrt-bodhi
+endif
libexec_PROGRAMS = abrt-action-install-debuginfo-to-abrt-cache
@@ -279,6 +282,7 @@ abrt_dedup_client_SOURCES = \
$(BTPARSER_LIBS) \
$(NSS_LIBS)
+if BUILD_BODHI
abrt_bodhi_SOURCES = \
bodhi.c
abrt_bodhi_CPPFLAGS = \
@@ -295,7 +299,7 @@ abrt_bodhi_SOURCES = \
$(RPM_LIBS) \
$(LIBREPORT_LIBS) \
$(LIBREPORT_WEB_LIBS)
-
+endif
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
--
1.8.1.4