modified spec file for inclusion in Fedora
[ovirt-node-image.git] / ovirt-node-image.spec.in
blob36a0802989b7b5476c572f9db2764a021f8bd181
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 Source2: %{name}-manifests.tar
12 %define image_iso %{SOURCE1}
13 %define image_manifests %{SOURCE2}
14 %else
15 %define image_iso %{name}.iso
16 %define image_manifests %{name}-manifests.tar
17 %endif
18 License: GPLv2+
19 Group: Applications/System
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
21 URL: http://ovirt.org/
22 %if ! %{source_iso}
23 BuildRequires: livecd-tools >= 020-2
24 BuildRequires: appliance-tools >= 003.9
25 %endif
26 BuildRequires: ovirt-node-tools
27 Requires: livecd-tools >= 020-2
29 %define app_root %{_datadir}/%{name}
31 # disable debuginfo, makes no sense for boot image and it is created empty anyway
32 %define debug_package %{nil}
34 %description
35 The ISO boot image for oVirt Node booting from CDROM device.
36 At the moment, this RPM just packages prebuilt ISO.
38 %package pxe
39 Summary: oVirt Node PXE image
40 Group: Applications/System
41 Requires: %{name} = %{version}-%{release}
43 %description pxe
44 PXE boot image installer for oVirt Node network boot from oVirt Server.
46 %prep
47 %setup -q
48 %if ! %{source_iso}
49 ./configure
50 %endif
52 %build
53 %if ! %{source_iso}
54 make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \
55 %{?ovirt_local_repo: OVIRT_LOCAL_REPO=%{ovirt_local_repo}} \
56 %{?ovirt_url: OVIRT_URL=%{ovirt_url}} \
57 %{name}.iso
58 %endif
60 %install
61 %{__rm} -rf %{buildroot}
62 mkdir %{buildroot}
64 %{__install} -d -m0755 %{buildroot}%{app_root}
65 %{__install} -p -m0644 %{image_iso} %{buildroot}%{app_root}
66 %{__install} -d -m0755 %{buildroot}%{_sbindir}
67 #%{__install} -p -m0755 create-ovirt-iso-nodes %{buildroot}%{_sbindir}
68 #%{__install} -p -m0755 edit-livecd %{buildroot}%{_sbindir}
69 #%{__install} -p -m0755 livecd-iso-to-iscsi %{buildroot}%{_sbindir}
70 #%{__install} -p -m0755 livecd-setauth %{buildroot}%{_sbindir}
71 #%{__install} -p -m0755 livecd-rpms %{buildroot}%{_sbindir}
72 %{__tar} -xf %{image_manifests} -C %{buildroot}%{app_root}
74 %clean
75 %{__rm} -rf %{buildroot}
77 %post pxe
78 cd %{app_root}
79 rm -rf tftpboot
80 livecd-iso-to-pxeboot %{name}.iso > /dev/null
81 cobbler sync > /dev/null 2>&1 || :
83 %files
84 %defattr(0644,root,root,0755)
85 %{app_root}/%{name}.iso
86 %doc %{app_root}/manifests/rpm-manifest.txt
87 %doc %{app_root}/manifests/srpm-manifest.txt
88 %doc %{app_root}/manifests/file-manifest.txt
89 %doc %{app_root}/manifests/dir-manifest.txt
90 %doc %{app_root}/manifests/rpm-manifest-post.txt
91 %doc %{app_root}/manifests/srpm-manifest-post.txt
92 %doc %{app_root}/manifests/file-manifest-post.txt
93 %doc %{app_root}/manifests/dir-manifest-post.txt
94 %doc %{app_root}/manifests/ovirt-release
96 %defattr(0755,root,root,0755)
97 #%{_sbindir}/create-ovirt-iso-nodes
98 #%{_sbindir}/edit-livecd
99 #%{_sbindir}/livecd-iso-to-iscsi
100 #%{_sbindir}/livecd-setauth
101 #%{_sbindir}/livecd-rpms
103 %files pxe
104 %defattr(0644,root,root,0755)
106 %changelog
107 * Thu Jul 03 2008 Perry Myers <pmyers@redhat.com> 0.92-0
108 - Only store ISO in SRPM, and generate PXE from that during build
110 * Tue Jun 03 2008 Alan Pevec <apevec@redhat.com> 0.0.5-1
111 - Initial build.