Signed-off-by: Michal Toman mtoman@redhat.com --- configure.ac | 29 +++++++++++++++++++++++++++++ doc/Makefile.am | 4 +++- src/plugins/Makefile.am | 9 +++++++-- 3 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index 1c93170..29b6884 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@fedorahosted.org]) @@ -173,6 +190,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..94d8f8f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -18,8 +18,10 @@ 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 -MAN1_TXT += abrt-bodhi.txt MAN1_TXT += abrt-action-analyze-ccpp-local.txt +if BUILD_BODHI +MAN1_TXT += abrt-bodhi.txt +endif
MAN5_TXT = MAN5_TXT += abrt.conf.txt diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index b249bf1..707378a 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -22,8 +22,12 @@ bin_PROGRAMS = \ abrt-action-generate-core-backtrace \ abrt-action-analyze-backtrace \ abrt-retrace-client \ - abrt-dedup-client \ + abrt-dedup-client + +if BUILD_BODHI +bin_PROGRAMS += \ abrt-bodhi +endif
libexec_PROGRAMS = abrt-action-install-debuginfo-to-abrt-cache
@@ -276,6 +280,7 @@ abrt_dedup_client_SOURCES = \ $(SATYR_LIBS) \ $(NSS_LIBS)
+if BUILD_BODHI abrt_bodhi_SOURCES = \ bodhi.c abrt_bodhi_CPPFLAGS = \ @@ -292,7 +297,7 @@ abrt_bodhi_SOURCES = \ $(RPM_LIBS) \ $(LIBREPORT_LIBS) \ $(LIBREPORT_WEB_LIBS) - +endif
DEFS = -DLOCALEDIR="$(localedir)" @DEFS@
Signed-off-by: Michal Toman mtoman@redhat.com --- abrt.spec.in | 102 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 28 deletions(-)
diff --git a/abrt.spec.in b/abrt.spec.in index 48533b7..92cee7c 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/%%7Bname%7D/%%7Bname%7D-%%7Bversion%7D.tar... -BuildRequires: dbus-devel +BuildRequires: %{dbus_devel} BuildRequires: gtk3-devel BuildRequires: rpm-devel >= 4.6 BuildRequires: desktop-file-utils @@ -41,22 +57,28 @@ 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 + ##satyr migration: #BuildRequires: satyr-devel 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 @@ -156,9 +178,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 @@ -167,6 +190,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 @@ -196,7 +220,11 @@ 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} +%else +Requires: libreport-plugin-bugzilla +%endif
%description cli Virtual package to make easy default installation on non-graphical environments. @@ -221,7 +249,12 @@ Requires: gdb >= 7.0-3 Requires: abrt-gui Requires: gnome-abrt Requires: abrt-plugin-bodhi -Requires: libreport-plugin-logger, libreport-plugin-bugzilla +Requires: libreport-plugin-logger +%if 0%{?suse_version} +%else +Requires: libreport-plugin-bugzilla +%endif + Requires: libreport-plugin-ureport %if 0%{?fedora} Requires: libreport-fedora @@ -265,24 +298,35 @@ problems handled by ABRT in Python.
%build autoconf -%if 0%{?fedora} < 18 - %if 0%{?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 + +%if 0%{?rhel:%{rhel} < 7} +%define var_base_dir spool %else - %define var_base_dir tmp - CFLAGS="%{optflags} -Werror" %configure --enable-doxygen-docs --disable-silent-rules +%define var_base_dir tmp %endif
+CFLAGS="%{optflags} -Werror" %configure \ +%if 0%{?suse_version} + --with-systemdsystemunitdir="%{_unitdir}" \ +%endif +%if %{without bodhi} + --without-bodhi \ +%endif +%if 0%{?rhel:%{rhel} < 7} + --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 @@ -670,10 +714,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,-)
crash-catcher@lists.fedorahosted.org