Skip to content

Commit

Permalink
split libreport to a separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Moskovcak committed Jun 8, 2011
0 parents commit 3da4283
Show file tree
Hide file tree
Showing 150 changed files with 70,374 additions and 0 deletions.
339 changes: 339 additions & 0 deletions COPYING

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = po src

EXTRA_DIST = libreport.pc.in

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libreport.pc

RPM_DIRS = --define "_sourcedir `pwd`" \
--define "_rpmdir `pwd`" \
--define "_specdir `pwd`" \
--define "_builddir `pwd`" \
--define "_srcrpmdir `pwd`"

rpm:
autoconf --force
$(MAKE) dist
rpmbuild $(RPM_DIRS) -ba libreport.spec

srpm:
autoconf --force
$(MAKE) dist
rpmbuild $(RPM_DIRS) -bs libreport.spec

# value for overriding from command line
# e.g: make scratch-build DIST=f15
DIST=rawhide
scratch-build: srpm
koji build --scratch dist-$(DIST) `make srpm | grep Wrote | cut -d' ' -f2`
Empty file added README
Empty file.
29 changes: 29 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/sh
#echo "Running gen-version"
#./gen-version

mkdir -p m4
echo "Creating m4/aclocal.m4 ..."
test -r m4/aclocal.m4 || touch m4/aclocal.m4

echo "Running autopoint"
autopoint --force || exit 1

echo "Running intltoolize..."
intltoolize --force --copy --automake || exit 1

echo "Running aclocal..."
aclocal || exit 1

echo "Running libtoolize..."
libtoolize || exit 1

echo "Running autoheader..."
autoheader || return 1

echo "Running autoconf..."
autoconf --force || exit 1

echo "Running automake..."
automake --add-missing --force --copy || exit 1

133 changes: 133 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
AC_INIT([libreport], [2.0.2], [crash-catcher@fedorahosted.org])

AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])

AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_LN_S

AC_SYS_LARGEFILE
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall"

AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],
[Enable debug information])],
[CFLAGS="$CFLAGS -DDEBUG -ggdb -g"])

dnl ****** INTERNATIONALIZATION **********************
GETTEXT_PACKAGE=libreport
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])

IT_PROG_INTLTOOL([0.35.0])

dnl ****** END ****************************************

AM_PATH_PYTHON
if test -z "$PYTHON"; then
echo "*** Essential program python not found" 1>&2
exit 1
fi

AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
[if test "$ASCIIDOC" = "no"]
[then]
[echo "The asciidoc program was not found in the search path. Please ensure"]
[echo "that it is installed and its directory is included in the search path."]
[echo "Then run configure again before attempting to build ABRT."]
[exit 1]
[fi]

AC_PATH_PROG([XMLTO], [xmlto], [no])
[if test "$XMLTO" = "no"]
[then]
[echo "The xmlto program was not found in the search path. Please ensure"]
[echo "that it is installed and its directory is included in the search path."]
[echo "Then run configure again before attempting to build ABRT."]
[exit 1]
[fi]

PKG_CHECK_MODULES([GTK], [gtk+-2.0])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.21])
PKG_CHECK_MODULES([DBUS], [dbus-1])
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
PKG_CHECK_MODULES([NSS], [nss])
PKG_CHECK_MODULES([GNOME_KEYRING], [gnome-keyring-1])
# Just PKG_CHECK_MODULES([PYTHON], [python]) works only with python2.7+
# Below, if python is not found, we set up for python2.6 w/o checking:
PKG_CHECK_MODULES([PYTHON], [python],,[
PYTHON_LIBS='-L/usr/lib64 -lpython2.6'
PYTHON_CFLAGS='-I/usr/include/python2.6'
])

PKG_PROG_PKG_CONFIG

# FIXME: do we want to share the /etc/abrt dir?
CONF_DIR='${sysconfdir}/abrt'
VAR_RUN='${localstatedir}/run'
PLUGINS_CONF_DIR='${sysconfdir}/${PACKAGE_NAME}/plugins'
# and again share /etc/abrt ?
EVENTS_DIR='${sysconfdir}/abrt/events'
EVENTS_CONF_DIR='${sysconfdir}/${PACKAGE_NAME}/events.d'
PLUGINS_LIB_DIR='${libdir}/${PACKAGE_NAME}'
LIBEXEC_DIR='${libexecdir}'

DEBUG_DUMPS_DIR='${localstatedir}/spool/${PACKAGE_NAME}'
DEBUG_INFO_DIR='${localstatedir}/cache/${PACKAGE_NAME}-di'

AC_ARG_WITH(debugdumpsdir,
[AS_HELP_STRING([--with-debugdumpdir=DIR],
[Directory where debugdumps are created])],
[DEBUG_DUMPS_DIR="$withval"])

AC_ARG_WITH(debuginfosdir,
[AS_HELP_STRING([--with-debuginfodir=DIR],
[Directory where debuginfo is stored])],
[DEBUG_INFO_DIR="$withval"])

AC_SUBST(CONF_DIR)
AC_SUBST(VAR_RUN)
AC_SUBST(PLUGINS_CONF_DIR)
AC_SUBST(EVENTS_CONF_DIR)
AC_SUBST(EVENTS_DIR)
AC_SUBST(PLUGINS_LIB_DIR)
AC_SUBST(DEBUG_DUMPS_DIR)
AC_SUBST(DEBUG_INFO_DIR)
AC_SUBST(LIBEXEC_DIR)

# Initialize the test suite.
# AC_CONFIG_TESTDIR(tests)
# AC_CONFIG_FILES([tests/Makefile tests/atlocal])
# AM_MISSING_PROG([AUTOM4TE], [autom4te])
# Needed by tests/atlocal.in.
# AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])

AC_CONFIG_HEADERS([config.h])

AC_CONFIG_FILES([
Makefile
libreport.pc
src/include/Makefile
src/lib/Makefile
src/report-python/Makefile
src/Makefile
src/gtk-helpers/Makefile
src/gtk-helpers/libreport-gtk.pc
src/gui-wizard-gtk/Makefile
po/Makefile.in
])

# src/plugins/Makefile
# src/cli/Makefile
# po/Makefile.in
# icons/Makefile
#])

AC_OUTPUT
11 changes: 11 additions & 0 deletions libreport.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: libreport
Description: Generic library for reporting various problems
Version: @VERSION@
Requires: glib-2.0
Libs: -L${libdir} -lreport
Cflags: -fPIC -I${includedir}/libreport
176 changes: 176 additions & 0 deletions libreport.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
%{!?python_site: %define python_site %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
# platform-dependent
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Summary: Generic library for reporting various problems
Name: libreport
Version: 2.0.2
Release: 1%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: https://fedorahosted.org/abrt/
Source: https://fedorahosted.org/released/abrt/%{name}-%{version}.tar.gz
BuildRequires: dbus-devel
BuildRequires: gtk2-devel
BuildRequires: curl-devel
BuildRequires: rpm-devel >= 4.6
BuildRequires: desktop-file-utils
BuildRequires: libnotify-devel
BuildRequires: xmlrpc-c-devel
#why? BuildRequires: file-devel
BuildRequires: python-devel
BuildRequires: gettext
BuildRequires: libxml2-devel
BuildRequires: libtar-devel
BuildRequires: intltool
BuildRequires: libtool
BuildRequires: nss-devel
BuildRequires: texinfo
BuildRequires: asciidoc
BuildRequires: xmlto

# for rhel6
%if 0%{?rhel} >= 6
BuildRequires: gnome-keyring-devel
%else
BuildRequires: libgnome-keyring-devel
%endif

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Libraries providing API for reporting different problems in applications
to different bug targets like bugzilla, ftp, trac, etc...

%package devel
Summary: Development libraries and headers for libreport.
Group: Development/Libraries

%description devel
Development libraries and headers for libreport.

%package python
Summary: Python bindings for report-libs.
# Is group correct here? -
Group: System Environment/Libraries
Requires: libreport = %{version}-%{release}
Provides: report
# FIXME: just a workaround to make it work with python-meh, but we should probably provide -newt UI asap
Provides: report-newt
Obsoletes: report > 0.20

%description python
Python bindings for report-libs.

%package gtk
Summary: GTK frontend for libreport
Group: User Interface/Desktops
Requires: libreport = %{version}-%{release}
Provides: report-gtk
Obsoletes: report-gtk > 0.20

%description gtk
Applications for reporting bugs using libreport backend.

%package gtk-devel
Summary: Development libraries and headers for libreport.
Group: Development/Libraries
Requires: libreport-gtk = %{version}-%{release}
Provides: report-gtk
Obsoletes: report-gtk > 0.20

%description gtk-devel
Development libraries and headers for libreport-gtk.

%prep
%setup -q

%build
autoconf
%configure
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
CFLAGS="-fno-strict-aliasing"
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
%find_lang %{name}

# remove all .la and .a files
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f
mkdir -p ${RPM_BUILD_ROOT}/%{_initrddir}
mkdir -p $RPM_BUILD_ROOT/var/spool/abrt

# After everything is installed, remove info dir
rm -f %{buildroot}%{_infodir}/dir

%clean
rm -rf $RPM_BUILD_ROOT

%post gtk
# update icon cache
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%postun gtk
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans gtk
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README COPYING
%dir %{_sysconfdir}/abrt/
%config(noreplace) %{_sysconfdir}/abrt/report_event.conf
%{_libdir}/libreport.so.*
%{_libdir}/libabrt_dbus.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/libreport/abrt_dbus.h
%{_includedir}/libreport/dump_dir.h
%{_includedir}/libreport/event_config.h
%{_includedir}/libreport/hash_sha1.h
%{_includedir}/libreport/libreport.h
%{_includedir}/libreport/libreport_problem_data.h
%{_includedir}/libreport/libreport_types.h
%{_includedir}/libreport/logging.h
%{_includedir}/libreport/parse_options.h
%{_includedir}/libreport/problem_data.h
%{_includedir}/libreport/read_write.h
%{_includedir}/libreport/report.h
%{_includedir}/libreport/run_event.h
%{_includedir}/libreport/strbuf.h
%{_includedir}/libreport/xfuncs.h
%{_libdir}/libreport.so
%{_libdir}/libabrt_dbus.so
%{_libdir}/pkgconfig/libreport.pc

%files python
%defattr(-,root,root,-)
%{python_sitearch}/report/*

%files gtk
%defattr(-,root,root,-)
%{_bindir}/bug-reporting-wizard
%{_libdir}/libreport-gtk.so.*
%{_libdir}/pkgconfig/libreport-gtk.pc

%files gtk-devel
%defattr(-,root,root,-)
%{_libdir}/libreport-gtk.so
%{_includedir}/libreport/libreport-gtk.h


%changelog
* Wed Jun 01 2011 Jiri Moskovcak <jmoskovc@redhat.com> 2.0.2
- initial packaging
Empty file added po/ChangeLog
Empty file.
Loading

0 comments on commit 3da4283

Please sign in to comment.