summaryrefslogtreecommitdiff
path: root/powersave.spec
blob: 3ec58d71c6f3051b351ea1f438362f5596b401e5 (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
157
158
159
160
161
162
163
164
165
166
Summary:	Powermanagment deamon
Summary(pl):	Demon zarządzania energią
Name:		powersave
Version:	0.11.5
Release:	0.1
Epoch:		0
License:	GPL
Group:		Daemons
Source0:	http://forgeftp.novell.com//powersave/powersave/0.11.5-unstable/%{name}-%{version}.tar.bz2
# Source0-md5:	8aaf60a5de75f995bce9eb928cf67fc2
Source1:	%{name}.init
Source2:	%{name}.sysconfig
Source3:	%{name}.logrotate
URL:		http://forge.novell.com/modules/xfmod/project/?powersave
BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	sysfsutils-devel >= 1.3.0-3
BuildRequires:	cpufrequtils-devel >= 0.4
BuildRequires:	dbus-glib-devel >= 0.30
BuildRequires:	dbus-qt-devel >= 0.30
BuildRequires:	hal-devel >= 0.5.0
BuildRequires:	libtool
BuildRequires:	pkgconfig
BuildRequires:	rpmbuild(macros) >= 1.228
Requires(post,preun):	/sbin/chkconfig
Requires:	%{name}-libs = %{version}-%{release}
Requires:	acpid
Requires:	hal >= 0.5.0
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
The powersave package provides global power management tasks.
It supports battery monitoring, userspace workarounds for proper
suspend/standby functionality and more.

%description -l pl
Paczka powersave świadczy globalne usługi zarządzania energią.
Wspiera monitorowanie stanu baterii, prowizorycznie rozwiązuje
problemy usypiania/wstrzymywania w przestrzeni użytkownika
i inne.

%package libs
Summary:	Powersave libraries
Summary(pl):	Biblioteki powersave
Group:		Libraries

%description libs
Powersave libraries.

%description libs -l pl
Biblioteki powersave.

%package devel
Summary:	Header files for powersave library
Summary(pl):	Pliki nagłówkowe biblioteki powersave
Group:		Development/Libraries
Requires:	%{name}-libs = %{version}-%{release}
Requires:	cpufrequtils-devel >= 0.4
Requires:	dbus-devel >= 0.30
Requires:	hal-devel >= 0.5.0
Requires:	sysfsutils-devel >= 1.3.0-3

%description devel
This is the package containing header files for powersave
libraries.

%description devel -l pl
Paczka ta zawiera pliki nagłówkowe dla bibliotek powersave.

%package static
Summary:	Static powersave libraries
Summary(pl):	Biblioteki statyczne powersave
Group:		Development/Libraries
Requires:	%{name}-devel = %{version}-%{release}

%description static
Static powersave library.

%description static -l pl
Statyczne biblioteki powersave.

%prep
%setup -q
# translations disabled (terrible mess)
sed -i -e 's|translations||' Makefile.am

%build
%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
	--with-gnome-bindir=%{_prefix} \
	--with-kde-bindir=%{_prefix}
%{__make}

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
	$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/powersave
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/powersaved
install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/powersave

rm -rf $RPM_BUILD_ROOT/etc/init.d

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add %{name}
%service %{name} restart

%preun
if [ "$1" = "0" ]; then
	%service -q %{name} stop
	/sbin/chkconfig --del %{name}
fi

%post	libs -p /sbin/ldconfig
%postun	libs -p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc README docs/README.*

%dir %{_sysconfdir}/powersave
%{_sysconfdir}/powersave/*
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/powersaved
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dbus-1/system.d/powersave.conf

%dir %{_sysconfdir}/acpi/events.ignore
%{_sysconfdir}/acpi/events.ignore/events.ignore

%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/powersave
%attr(754,root,root) /etc/rc.d/init.d/powersave

%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/powersaved
%dir %{_libdir}/powersave
%dir %{_libdir}/powersave/scripts
%attr(755,root,root) %{_libdir}/powersave/do_*
%attr(755,root,root) %{_libdir}/powersave/scripts/*
%attr(755,root,root) %{_libdir}/powersave/setDefaultTrippoints.sh
%attr(755,root,root) %{_libdir}/powersave/wttyhx

%{_mandir}/man8/powersave*.8*

%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/*.so.*.*.*

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/*.so
%{_libdir}/*.la
%{_includedir}/*.h

%files static
%defattr(644,root,root,755)
%{_libdir}/*.a