Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add BME backend
  • Loading branch information
filippz committed Jan 9, 2015
1 parent a915f23 commit b644f8f
Show file tree
Hide file tree
Showing 10 changed files with 1,462 additions and 2 deletions.
95 changes: 95 additions & 0 deletions rpm/upower-bme.spec
@@ -0,0 +1,95 @@
Name: upower-bme

# >> macros
# << macros

Summary: Power Management Service - BME backend
Version: 0.9.21
Release: 1
Group: System/Libraries
License: GPLv2+
URL: http://upower.freedesktop.org/
Source0: %{name}-%{version}.tar.xz
Requires: polkit >= 0.92
Requires: udev
Requires: bme
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(gudev-1.0) >= 147
BuildRequires: pkgconfig(libusb-1.0) >= 1.0.0
BuildRequires: pkgconfig(dbus-1) >= 1.0
BuildRequires: pkgconfig(dbus-glib-1) >= 0.76
BuildRequires: pkgconfig(glib-2.0) >= 2.21.5
BuildRequires: pkgconfig(gio-2.0) >= 2.16.1
BuildRequires: pkgconfig(polkit-gobject-1) >= 0.97
BuildRequires: pkgconfig(udev) >= 187
BuildRequires: libtool
BuildRequires: intltool
BuildRequires: gettext
BuildRequires: systemd-devel
Provides: upower

# We want pm-utils to be removed from the images, this ensure
# that the old version gets away as it is no longer needed for
# upower after update to 0.9.20
Obsoletes: pm-utils <= 1.4.1

%description
UPower (formerly DeviceKit-power) provides a daemon, API and command
line tools for managing power devices attached to the system.


%package devel
Summary: Headers and libraries for UPower
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Headers and libraries for UPower.


%prep
%setup -q -n %{name}-%{version}/upower

%build
export PKG_CONFIG=pkg-config
./autogen.sh
%configure --disable-static \
--enable-man-pages=no \
--enable-history=no \
--with-backend=bme

make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install

%find_lang upower

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f upower.lang
%defattr(-,root,root,-)
%doc NEWS COPYING AUTHORS HACKING README
%{_libdir}/libupower-glib.so.*
%config %{_sysconfdir}/dbus-1/system.d/*.conf
%dir %{_localstatedir}/lib/upower
%dir %{_sysconfdir}/UPower
%config %{_sysconfdir}/UPower/UPower.conf
%{_bindir}/upower
%{_libexecdir}/upowerd
/lib/systemd/system-sleep/notify-upower.sh
%{_unitdir}/upower.service
%{_datadir}/polkit-1/actions/*.policy
%{_datadir}/dbus-1/system-services/*.service

%files devel
%defattr(-,root,root,-)
%{_datadir}/dbus-1/interfaces/*.xml
%{_libdir}/libupower-glib.so
%{_libdir}/pkgconfig/*.pc
%dir %{_includedir}/libupower-glib
%{_includedir}/libupower-glib/*.h
1 change: 1 addition & 0 deletions rpm/upower.spec
Expand Up @@ -26,6 +26,7 @@ BuildRequires: libtool
BuildRequires: intltool
BuildRequires: gettext
BuildRequires: systemd-devel
Conflicts: upower-bme

# We want pm-utils to be removed from the images, this ensure
# that the old version gets away as it is no longer needed for
Expand Down
4 changes: 3 additions & 1 deletion upower/configure.ac
Expand Up @@ -188,7 +188,7 @@ dnl - Compile time default choice of backend
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([backend],
AS_HELP_STRING([--with-backend=<option>],
[Default backend to use linux, freebsd, openbsd, dummy (dummy)]))
[Default backend to use linux, freebsd, openbsd, dummy (dummy), bme]))
# default to a sane option
AC_CANONICAL_HOST
if test x$with_backend = x; then
Expand Down Expand Up @@ -222,6 +222,7 @@ AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$with_backend = xdummy])
AM_CONDITIONAL(BACKEND_TYPE_LINUX, [test x$with_backend = xlinux])
AM_CONDITIONAL(BACKEND_TYPE_FREEBSD, [test x$with_backend = xfreebsd])
AM_CONDITIONAL(BACKEND_TYPE_OPENBSD, [test x$with_backend = xopenbsd])
AM_CONDITIONAL(BACKEND_TYPE_BME, [test x$with_backend = xbme])

dnl ---------------------------------------------------------------------------
dnl - Build self tests
Expand Down Expand Up @@ -253,6 +254,7 @@ src/dummy/Makefile
src/freebsd/Makefile
src/openbsd/Makefile
src/linux/Makefile
src/bme/Makefile
tools/Makefile
doc/Makefile
doc/version.xml
Expand Down
17 changes: 16 additions & 1 deletion upower/src/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in

SUBDIRS = dummy freebsd linux openbsd
SUBDIRS = dummy freebsd linux openbsd bme

AM_CPPFLAGS = \
$(PIE_CFLAGS) \
Expand Down Expand Up @@ -142,6 +142,21 @@ endif

endif

if BACKEND_TYPE_BME
upowerd_LDADD += \
bme/libupshared.la

upowerd_LDFLAGS = \
$(PIE_LDFLAGS) \
$(RELRO_LDFLAGS)

if HAVE_SYSTEMDUTILDIR
systemsleepdir = $(systemdutildir)/system-sleep
systemsleep_SCRIPTS = notify-upower.sh
endif

endif

upowerd_CFLAGS = \
$(WARNINGFLAGS_C) \
$(NULL)
Expand Down
28 changes: 28 additions & 0 deletions upower/src/bme/Makefile.am
@@ -0,0 +1,28 @@
## Process this file with automake to produce Makefile.in

AM_CPPFLAGS = \
-I$(top_builddir)/src -I$(top_srcdir)/src \
-DUP_COMPILATION \
-DG_LOG_DOMAIN=\"UPower-BME\" \
-I$(top_srcdir)/libupower-glib \
$(DBUS_GLIB_CFLAGS) \
$(POLKIT_CFLAGS) \
$(GLIB_CFLAGS)

if BACKEND_TYPE_BME
noinst_LTLIBRARIES = libupshared.la
endif

libupshared_la_SOURCES = \
up-backend.c \
up-native.c \
bmeipc.c \
$(BUILT_SOURCES)

libupshared_la_CFLAGS = \
$(WARNINGFLAGS_C)

clean-local :
rm -f *~

-include $(top_srcdir)/git.mk

0 comments on commit b644f8f

Please sign in to comment.