fix Build-requires when image ISO is in SRPM
[ovirt-node-image.git] / ovirt-node-image.spec.in
blobd773086fa84f143132af8e80ba1ba6db04614cfe
1 #include pre-built image ISO as source
2 %{!?source_iso: %define source_iso 0}
4 Summary: oVirt Node ISO image
5 Name: ovirt-node-image
6 Version: @VERSION@
7 Release: 0%{?dist}%{?extra_release}
8 Source0: %{name}-%{version}.tar.gz
9 %if %{source_iso}
10 Source1: %{name}.iso
11 %define image_iso %{SOURCE1}
12 %else
13 %define image_iso %{name}.iso
14 %endif
15 License: GPLv2+
16 Group: Applications/System
17 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
18 URL: http://ovirt.org/
19 %if ! %{source_iso}
20 BuildRequires: livecd-tools >= 020-2
21 Requires: appliance-tools >= 003.9
22 %endif
24 %define app_root %{_datadir}/%{name}
26 # disable debuginfo, makes no sense for boot image and it is created empty anyway
27 %define debug_package %{nil}
29 %description
30 The ISO boot image for oVirt Node booting from CDROM device.
31 At the moment, this RPM just packages prebuilt ISO.
33 %package pxe
34 Summary: oVirt Node PXE image
35 Group: Applications/System
36 Requires: %{name} = %{version}-%{release}
38 %description pxe
39 PXE boot image installer for oVirt Node network boot from oVirt Server.
41 %prep
42 %setup -q
43 %if ! %{source_iso}
44 ./configure
45 %endif
47 %build
48 %if ! %{source_iso}
49 make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \
50 %{?ovirt_local_repo: OVIRT_LOCAL_REPO=%{ovirt_local_repo}} \
51 %{?ovirt_url: OVIRT_URL=%{ovirt_url}} \
52 %{name}.iso
53 %endif
55 %install
56 %{__rm} -rf %{buildroot}
57 mkdir %{buildroot}
59 %{__install} -d -m0755 %{buildroot}%{app_root}
60 %{__install} -p -m0644 %{image_iso} %{buildroot}%{app_root}
61 %{__install} -d -m0755 %{buildroot}%{_sbindir}
62 %{__install} -p -m0755 ovirt-pxe %{buildroot}%{_sbindir}
63 %{__install} -p -m0755 ovirt-flash %{buildroot}%{_sbindir}
64 %{__install} -p -m0755 create-ovirt-iso-nodes %{buildroot}%{_sbindir}
65 %{__install} -p -m0755 edit-livecd %{buildroot}%{_sbindir}
66 %{__install} -p -m0755 livecd-setauth %{buildroot}%{_sbindir}
68 %clean
69 %{__rm} -rf %{buildroot}
71 %post pxe
72 cd %{app_root}
73 rm -rf tftpboot
74 ovirt-pxe %{name}.iso > /dev/null
75 cobbler sync > /dev/null 2>&1 || :
77 %files
78 %defattr(-,root,root,0644)
79 %{app_root}/%{name}.iso
80 %defattr(-,root,root,0755)
81 %{_sbindir}/ovirt-pxe
82 %{_sbindir}/ovirt-flash
83 %{_sbindir}/create-ovirt-iso-nodes
84 %{_sbindir}/edit-livecd
85 %{_sbindir}/livecd-setauth
87 %files pxe
88 %defattr(0644,root,root,0755)
90 %changelog
91 * Thu Jul 03 2008 Perry Myers <pmyers@redhat.com> 0.92-0
92 - Only store ISO in SRPM, and generate PXE from that during build
94 * Tue Jun 03 2008 Alan Pevec <apevec@redhat.com> 0.0.5-1
95 - Initial build.