# # Conditional build: %bcond_with plymouth # plymouth support %bcond_with splashy # splashy support %bcond_with initrd # resume-initrd binary %bcond_without dietlibc # link initrd version with static glibc %bcond_without compress # LZO image compression support %bcond_with encrypt # image encryption support in s2disk # # cannot link splashy with dietlibc %if %{with splashy} %undefine with_dietlibc %endif Summary: Suspend to RAM/Disk/Both Summary(de.UTF-8): Einfrieren in den Systemspeicher Summary(pl.UTF-8): Zamrażanie w RAM/na dysku/jedno i drugie Name: suspend-utils Version: 1.0 Release: 5 License: GPL v2 Group: Applications/System # git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git Source0: http://downloads.sourceforge.net/suspend/%{name}-%{version}.tar.bz2 # Source0-md5: 02f7d4b679bad1bb294a0efe48ce5934 Source1: wlcsv2c.pl Patch0: suspend-sys-file-range-write.patch Patch1: suspend-fadvise.patch Patch2: suspend-diet.patch Patch3: suspend-utils-conf.patch Patch4: suspend-utils-build.patch Patch5: suspend-ignore-acpi-video-flags-not-available.patch Patch6: suspend-plymouth.patch Patch7: s2disk-do-not-fail-without-local-terminals.patch Patch8: s2disk-disable-splash-when-unable-to-switch-vts.patch URL: http://suspend.sourceforge.net/ BuildRequires: autoconf >= 2.59 BuildRequires: automake %if %{with initrd} %{?with_dietlibc:BuildRequires: dietlibc-static} %endif BuildRequires: glibc-static %if %{with encrypt} BuildRequires: libgcrypt-static BuildRequires: libgpg-error-static %endif BuildRequires: libtool %{?with_compress:BuildRequires: lzo-static >= 2.02} %ifarch %{ix86} %{x8664} BuildRequires: libx86-devel %endif BuildRequires: pciutils-devel >= 2.2.4 BuildRequires: perl-Switch BuildRequires: pkgconfig BuildRequires: sed >= 4.0 %{?with_plymouth:BuildRequires: plymouth-static >= 0.8.8-8} %if %{with splashy} BuildRequires: DirectFB-static BuildRequires: freetype-static BuildRequires: libjpeg-static BuildRequires: libpng-static BuildRequires: splashy-static %endif BuildRequires: zlib-devel Requires: uname(release) >= 2.6.17 Provides: suspend = %{version}-%{release} Obsoletes: suspend < 1.0 Conflicts: geninitrd < 8880 ExclusiveArch: %{ix86} %{x8664} ppc ppc64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # libz for gzopen gets discarded if same cache reused (probably ac variables conflict) %undefine configure_cache %description Userland parts needed for suspend-to-disk and suspend-to-RAM on Linux. %description -l de.UTF-8 Elemente der Benutzerumgebung zum einfrieren in den Systemspeicher oder auf die Festplatte. %description -l pl.UTF-8 Elementy przestrzeni użytkownika potrzebne do zamrażania stanu systemu na dysku lub w pamięci RAM pod Linuksem. %package initrd Summary: Suspend to RAM/Disk/Both resume program for initrd Summary(pl.UTF-8): Zamrażanie w RAM/na dysku/jedno i drugie - program resume dla initrd Group: Base Obsoletes: suspend-initrd < 1.0 %description initrd Suspend to RAM/Disk/Both resume program for initrd. %description initrd -l pl.UTF-8 Zamrażanie w RAM/Dysku/Jedno i drugie - program resume dla initrd. %prep %setup -q %patch0 -p1 %patch1 -p2 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 install %{SOURCE1} . cat >syscalltest.c < #include int main() { printf("%d", SYS_reboot); return 0; } EOF %{__cc} syscalltest.c -o syscalltest SYS_REBOOT_NR=`./syscalltest` sed -i -e "s/SYS_REBOOT_NR/$SYS_REBOOT_NR/" swsusp.h # I don't see any issue here (nor libgcc_s.a) %{?with_splashy:sed -i -e 's|AC_CHECK_LIB(\[gcc_s\], \[strlen\])||' configure.ac} %build %{__libtoolize} %{__aclocal} %{__autoheader} %{__autoconf} %{__automake} %if %{with initrd} __cc="%{__cc}" __cc=${__cc#ccache } %configure \ %{?with_dietlibc:CFLAGS="%{rpmcflags} -D_BSD_SOURCE -Os -static"} \ %{?with_dietlibc:CC="diet ${__cc}"} \ %{?with_splashy:--enable-splashy} \ %{__enable_disable encrypt} \ %{?with_compress:--enable-compress} \ --enable-static \ --disable-shared %if %{with dietlibc} %{__make} libsuspend-common.a resume-resume.o diet ${__cc} %{rpmcflags} %{rpmldflags} -D_BSD_SOURCE -Os -static \ -DS2RAM -D_LARGEFILE64_SOURCE -D_GNU_SOURCE \ -o resume resume-resume.o \ libsuspend-common.a %{?with_compress:-llzo2} %{?with_encrypt:-lgcrypt -lgpg-error} -lcompat %else %{__make} resume %endif %{__mv} resume resume-initrd %{__make} clean %endif %configure \ %{?with_splashy:--enable-splashy} \ %{?with_plymouth:--enable-plymouth} \ %{__enable_disable encrypt} \ %{?with_compress:--enable-compress} \ --enable-threads \ %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc %{__make} install \ DESTDIR=$RPM_BUILD_ROOT %if %{with initrd} install -d $RPM_BUILD_ROOT%{_libdir}/initrd install -p resume-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/resume %endif rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} %clean rm -rf $RPM_BUILD_ROOT %if %{without encrypt} %post %banner suspend-utils -e <