summaryrefslogtreecommitdiff
path: root/distro/fedora/mate-power-manager.spec
blob: 0eb118a3e29523aafdd6c28020f0d9b8e8e67f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Summary: MATE power management service
Name: mate-power-manager
Version: 2.32.0
Release: 1%{?dist}
License: GPLv2+ and GFDL
Group: Applications/System
Source: http://matsusoft.com.ar/uploads/gnu-linux/mate/mate-power-manager.tar.gz

URL: http://projects.gnome.org/gnome-power-manager/

BuildRequires: mate-panel
BuildRequires: scrollkeeper
BuildRequires: mate-doc-utils
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: libtool
BuildRequires: cairo-devel
BuildRequires: libcanberra-devel
BuildRequires: libnotify-devel >= 0.5.0
BuildRequires: upower-devel >= 0.9.0
BuildRequires: intltool
BuildRequires: unique-devel >= 1.0.0
BuildRequires: glib2-devel >= 2.25.9
BuildRequires: GConf2-devel >= 2.31.1
BuildRequires: gtk2-devel >= 2.16.0
BuildRequires: dbus-glib-devel
BuildRequires: libwnck-devel
BuildRequires: control-center-devel >= 2.31.4
Requires: mate-icon-theme
Requires: libcanberra
Requires: dbus-x11
Requires: upower >= 0.9.0
Requires(post): scrollkeeper
Requires(postun): scrollkeeper
Provides: gnome-power-manager = %{version}
Provides: gnome-power-manager = %{version}
Conflicts: gnome-power-manager >= 3.0
# obsolete sub-package
Obsoletes: gnome-power-manager-extra <= 2.30.1
Provides: gnome-power-manager-extra

Patch0: dont-eat-the-logs.patch
Patch1: gpm-manager.patch
BuildRequires: autoconf automake libtool

%description
MATE Power Manager uses the information and facilities provided by UPower
displaying icons and handling user callbacks in an interactive MATE session.

%prep
%setup -q
%patch0 -p1 -b .logs
%patch1 -p1 -b .gpm

autoreconf -i -f

%build
%configure --disable-scrollkeeper \
	--disable-schemas-install \
	--disable-applets
make AM_LDFLAGS="-Wl,-O1,--as-needed"

# strip unneeded translations from .mo files
# ideally intltool (ha!) would do that for us
# http://bugzilla.gnome.org/show_bug.cgi?id=474987
cd po
grep -v ".*[.]desktop[.]in[.]in$\|.*[.]server[.]in[.]in$" POTFILES.in > POTFILES.keep
mv POTFILES.keep POTFILES.in
intltool-update --pot
for p in *.po; do
  msgmerge $p %{name}.pot > $p.out
  msgfmt -o `basename $p .po`.gmo $p.out
done

%install
make install DESTDIR=$RPM_BUILD_ROOT

desktop-file-install --vendor mate --delete-original                   \
  --dir $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart                     \
  $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/mate-power-manager.desktop

# save space by linking identical images in translated docs
helpdir=$RPM_BUILD_ROOT%{_datadir}/mate/help/%{name}
for f in $helpdir/C/figures/*.png; do
  b="$(basename $f)"
  for d in $helpdir/*; do
    if [ -d "$d" -a "$d" != "$helpdir/C" ]; then
      g="$d/figures/$b"
      if [ -f "$g" ]; then
        if cmp -s $f $g; then
          rm "$g"; ln -s "../../C/figures/$b" "$g"
        fi
      fi
    fi
  done
done

%find_lang %{name} --with-gnome

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
        %{_sysconfdir}/gconf/schemas/mate-power-manager.schemas >/dev/null || :
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
    gtk-update-icon-cache -q %{_datadir}/icons/hicolor &> /dev/null || :
fi
update-desktop-database %{_datadir}/applications &> /dev/null || :

%pre
if [ "$1" -gt 1 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/mate-power-manager.schemas &> /dev/null || :
fi

%preun
if [ "$1" -eq 0 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/mate-power-manager.schemas &> /dev/null || :
fi

%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
    gtk-update-icon-cache -q %{_datadir}/icons/hicolor &> /dev/null || :
fi
update-desktop-database %{_datadir}/applications &> /dev/null || :

%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS COPYING README
%{_bindir}/*
%{_datadir}/applications/*.desktop
%{_datadir}/dbus-1/services/mate-power-manager.service
%{_datadir}/mate-power-manager/*.ui
%{_datadir}/mate-power-manager/icons/hicolor/*/*/*.*
%{_datadir}/icons/hicolor/*/apps/mate-brightness-applet.*
%{_datadir}/icons/hicolor/*/apps/mate-inhibit-applet.*
%{_datadir}/icons/hicolor/*/apps/mate-power-manager.*
%{_datadir}/icons/hicolor/*/apps/mate-power-statistics.*
%{_datadir}/omf/mate-power-manager
%{_datadir}/polkit-1/actions/org.mate.power.policy
%dir %{_datadir}/mate-power-manager
#%{_datadir}/mate-2.0/ui/*.xml
#%{_libdir}/bonobo/servers/*.server
#%{_libexecdir}/*
%config(noreplace) %{_sysconfdir}/gconf/schemas/*.schemas
%{_mandir}/man1/*.1.gz
%{_sbindir}/*
%{_sysconfdir}/xdg/autostart/*.desktop

%changelog
* Tue Jun 28 2011 Juan Rodriguez <nushio@fedoraproject.org> 2.32.0-1
- Initial release of Mate-Power-Manager