Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
This project follows the structure of:
https://cgit.freedesktop.org/realmd/realmd/
  • Loading branch information
Jakub Filak committed Mar 4, 2016
0 parents commit dc8f7f7
Show file tree
Hide file tree
Showing 22 changed files with 1,344 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jakub Filak <[email protected]>
502 changes: 502 additions & 0 deletions COPYING

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Please write commit messages in the following format:

=== begin example commit ===

Short explanation of the commit

Longer explanation explaining exactly what's changed, whether any external or
private interfaces changed, what bugs were fixed (with bug tracker reference
if applicable) and so forth. Be concise but not too brief.

=== end example commit ===
Empty file added INSTALL
Empty file.
10 changes: 10 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# A sort of sentinel for argument lists
NULL =

SUBDIRS = dbus service

run: all
service/reportd

debug: all
libtool --mode=execute gdb --ex=run --args service/reportd
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.1
* Initial release
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
D-Bus service for reporting problems that occurred within system
93 changes: 93 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir
PROJECT=reportd
TEST_TYPE=-f
FILE=service/report-daemon.cpp

DIE=0

# Some boiler plate to get git setup as expected
if test -d .git; then
if test -f .git/hooks/pre-commit.sample && \
test ! -f .git/hooks/pre-commit; then
cp -pv .git/hooks/pre-commit.sample .git/hooks/pre-commit
fi
fi

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
DIE=1
}

AUTOMAKE_VERSIONS="1.15 1.14 1.13 1.12 1.11 1.10"
for version in $AUTOMAKE_VERSIONS; do
if automake-$version --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-$version
ACLOCAL=aclocal-$version
break
fi
done

if test -z "$AUTOMAKE"; then
echo
echo "You must have one of automake $AUTOMAKE_VERSIONS to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
DIE=1
fi

if test "$DIE" -eq 1; then
exit 1
fi

test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
}

# NOCONFIGURE is used by gnome-common; support both
if ! test -z "$AUTOGEN_SUBDIR_MODE"; then
NOCONFIGURE=1
fi

if test -z "$NOCONFIGURE"; then
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
fi

rm -rf autom4te.cache

# README and INSTALL are required by automake, but may be deleted by clean
# up rules. to get automake to work, simply touch these here, they will be
# regenerated from their corresponding *.in files by ./configure anyway.
touch README INSTALL

libtoolize

$ACLOCAL $ACLOCAL_FLAGS || exit $?

intltoolize --force --copy || exit $?

autoheader || exit $?

$AUTOMAKE --add-missing || exit $?
autoconf || exit $?
cd $ORIGDIR || exit $?

if test -z "$NOCONFIGURE"; then
$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?

echo
echo "Now type 'make' to compile $PROJECT."
fi
1 change: 1 addition & 0 deletions build/m4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.m4
55 changes: 55 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
AC_INIT([reportd], [0.1], [[email protected]], [reportd])

INTLTOOL_REQ=0.35.0

AC_CONFIG_MACRO_DIR([build/m4])
AC_CONFIG_AUX_DIR([build])

AM_INIT_AUTOMAKE([-Wall tar-ustar])
AM_SANITY_CHECK

# Support silent build rules. Disable by either passing --disable-silent-rules
# to ./configure or passing V=1 to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
# The 'yes' argument is undocumented but it is common knowledge that it works.
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([service/report-daemon.cpp])


AM_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
IT_PROG_INTLTOOL($INTLTOOL_REQ)
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

AC_DISABLE_STATIC

GETTEXT_PACKAGE=reportd
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
AM_GLIB_GNU_GETTEXT

PKG_CHECK_MODULES([GLIB],
glib-2.0 >= 2.47
gio-2.0
gio-unix-2.0)
PKG_CHECK_MODULES([GLIBMM],
glibmm-2.4 >= 2.47
giomm-2.4)
PKG_CHECK_MODULES([LIBREPORT], [libreport])

CFLAGS="$CFLAGS -Wall -Wextra -Werror -std=c11"
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror -std=c++14"

AC_CONFIG_FILES([
Makefile
po/Makefile.in
dbus/Makefile
dbus/org.freedesktop.reportd.service
service/Makefile
])
AC_OUTPUT
48 changes: 48 additions & 0 deletions dbus/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

servicedir = $(DBUS_SERVICES_DIR)
service_in_files = \
org.freedesktop.reportd.service.in
service_DATA = $(service_in_files:.service.in=.service)

noinst_LIBRARIES = libreportd-dbus.a

BUILT_SOURCES = \
report-dbus-generated.c \
report-dbus-generated.h \
$(NULL)

libreportd_dbus_a_SOURCES = \
report-dbus-constants.h \
$(NULL)

nodist_libreportd_dbus_a_SOURCES = \
$(BUILT_SOURCES) \
$(NULL)

libreportd_dbus_a_CFLAGS = \
$(GLIB_CFLAGS) \
-Wno-unused-parameter
$(NULL)

DBUS_XML_DEFINITIONS = \
org.freedesktop.reportd.xml

DBUS_GENERATED = \
report-dbus-generated.c \
report-dbus-generated.h \
$(NULL)

$(DBUS_GENERATED): org.freedesktop.reportd.xml
$(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.reportd. \
--generate-c-code report-dbus-generated \
--c-namespace ReportDbus $<

EXTRA_DIST = \
$(DBUS_XML_DEFINITIONS) \
$(service_in_files) \
$(NULL)

CLEANFILES = \
$(DBUS_GENERATED) \
$(service_DATA) \
$(NULL)
3 changes: 3 additions & 0 deletions dbus/org.freedesktop.reportd.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.reportd
Exec=@libexec@/reportd
53 changes: 53 additions & 0 deletions dbus/org.freedesktop.reportd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/">

<!--
org.freedesktop.reortd.Service:
@short_description: the reportd service
The object is a singleton and sits on bus name
<literal>org.freedesktop.reportd</literal> with the object path
<literal>/org/freedesktop/reportd/Service</literal>
-->
<interface name="org.freedesktop.reportd.Service">

<!--
CreateTask:
-->
<method name="CreateTask">
<arg name="workflow" type="s" direction="in"/>
<arg name="problem" type="o" direction="in"/>
<arg name="task" type="o" direction="out"/>
</method>

<method name="GetWorkflows">
<arg name="problem" type="o" direction="in"/>
<arg name="workflows" type="a(sss)" direction="out"/>
</method>

</interface>

<!--
org.freedesktop.reportd.Task:
@short_description: a task
-->
<interface name="org.freedesktop.reportd.Task">

<method name="Start">
<!-- no arguments -->
</method>

<!--
Cancel:
@operation: the operation to cancel
-->
<method name="Cancel">
<!-- no arguments -->
</method>

<property name="Status" type="s" access="read"/>

</interface>

<node name="/">
23 changes: 23 additions & 0 deletions dbus/report-dbus-constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* reportd -- Software problem reporting service
*
* Copyright 2016 Red Hat Inc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2 of the licence or (at
* your option) any later version.
*
* See the included COPYING file for more information.
*
* Author: Jakub Filak <[email protected]>
*/

#ifndef __REPORT_DBUS_CONSTANTS__
#define __REPORT_DBUS_CONSTANTS__

#define REPORTD_DBUS_BUS_NAME "org.freedesktop.reportd"
#define REPORTD_DBUS_OBJECT_MANAGER_PATH "/org/freedesktop/reportd"
#define REPORTD_DBUS_SERVICE_PATH "/org/freedesktop/reportd/Service"
#define REPORTD_DBUS_TASK_BASE_PATH "/org/freedesktop/reportd/Task/"

#endif/*__REPORT_DBUS_CONSTANTS__*/
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service/report-daemon.cpp
25 changes: 25 additions & 0 deletions service/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
bin_PROGRAMS = \
reportd

reportd_SOURCES = \
report-daemon.h \
report-daemon.cpp \
report-task.h \
report-task.cpp \
report-service.h \
report-service.cpp \
$(NULL)

reportd_CXXFLAGS = \
-I$(top_srcdir)/dbus \
$(GLIBMM_CFLAGS) \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
$(NULL)

reportd_LDADD = \
$(top_srcdir)/dbus/libreportd-dbus.a \
$(GLIBMM_LIBS) \
$(GLIB_LIBS) \
$(LIBREPORT_LIBS) \
$(NULL)
Loading

0 comments on commit dc8f7f7

Please sign in to comment.