1 %{!?ovirt_cache_dir: %define ovirt_cache_dir /var/tmp/ovirt-cache}
2 %{!?ovirt_local_repo: %define ovirt_local_repo file://%{ovirt_cache_dir}/ovirt}
3 %{!?ovirt_url: %define ovirt_url http://ovirt.org/repos/ovirt}
4 %define fedora_mirror http
://mirrors.fedoraproject.org
/mirrorlist
6 Summary: oVirt Node ISO image
9 Release: 1%{?dist}%{?extra_release}
10 Source0: %{name}-%{version}.tar.gz
12 Group: Applications
/System
13 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
14 URL: http
://ovirt.org
/
15 BuildRequires
: livecd
-tools
>= 017.1-2ovirt
16 BuildRequires
: syslinux
17 BuildRequires
: appliance
-tools
>= 002-3
19 %define app_root
%{_datadir}/%{name}
20 %define tftpboot
%{_var}/lib
/tftpboot
22 # disable debuginfo, makes no sense for boot image and it is created empty anyway
23 %define debug_package
%{nil}
26 The ISO boot image
for oVirt Node booting from CDROM device.
27 At the moment
, this RPM just packages prebuilt ISO.
30 Summary: oVirt Node PXE image
31 Group: Applications
/System
34 The PXE boot image
for oVirt Node network boot from oVirt Server.
40 %if 0%{?fedora} == 010
42 %if "
%{?fedora_url}"
== ""
44 repo
--name
=rawhide
--mirrorlist
=%{fedora_mirror}?repo=rawhide&arch=%{_arch}
48 repo
--name
=rawhide
--baseurl
=%{fedora_url}/development/%{_arch}/os
51 cat
>> repos.ks
<< EOF
52 repo
--name
=ovirt
-org
--baseurl
=%{ovirt_url}/development/%{_arch}
55 %if "
%{?fedora_url}"
== ""
57 repo
--name
=f
%{fedora} --mirrorlist=%{fedora_mirror}?repo=fedora-%{fedora}&arch=%{_arch}
58 repo
--name
=f
%{fedora}-updates-newkey --mirrorlist=%{fedora_mirror}?repo=updates-released-f%{fedora}.newkey&arch=%{_arch}
62 repo
--name
=f
%{fedora} --baseurl=%{fedora_url}/releases/%{fedora}/Everything/%{_arch}/os
63 repo
--name
=f
%{fedora}-updates-newkey --baseurl=%{fedora_url}/updates/%{fedora}/%{_arch}.newkey
66 cat
>> repos.ks
<< EOF
67 repo
--name
=ovirt
-org
--baseurl
=%{ovirt_url}/%{fedora}/%{_arch}
71 cat
>> repos.ks
<< EOF
72 repo
--name
=ovirt
-local --baseurl
=%{ovirt_local_repo}
75 mkdir -p
%{ovirt_cache_dir}/node
-image
-tmp
76 mkdir -p
%{ovirt_cache_dir}/yum
78 sudo su
- -c "
cd $
(pwd) &&
79 enforcing
=\$
(getenforce
)
81 Enforcing
) setenforce Permissive
;;
83 *) if ksflatten
%{name}.ks
2>/dev
/null \
84 | grep
-q '^selinux
--disabled$'
; then
85 echo WARNING
: SELinux disabled
in kickstart
87 echo ERROR
: SELinux enabled
in kickstart
, \
88 but disabled on the build machine
92 livecd
-creator
--skip
-minimize
-c
%{name}.ks -f %{name} \
93 --tmpdir
='
%{ovirt_cache_dir}/node
-image
-tmp' \
94 --cache
='
%{ovirt_cache_dir}/yum'
95 if [ \$enforcing
= Enforcing
]; then
96 setenforce Enforcing ||
exit 1
98 sudo su
- -c "
cd $
(pwd) && .
/ovirt
-pxe
%{name}.iso"
99 sudo su
- -c "
cd $
(pwd) && chown
-R $USER ."
102 %{__rm} -rf %{buildroot}
105 %{__install} -d -m0755 %{buildroot}%{tftpboot}
106 %{__install} -d -m0755 %{buildroot}%{tftpboot}/pxelinux.cfg
107 %{__install} -p -m0644 tftpboot/pxelinux.cfg/default %{buildroot}%{tftpboot}/pxelinux.cfg
/default
108 %{__install} -p -m0644 tftpboot/pxelinux.0 %{buildroot}%{tftpboot}
109 %{__install} -p -m0644 tftpboot/initrd0.img %{buildroot}%{tftpboot}
110 %{__install} -p -m0644 tftpboot/vmlinuz0 %{buildroot}%{tftpboot}
111 %{__install} -d -m0755 %{buildroot}%{app_root}
112 %{__install} -p -m0644 %{name}.iso %{buildroot}%{app_root}
113 %{__install} -d -m0755 %{buildroot}%{_sbindir}
114 %{__install} -p -m0755 ovirt-pxe %{buildroot}%{_sbindir}
115 %{__install} -p -m0755 ovirt-flash %{buildroot}%{_sbindir}
116 %{__install} -p -m0755 ovirt-flash-static %{buildroot}%{_sbindir}
119 %{__rm} -rf %{buildroot}
122 cobbler sync
> /dev
/null
2>&1 ||
:
125 %defattr(-,root
,root
,0644)
126 %{app_root}/%{name}.iso
127 %defattr(-,root
,root
,0755)
128 %{_sbindir}/ovirt
-pxe
129 %{_sbindir}/ovirt
-flash
130 %{_sbindir}/ovirt
-flash
-static
133 %defattr(-,root
,root
,0644)
134 %config(noreplace
) %{tftpboot}/pxelinux.cfg
/default
135 %{tftpboot}/pxelinux
.0
136 %{tftpboot}/initrd0.img
140 * Thu Jul
03 2008 Perry Myers
<pmyers@redhat.com
> 0.92-0
141 - Only store ISO
in SRPM
, and generate PXE from that during build
143 * Tue Jun
03 2008 Alan Pevec
<apevec@redhat.com
> 0.0.5-1