Summary:	A Power Manager for MATE
Name:		mate-power-manager
Version:	1.14.0
Release:	1%{?_dist_release}
License:	GPLv2
Group:		Applications/System
URL:		http://mate-desktop.org/

Source0:	http://pub.mate-desktop.org/releases/1.14/%{name}-%{version}.tar.xz

# patch for Vine
Patch1001:	mate-power-manager-1.12.0-use-vine-sleep-helper.patch
Patch1002:	mate-power-manager-1.12.0-vine-settings.patch

BuildRequires:	mate-common
BuildRequires:	mate-doc-utils
BuildRequires:	libnotify-devel
BuildRequires:	mate-desktop-devel
BuildRequires:	mate-panel-devel
BuildRequires:	gtk2-devel
BuildRequires:	dbus-glib-devel
BuildRequires:	libcanberra-devel
BuildRequires:	libwnck-devel
BuildRequires:	unique-devel
BuildRequires:	upower-devel
BuildRequires:	popt-devel
BuildRequires:	libgnome-keyring-devel
BuildRequires:	yelp-tools
BuildRequires:	gtk-doc
BuildRequires:	autoconf
BuildRequires:	automake

Requires:	vine-sleep-helper
Requires(posttrans,postun):	glib2
Requires(post,postun):	desktop-file-utils

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	Takemikaduchi


%description
MATE Power Manager is a MATE session daemon that acts as a policy agent on top of
UPower, which requires fairly new versions of the kernel and udev.
MATE Power Manager listens for system events and responds with user-configurable actions.

MATE Power Manager comes in three main parts:

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


%prep
%setup -q
%patch1001 -p1 -b .vine
%patch1002 -p1 -b .vine

%build
NOCONFIGURE=1 ./autogen.sh
%configure \
	--libexecdir=%{_libexecdir}/mate \
	--disable-static

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}

%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} \;
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

%find_lang %{name}


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post
/sbin/ldconfig
update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:

%postun
/sbin/ldconfig
if [ $1 -eq 0 ]; then
  update-desktop-database %{_datadir}/applications >& /dev/null ||:
  touch --no-create %{_datadir}/icons/hicolor
  gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
  glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:
fi

%posttrans
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING ChangeLog NEWS README
%{_sysconfdir}/xdg/autostart/mate-power-manager.desktop
%{_bindir}/mate-power-manager
%{_bindir}/mate-power-preferences
%{_bindir}/mate-power-statistics
%{_libexecdir}/mate/mate-brightness-applet
%{_libexecdir}/mate/mate-inhibit-applet
%{_sbindir}/mate-power-backlight-helper
%{_datadir}/applications/mate-power-preferences.desktop
%{_datadir}/applications/mate-power-statistics.desktop
%{_datadir}/dbus-1/services/org.mate.panel.applet.BrightnessAppletFactory.service
%{_datadir}/dbus-1/services/org.mate.panel.applet.InhibitAppletFactory.service
%{_datadir}/dbus-1/services/org.mate.PowerManager.service
%{_datadir}/glib-2.0/schemas/org.mate.power-manager.gschema.xml
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/help/*
%{_datadir}/mate-panel/applets/org.mate.BrightnessApplet.mate-panel-applet
%{_datadir}/mate-panel/applets/org.mate.InhibitApplet.mate-panel-applet
%{_datadir}/%{name}
%{_datadir}/polkit-1/actions/org.mate.power.policy
%{_mandir}/man1/*.1.gz


%changelog
* Sun May 08 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.14.0-1
- new upstream release

* Tue Dec 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.1-1
- new upstream release

* Sat Nov 07 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.0-1
- new upstream release
- update Patch1001 (mate-power-manager-1.12.0-use-vine-sleep-helper.patch)
- update Patch1002 (mate-power-manager-1.12.0-vine-settings.patch)

* Wed Sep 02 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.2-1
- new upstream release

* Sun Aug 30 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.1-3
- add Patch1001 (mate-power-manager-1.10.1-use-vine-sleep-helper.patch)
- add Patch1002 (mate-power-manager-1.10.1-vine-settings.patch)
- add Requires: vine-sleep-helper

* Sun Aug 16 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.1-2
- remove BuildRequires: libmatekeyring-devel

* Sun Jul 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.1-1
- new upstream release

* Sat May 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.0-1
- new upstream release
- remove Patch0 (mate-power-manager_dbus_interface_keyboard_backlight_controls.patch)
- add BuildRequires: mate-desktop-devel

* Wed Nov 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.1-1
- new upstream release
- remove Patch1-5

* Sun Sep 21 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.0-2
- change BuildRequires: upower-devel instead of libupower09-devel
- add BuildRequires: yelp-tools
- add Patch0-5 from fedora

* Wed Apr 16 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.0-1
- new upstream release
- add BuildRequires: libgnome-keyring-devel, libupower09-devel, itstool
- remove BuildRequires: upower-devel

* Sun Dec 29 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.3-1
- new upstream release

* Sun Sep 22 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.2-1
- new upstream release

* Sun May 19 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.1-1
- new upstream release
- remove BuildRequires: mate-conf-devel, libmatenotify-devel
- add BuildRequires: libnotify-devel

* Thu Aug 02 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.0-1
- new upstream release

* Sat May 12 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.1-1
- new upstream release

* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-2
- change category

* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-1
- initial build for Vine Linux

