]> git.pld-linux.org Git - packages/suspend-utils.git/blob - suspend-utils.spec
239d1d5e67c00ce9d62c46fbf161264df96b54fa
[packages/suspend-utils.git] / suspend-utils.spec
1 #
2 %bcond_without  plymouth
3 %bcond_with     splashy
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
7 #
8
9 # no-can-link splashy with dietlibc
10 %if %{with splashy}
11 %undefine with_dietlibc
12 %endif
13
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
17 Name:           suspend-utils
18 Version:        1.0
19 Release:        3
20 License:        GPL v2
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
26 Source1:        wlcsv2c.pl
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
39 %if %{with initrd}
40 %{?with_dietlibc:BuildRequires: dietlibc-static}
41 %endif
42 BuildRequires:  glibc-static
43 %if %{with encrypt}
44 BuildRequires:  libgcrypt-static
45 BuildRequires:  libgpg-error-static
46 %endif
47 BuildRequires:  libtool
48 BuildRequires:  lzo-static >= 2.02
49 %ifarch %{ix86} %{x8664}
50 BuildRequires:  libx86-static
51 %endif
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}
57 %if %{with splashy}
58 BuildRequires:  DirectFB-static
59 BuildRequires:  freetype-static
60 BuildRequires:  libjpeg-static
61 BuildRequires:  libpng-static
62 BuildRequires:  splashy-static
63 %endif
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)
71
72 # libz for gzopen gets discarded if same cache reused (probably ac variables conflict)
73 %undefine       configure_cache
74
75 %description
76 Userland parts needed for suspend-to-disk and suspend-to-RAM on Linux.
77
78 %description -l de.UTF-8
79 Elemente der Benutzerumgebung zum einfrieren in den Systemspeicher
80 oder auf die Festplatte.
81
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.
85
86 %package initrd
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
89 Group:          Base
90 Obsoletes:      suspend-initrd < 1.0
91
92 %description initrd
93 Suspend to RAM/Disk/Both resume program for initrd.
94
95 %description initrd -l pl.UTF-8
96 Zamrażanie w RAM/Dysku/Jedno i drugie - program resume dla initrd.
97
98 %prep
99 %setup -q
100 %patch0 -p1
101 %patch1 -p2
102 %patch2 -p1
103 %patch3 -p1
104 %patch4 -p1
105 %patch5 -p1
106 %patch6 -p1
107 %patch7 -p1
108 %patch8 -p1
109
110 install %{SOURCE1} .
111
112 cat >syscalltest.c <<EOF
113 #include <stdio.h>
114 #include <sys/syscall.h>
115 int main() { printf("%d", SYS_reboot); return 0; }
116 EOF
117 %{__cc} syscalltest.c -o syscalltest
118 SYS_REBOOT_NR=`./syscalltest`
119
120 sed -i -e "s/SYS_REBOOT_NR/$SYS_REBOOT_NR/" swsusp.h
121
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}
124
125 %build
126 %{__libtoolize}
127 %{__aclocal}
128 %{__autoheader}
129 %{__autoconf}
130 %{__automake}
131
132 %if %{with initrd}
133 __cc="%{__cc}"
134 __cc=${__cc#ccache }
135 %configure \
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} \
140         --enable-compress \
141         --enable-static \
142         --disable-shared
143
144 %if %{with dietlibc}
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
150 %else
151 %{__make} resume
152 %endif
153 mv resume resume-initrd
154 %{__make} clean
155 %endif
156
157 %configure \
158         %{?with_splashy:--enable-splashy} \
159         %{?with_plymouth:--enable-plymouth} \
160         %{__enable_disable encrypt} \
161         --enable-compress \
162         --enable-threads \
163
164 %{__make}
165
166 %install
167 rm -rf $RPM_BUILD_ROOT
168
169 install -d $RPM_BUILD_ROOT/etc
170
171 %{__make} install \
172         DESTDIR=$RPM_BUILD_ROOT
173
174 %if %{with initrd}
175 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
176 install -p resume-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/resume
177 %endif
178
179 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %if %{without encrypt}
185 %post
186 %banner suspend-utils -e <<EOF
187 Warning!
188 This version of suspend-utils is built without support
189 for encrypted s2disk images.
190 EOF
191 %endif
192
193 %files
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
200
201 %if %{with initrd}
202 %files initrd
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_libdir}/initrd/resume
205 %endif
This page took 0.277633 seconds and 2 git commands to generate.