]> git.pld-linux.org Git - packages/suspend-utils.git/blob - suspend-utils.spec
- release 3 (by relup.sh)
[packages/suspend-utils.git] / suspend-utils.spec
1 #
2 %bcond_with     splashy
3 %bcond_without  initrd          # don't build resume-initrd
4 %bcond_without  dietlibc        # link initrd version with static glibc
5 #
6
7 # no-can-link splashy with dietlibc
8 %if %{with splashy}
9 %undefine with_dietlibc
10 %endif
11
12 Summary:        Suspend to RAM/Disk/Both
13 Summary(de.UTF-8):      Einfrieren in den Systemspeicher
14 Summary(pl.UTF-8):      Zamrażanie w RAM/na dysku/jedno i drugie
15 Name:           suspend-utils
16 Version:        1.0
17 Release:        3
18 License:        GPL v2
19 Group:          Applications/System
20 # git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git
21 # Source0:      %{name}-%{snap}.tar.bz2
22 Source0:        http://dl.sourceforge.net/project/suspend/suspend/suspend-1.0/suspend-utils-1.0.tar.bz2
23 # Source0-md5:  02f7d4b679bad1bb294a0efe48ce5934
24 Source1:        wlcsv2c.pl
25 Patch0:         suspend-sys-file-range-write.patch
26 Patch1:         suspend-fadvise.patch
27 Patch2:         suspend-diet.patch
28 Patch3:         suspend-utils-conf.patch
29 Patch4:         suspend-utils-build.patch
30 URL:            http://sourceforge.net/projects/suspend
31 BuildRequires:  autoconf
32 BuildRequires:  automake
33 %if %{with initrd}
34 %{?with_dietlibc:BuildRequires: dietlibc-static}
35 %endif
36 BuildRequires:  glibc-static
37 BuildRequires:  libgcrypt-static
38 BuildRequires:  libgpg-error-static
39 BuildRequires:  libtool
40 BuildRequires:  lzo-static >= 2.02
41 %ifarch %{ix86} %{x8664}
42 BuildRequires:  libx86-static
43 %endif
44 BuildRequires:  pciutils-devel
45 BuildRequires:  perl-Switch
46 BuildRequires:  pkgconfig
47 BuildRequires:  sed >= 4.0
48 %if %{with splashy}
49 BuildRequires:  DirectFB-static
50 BuildRequires:  freetype-static
51 BuildRequires:  libjpeg-static
52 BuildRequires:  libpng-static
53 BuildRequires:  splashy-static
54 %endif
55 BuildRequires:  zlib-devel
56 Requires:       uname(release) >= 2.6.17
57 Provides:       suspend = %{version}-%{release}
58 Obsoletes:      suspend < 1.0
59 Conflicts:      geninitrd < 8880
60 ExclusiveArch:  %{ix86} %{x8664} ppc ppc64
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 # libz for gzopen gets discarded if same cache reused (probably ac variables conflict)
64 %undefine       configure_cache
65
66 %description
67 Userland parts needed for suspend-to-disk and suspend-to-RAM on Linux.
68
69 %description -l de.UTF-8
70 Elemente der Benutzerumgebung zum einfrieren in den Systemspeicher
71 oder auf die Festplatte.
72
73 %description -l pl.UTF-8
74 Elementy przestrzeni użytkownika potrzebne do zamrażania stanu systemu
75 na dysku lub w pamięci RAM pod Linuksem.
76
77 %package initrd
78 Summary:        Suspend to RAM/Disk/Both resume program for initrd
79 Summary(pl.UTF-8):      Zamrażanie w RAM/na dysku/jedno i drugie - program resume dla initrd
80 Group:          Base
81 Obsoletes:      suspend-initrd < 1.0
82
83 %description initrd
84 Suspend to RAM/Disk/Both resume program for initrd.
85
86 %description initrd -l pl.UTF-8
87 Zamrażanie w RAM/Dysku/Jedno i drugie - program resume dla initrd.
88
89 %prep
90 %setup -q
91 %patch0 -p1
92 %patch1 -p2
93 %patch2 -p1
94 %patch3 -p1
95 %patch4 -p1
96
97 install %{SOURCE1} .
98
99 cat >syscalltest.c <<EOF
100 #include <stdio.h>
101 #include <sys/syscall.h>
102 int main() { printf("%d", SYS_reboot); return 0; }
103 EOF
104 %{__cc} syscalltest.c -o syscalltest
105 SYS_REBOOT_NR=`./syscalltest`
106
107 sed -i -e "s/SYS_REBOOT_NR/$SYS_REBOOT_NR/" swsusp.h
108
109 # I don't see any issue here (nor libgcc_s.a)
110 %{?with_splashy:sed -i -e 's|AC_CHECK_LIB(\[gcc_s\], \[strlen\])||' configure.ac}
111
112 %build
113 %{__libtoolize}
114 %{__aclocal}
115 %{__autoheader}
116 %{__autoconf}
117 %{__automake}
118
119 %if %{with initrd}
120 __cc="%{__cc}"
121 __cc=${__cc#ccache }
122 %configure \
123         %{?with_dietlibc:CFLAGS="%{rpmcflags} -D_BSD_SOURCE -Os -static"} \
124         %{?with_dietlibc:CC="diet ${__cc}"} \
125         %{?with_splashy:--enable-splashy} \
126         --enable-compress \
127         --enable-encrypt \
128         --enable-static \
129         --disable-shared
130
131 %if %{with dietlibc}
132 %{__make} libsuspend-common.a resume-resume.o
133 diet ${__cc} %{rpmcflags} %{rpmldflags} -D_BSD_SOURCE -Os -static \
134         -DS2RAM -D_LARGEFILE64_SOURCE -D_GNU_SOURCE \
135         -o resume resume-resume.o \
136         libsuspend-common.a -llzo2 -lgcrypt -lgpg-error -lcompat
137 %else
138 %{__make} resume
139 %endif
140 mv resume resume-initrd
141 %{__make} clean
142 %endif
143
144 %configure \
145         %{?with_splashy:--enable-splashy} \
146         --enable-compress \
147         --enable-threads \
148         --enable-encrypt
149
150 %{__make}
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154
155 install -d $RPM_BUILD_ROOT/etc
156
157 %{__make} install \
158         DESTDIR=$RPM_BUILD_ROOT
159
160 %if %{with initrd}
161 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
162 install -p resume-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/resume
163 %endif
164
165 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %files
171 %defattr(644,root,root,755)
172 %doc HOWTO README* AUTHORS ReleaseNotes
173 %attr(755,root,root) %{_sbindir}/*
174 %dir %{_libdir}/suspend
175 %attr(755,root,root) %{_libdir}/suspend/resume
176 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/suspend.conf
177
178 %if %{with initrd}
179 %files initrd
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_libdir}/initrd/resume
182 %endif
This page took 0.102377 seconds and 3 git commands to generate.