abort if nscd is found running
[ovirt-node-image.git] / ovirt-node-image.spec.in
blob8451dd379c43229e754211a2a089f867e178d0a0
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 Requires: livecd-tools >= 020-2
28 %define app_root %{_datadir}/%{name}
30 # disable debuginfo, makes no sense for boot image and it is created empty anyway
31 %define debug_package %{nil}
33 %description
34 The ISO boot image for oVirt Node booting from CDROM device.
35 At the moment, this RPM just packages prebuilt ISO.
37 %package pxe
38 Summary: oVirt Node PXE image
39 Group: Applications/System
40 Requires: %{name} = %{version}-%{release}
42 %description pxe
43 PXE boot image installer for oVirt Node network boot from oVirt Server.
45 %prep
46 %setup -q
47 %if ! %{source_iso}
48 ./configure
49 %endif
51 %build
52 %if ! %{source_iso}
53 make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \
54 %{?ovirt_local_repo: OVIRT_LOCAL_REPO=%{ovirt_local_repo}} \
55 %{?ovirt_url: OVIRT_URL=%{ovirt_url}} \
56 %{name}.iso
57 %endif
59 %install
60 %{__rm} -rf %{buildroot}
61 mkdir %{buildroot}
63 %{__install} -d -m0755 %{buildroot}%{app_root}
64 %{__install} -p -m0644 %{image_iso} %{buildroot}%{app_root}
65 %{__install} -d -m0755 %{buildroot}%{_sbindir}
66 %{__install} -p -m0755 ovirt-pxe %{buildroot}%{_sbindir}
67 %{__install} -p -m0755 ovirt-flash %{buildroot}%{_sbindir}
68 %{__install} -p -m0755 create-ovirt-iso-nodes %{buildroot}%{_sbindir}
69 %{__install} -p -m0755 edit-livecd %{buildroot}%{_sbindir}
70 %{__install} -p -m0755 livecd-setauth %{buildroot}%{_sbindir}
71 %{__tar} -xf %{image_manifests} -C %{buildroot}%{app_root}
73 %clean
74 %{__rm} -rf %{buildroot}
76 %post pxe
77 cd %{app_root}
78 rm -rf tftpboot
79 ovirt-pxe %{name}.iso > /dev/null
80 cobbler sync > /dev/null 2>&1 || :
82 %files
83 %defattr(0644,root,root,0755)
84 %{app_root}/%{name}.iso
85 %doc %{app_root}/manifests/rpm-manifest.txt
86 %doc %{app_root}/manifests/srpm-manifest.txt
87 %doc %{app_root}/manifests/file-manifest.txt
88 %doc %{app_root}/manifests/dir-manifest.txt
89 %doc %{app_root}/manifests/rpm-manifest-post.txt
90 %doc %{app_root}/manifests/srpm-manifest-post.txt
91 %doc %{app_root}/manifests/file-manifest-post.txt
92 %doc %{app_root}/manifests/dir-manifest-post.txt
93 %doc %{app_root}/manifests/ovirt-release
95 %defattr(0755,root,root,0755)
96 %{_sbindir}/ovirt-pxe
97 %{_sbindir}/ovirt-flash
98 %{_sbindir}/create-ovirt-iso-nodes
99 %{_sbindir}/edit-livecd
100 %{_sbindir}/livecd-setauth
102 %files pxe
103 %defattr(0644,root,root,0755)
105 %changelog
106 * Thu Jul 03 2008 Perry Myers <pmyers@redhat.com> 0.92-0
107 - Only store ISO in SRPM, and generate PXE from that during build
109 * Tue Jun 03 2008 Alan Pevec <apevec@redhat.com> 0.0.5-1
110 - Initial build.