Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed Jul 31, 2007
0 parents commit daffabd
Show file tree
Hide file tree
Showing 11 changed files with 772 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .gitignore
@@ -0,0 +1,47 @@
Makefile
Makefile.in
aclocal.m4
config.cache
autom4te.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.scan
compile
depcomp
intl
libtool
ltconfig
ltmain.sh
missing
mkinstalldirs
install-sh
stamp-h
stamp-h1
stamp-h.in
version.h
intl
macros
INSTALL
ChangeLog
ConsoleKit-*.tar.gz
xml-i18n-extract.in
xml-i18n-extract
xml-i18n-merge.in
xml-i18n-merge
xml-i18n-update.in
xml-i18n-update
intltool-extract.in
intltool-extract
intltool-merge.in
intltool-merge
intltool-update.in
intltool-update
xmldocs.make
omf.make
gtk-doc.make
*~
2 changes: 2 additions & 0 deletions AUTHORS
@@ -0,0 +1,2 @@
Richard Hughes <richard@hughsie.com>

340 changes: 340 additions & 0 deletions COPYING

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions HACKING
@@ -0,0 +1,6 @@
Hacking GNOME Power Manager

Coding Style
------------
Please stick to the existing coding style.
Tabs should be set equivalent to 8 spaces.
1 change: 1 addition & 0 deletions MAINTAINERS
@@ -0,0 +1 @@
Richard Hughes <richard@hughsie.com>
12 changes: 12 additions & 0 deletions Makefile.am
@@ -0,0 +1,12 @@
SUBDIRS = src

EXTRA_DIST = \
HACKING \
MAINTAINERS

clean-local :
rm -f *~

DISTCLEANFILES = \
PackageKit-*.tar.gz

1 change: 1 addition & 0 deletions NEWS
@@ -0,0 +1 @@

31 changes: 31 additions & 0 deletions README
@@ -0,0 +1,31 @@
GNOME Power Manager
A Power Manager for GNOME

GNOME Power Manager is a GNOME session daemon that acts as a policy agent on top of
the Project Utopia stack, which includes the kernel, hotplug, udev, and HAL. GNOME
Power Manager listens for HAL events and responds with user-configurable reactions.
Currently it supports UPS's, laptop batteries and AC adapters. Its goal is to be
architecture neutral and free of polling and other hacks.

Most of the code is actually in HAL for abstracting various power aware devices
(UPS's) and frameworks (ACPI, PMU, APM etc.) - so the desktop parts are fairly
lightweight and straightforward to write.

GNOME Power Manager comes in three parts:

- gnome-power-manager: the manager daemon itself
- gnome-power-preferences: the control panel program, for configuration
- gnome-power-statistics: the statistics graphing program

To build, GNOME Power Manager requires

- libgnomeui-2.0
- libglade-2.0
- libhal-0 (from HAL 0.5.7 , 0.5.8 recommended)
- libdbus-1 (from D-BUS 0.70 or later)
- libdbus-glib-1 (from D-BUS 0.70 or later)
- libnotify (from 0.3.0 or later, 0.4.3 recommended)

To work properly, gnome-power-manager requires hald to be running.

For more information, please see http://www.gnome.org/projects/gnome-power-manager/
175 changes: 175 additions & 0 deletions autogen.sh
@@ -0,0 +1,175 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e

PACKAGE=PackageKit

LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
LIBTOOLIZE_FLAGS="--copy --force"
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE_FLAGS="--add-missing --gnu"
AUTOCONF=${AUTOCONF-autoconf}

# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=1.7
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=2.54
libtoolize_min_vers=1.4

# The awk-based string->number conversion we use needs a C locale to work
# as expected. Setting LC_ALL overrides whether the user set LC_ALL,
# LC_NUMERIC, or LANG.
LC_ALL=C

ARGV0=$0

# Allow invocation from a separate build directory; in that case, we change
# to the source directory to run the auto*, then change back before running configure
srcdir=`dirname $ARGV0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`

cd $srcdir

if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then
if ($AUTOCONF --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$AUTOCONF' is too old."
$AUTOCONF --version
echo " (version $autoconf_min_vers or newer is required)"
DIE="yes"
fi
else
echo $AUTOCONF: command not found
echo
echo "$ARGV0: ERROR: You must have \`autoconf' installed to compile $PACKAGE."
echo " (version $autoconf_min_vers or newer is required)"
DIE="yes"
fi

#
# Hunt for an appropriate version of automake and aclocal; we can't
# assume that 'automake' is necessarily the most recent installed version
#
# We check automake first to allow it to be a newer version than we know about.
#
if test x"$AUTOMAKE" = x || test x"$ACLOCAL" = x ; then
am_ver=""
for ver in "" "-1.9" "-1.8" "-1.7" ; do
am="automake$ver"
if ($am --version) < /dev/null > /dev/null 2>&1 ; then
if ($am --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \
exit 1; exit 0; }'); then : ; else
am_ver=$ver
break;
fi
fi
done

AUTOMAKE=${AUTOMAKE-automake$am_ver}
ACLOCAL=${ACLOCAL-aclocal$am_ver}
fi

#
# Now repeat the tests with the copies we decided upon and error out if they
# aren't sufficiently new.
#
if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 ; then
if ($AUTOMAKE --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old."
$AUTOMAKE --version
echo " (version $automake_min_vers or newer is required)"
DIE="yes"
fi
if ($ACLOCAL --version) < /dev/null > /dev/null 2>&1; then
if ($ACLOCAL --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$aclocal_min_vers' ) \
exit 1; exit 0; }' );
then
echo "$ARGV0: ERROR: \`$ACLOCAL' is too old."
$ACLOCAL --version
echo " (version $aclocal_min_vers or newer is required)"
DIE="yes"
fi
else
echo $ACLOCAL: command not found
echo
echo "$ARGV0: ERROR: Missing \`$ACLOCAL'"
echo " The version of $AUTOMAKE installed doesn't appear recent enough."
DIE="yes"
fi
else
echo $AUTOMAKE: command not found
echo
echo "$ARGV0: ERROR: You must have \`automake' installed to compile $PACKAGE."
echo " (version $automake_min_vers or newer is required)"
DIE="yes"
fi

if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 ; then
if ($LIBTOOLIZE --version | awk 'NR==1 { if( $4 >= '$libtoolize_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$LIBTOOLIZE' is too old."
echo " (version $libtoolize_min_vers or newer is required)"
DIE="yes"
fi
else
echo $LIBTOOLIZE: command not found
echo
echo "$ARGV0: ERROR: You must have \`libtoolize' installed to compile $PACKAGE."
echo " (version $libtoolize_min_vers or newer is required)"
DIE="yes"
fi

if test -z "$ACLOCAL_FLAGS"; then
acdir=`$ACLOCAL --print-ac-dir`
if [ ! -f $acdir/pkg.m4 ]; then
echo "$ARGV0: Error: Could not find pkg-config macros."
echo " (Looked in $acdir/pkg.m4)"
echo " If pkg.m4 is available in /another/directory, please set"
echo " ACLOCAL_FLAGS=\"-I /another/directory\""
echo " Otherwise, please install pkg-config."
echo ""
echo "pkg-config is available from:"
echo "http://www.freedesktop.org/software/pkgconfig/"
DIE=yes
fi
fi

if test "X$DIE" != X; then
exit 1
fi


if test -z "$*"; then
echo "$ARGV0: Note: \`./configure' will be run with no arguments."
echo " If you wish to pass any to it, please specify them on the"
echo " \`$0' command line."
echo
fi

do_cmd() {
echo "$ARGV0: running \`$@'"
$@
}

do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS

do_cmd $ACLOCAL $ACLOCAL_FLAGS

do_cmd $AUTOHEADER

do_cmd $AUTOMAKE $AUTOMAKE_FLAGS

do_cmd $AUTOCONF

cd $ORIGDIR || exit 1

rm -f config.cache

do_cmd $srcdir/configure --cache-file=config.cache --disable-static --enable-maintainer-mode --enable-gtk-doc ${1+"$@"} && echo "Now type \`make' to compile" || exit 1
103 changes: 103 additions & 0 deletions configure.ac
@@ -0,0 +1,103 @@
AC_PREREQ(2.52)

AC_INIT(PackageKit, 0.0.1)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL

GNOME_COMPILE_WARNINGS
GNOME_DOC_INIT

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
CPPFLAGS="$CPPFLAGS -Wall"
fi

dnl ---------------------------------------------------------------------------
dnl - Library dependencies
dnl ---------------------------------------------------------------------------
GLIB_REQUIRED=2.6.0
DBUS_REQUIRED=0.70

dnl ---------------------------------------------------------------------------
dnl - Make above strings available for packaging files (e.g. rpm spec files)
dnl ---------------------------------------------------------------------------
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(DBUS_REQUIRED)

dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

PKG_CHECK_MODULES(DBUS, \
dbus-glib-1 >= $DBUS_REQUIRED \
dbus-1 >= $DBUS_REQUIRED \
gthread-2.0)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)

dnl ---------------------------------------------------------------------------
dnl - Make paths available for source files
dnl ---------------------------------------------------------------------------
AC_SUBST(SYSCONFDIR, $sysconfdir)
AC_SUBST(DATADIR, $datadir)
AC_SUBST(BINDIR, $bindir)
AC_SUBST(SBINDIR, $sbindir)

dnl ---------------------------------------------------------------------------
dnl - PolicyKit support?
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(policykit, [ --enable-policykit support PolicyKit permissions daemon (requires polkitd)],enable_polkit=$enableval,enable_polkit=no)
AC_MSG_CHECKING([whether to support PolicyKit])
have_polkit=no
if test x$enable_polkit = xyes ; then
have_polkit=yes
AC_DEFINE(HAVE_POLKIT, 1, [Define if we use PolicyKit])
fi
#AC_MSG_RESULT(yes)

dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests, [ --enable-tests Build self tests],enable_tests=$enableval,enable_tests=no)
AC_MSG_CHECKING([whether to support tests])
have_tests=no
if test x$enable_tests = xyes ; then
have_tests=yes
AC_DEFINE(HAVE_TESTS, 1, [Define if we want to use the self tests])
fi
AM_CONDITIONAL([HAVE_TESTS], [test $have_tests = yes])

dnl ---------------------------------------------------------------------------
dnl - Makefiles, etc.
dnl ---------------------------------------------------------------------------
AC_OUTPUT([
Makefile
src/Makefile
])

dnl ==========================================================================
echo "
PackageKit $VERSION
====================

prefix: ${prefix}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
PolicyKit support: ${have_polkit}
Self test support: ${have_tests}
"

0 comments on commit daffabd

Please sign in to comment.