2 %bcond_without plymouth
4 %bcond_with initrd # don't build resume-initrd
5 %bcond_without dietlibc # link initrd version with static glibc
6 %bcond_with encrypt # build s2disk with image encryption support
9 # no-can-link splashy with dietlibc
11 %undefine with_dietlibc
14 Summary: Suspend to RAM/Disk/Both
15 Summary(de.UTF-8): Einfrieren in den Systemspeicher
16 Summary(pl.UTF-8): Zamrażanie w RAM/na dysku/jedno i drugie
21 Group: Applications/System
22 # git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git
23 # Source0: %{name}-%{snap}.tar.bz2
24 Source0: http://dl.sourceforge.net/project/suspend/suspend/suspend-1.0/suspend-utils-1.0.tar.bz2
25 # Source0-md5: 02f7d4b679bad1bb294a0efe48ce5934
27 Patch0: suspend-sys-file-range-write.patch
28 Patch1: suspend-fadvise.patch
29 Patch2: suspend-diet.patch
30 Patch3: suspend-utils-conf.patch
31 Patch4: suspend-utils-build.patch
32 Patch5: suspend-ignore-acpi-video-flags-not-available.patch
33 Patch6: suspend-plymouth.patch
34 Patch7: s2disk-do-not-fail-without-local-terminals.patch
35 Patch8: s2disk-disable-splash-when-unable-to-switch-vts.patch
36 URL: http://sourceforge.net/projects/suspend
37 BuildRequires: autoconf
38 BuildRequires: automake
40 %{?with_dietlibc:BuildRequires: dietlibc-static}
42 BuildRequires: glibc-static
44 BuildRequires: libgcrypt-static
45 BuildRequires: libgpg-error-static
47 BuildRequires: libtool
48 BuildRequires: lzo-static >= 2.02
49 %ifarch %{ix86} %{x8664}
50 BuildRequires: libx86-static
52 BuildRequires: pciutils-devel
53 BuildRequires: perl-Switch
54 BuildRequires: pkgconfig
55 BuildRequires: sed >= 4.0
56 %{?with_plymouth:BuildRequires: plymouth-static >= 0.8.8-8}
58 BuildRequires: DirectFB-static
59 BuildRequires: freetype-static
60 BuildRequires: libjpeg-static
61 BuildRequires: libpng-static
62 BuildRequires: splashy-static
64 BuildRequires: zlib-devel
65 Requires: uname(release) >= 2.6.17
66 Provides: suspend = %{version}-%{release}
67 Obsoletes: suspend < 1.0
68 Conflicts: geninitrd < 8880
69 ExclusiveArch: %{ix86} %{x8664} ppc ppc64
70 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 # libz for gzopen gets discarded if same cache reused (probably ac variables conflict)
73 %undefine configure_cache
76 Userland parts needed for suspend-to-disk and suspend-to-RAM on Linux.
78 %description -l de.UTF-8
79 Elemente der Benutzerumgebung zum einfrieren in den Systemspeicher
80 oder auf die Festplatte.
82 %description -l pl.UTF-8
83 Elementy przestrzeni użytkownika potrzebne do zamrażania stanu systemu
84 na dysku lub w pamięci RAM pod Linuksem.
87 Summary: Suspend to RAM/Disk/Both resume program for initrd
88 Summary(pl.UTF-8): Zamrażanie w RAM/na dysku/jedno i drugie - program resume dla initrd
90 Obsoletes: suspend-initrd < 1.0
93 Suspend to RAM/Disk/Both resume program for initrd.
95 %description initrd -l pl.UTF-8
96 Zamrażanie w RAM/Dysku/Jedno i drugie - program resume dla initrd.
112 cat >syscalltest.c <<EOF
114 #include <sys/syscall.h>
115 int main() { printf("%d", SYS_reboot); return 0; }
117 %{__cc} syscalltest.c -o syscalltest
118 SYS_REBOOT_NR=`./syscalltest`
120 sed -i -e "s/SYS_REBOOT_NR/$SYS_REBOOT_NR/" swsusp.h
122 # I don't see any issue here (nor libgcc_s.a)
123 %{?with_splashy:sed -i -e 's|AC_CHECK_LIB(\[gcc_s\], \[strlen\])||' configure.ac}
136 %{?with_dietlibc:CFLAGS="%{rpmcflags} -D_BSD_SOURCE -Os -static"} \
137 %{?with_dietlibc:CC="diet ${__cc}"} \
138 %{?with_splashy:--enable-splashy} \
139 %{__enable_disable encrypt} \
145 %{__make} libsuspend-common.a resume-resume.o
146 diet ${__cc} %{rpmcflags} %{rpmldflags} -D_BSD_SOURCE -Os -static \
147 -DS2RAM -D_LARGEFILE64_SOURCE -D_GNU_SOURCE \
148 -o resume resume-resume.o \
149 libsuspend-common.a -llzo2 %{?with_encrypt:-lgcrypt -lgpg-error} -lcompat
153 mv resume resume-initrd
158 %{?with_splashy:--enable-splashy} \
159 %{?with_plymouth:--enable-plymouth} \
160 %{__enable_disable encrypt} \
167 rm -rf $RPM_BUILD_ROOT
169 install -d $RPM_BUILD_ROOT/etc
172 DESTDIR=$RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
176 install -p resume-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/resume
179 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
182 rm -rf $RPM_BUILD_ROOT
184 %if %{without encrypt}
186 %banner suspend-utils -e <<EOF
188 This version of suspend-utils is built without support
189 for encrypted s2disk images.
194 %defattr(644,root,root,755)
195 %doc HOWTO README* AUTHORS ReleaseNotes
196 %attr(755,root,root) %{_sbindir}/*
197 %dir %{_libdir}/suspend
198 %attr(755,root,root) %{_libdir}/suspend/resume
199 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/suspend.conf
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_libdir}/initrd/resume