1 # If you have trouble building locally ('make local') try adding
2 # %libguestfs_buildnet 1
3 # to your ~/.rpmmacros file.
5 # Enable to build using a network repo
7 %if %{defined libguestfs_buildnet}
8 %global buildnet %{libguestfs_buildnet}
13 %global supermindir %{_libdir}/a-fedora-appliance/supermin.d
14 %global appliancedir %{_localstatedir}/lib/a-fedora-appliance
17 Name: a-fedora-appliance
19 Release: @RELEASE@%{?dist}
20 Summary: A package that contains a Fedora appliance
22 Group: Applications/Emulators
24 #URL: http://people.redhat.com/~rjones/
25 Source0: %{name}-%{version}.tar.gz
27 BuildRequires: @PACKAGELIST@
28 Requires: @PACKAGELIST@
30 BuildRequires: createrepo
32 BuildRequires: febootstrap >= 3.3
33 Requires(post): febootstrap-supermin-helper >= 3.3
35 Requires: qemu-kvm >= 0.12
37 # Provide our own custom requires for the supermin appliance.
38 Source1: extra-find-requires.sh
39 %global _use_internal_dependency_generator 0
40 %global __find_provides %{_rpmconfigdir}/find-provides
41 %global __find_requires %{SOURCE1} %{_rpmconfigdir}/find-requires
45 This is a package that contains a Fedora appliance, otherwise known as
46 a small Fedora virtual machine.
48 You can boot this virtual machine, log into it, and use it as a
49 throwaway to test Fedora things. Or you can use it as a test of your
50 hypervisor or virtual machine management tools.
52 Note: The appliance only contains command line tools (no X11 or office
53 suites). rpm and yum installation of packages is not supported.
56 This package contains an appliance built for Fedora %{fedora}.
69 find /var/cache/yum -type f -name '*.rpm' -print0 | xargs -0 cp -t repo
73 cachedir=/var/cache/yum
75 logfile=/var/log/yum.log
84 baseurl=file://$(pwd)/repo
85 failovermethod=priority
89 %define extra --with-yum-config=$(pwd)/yum.conf
98 make DESTDIR=$RPM_BUILD_ROOT install
100 mkdir -p $RPM_BUILD_ROOT%{appliancedir}
104 # XXX We should add an RPM trigger so that this gets rebuilt after any
105 # dependent package install (recursively).
107 %{_libexecdir}/build-a-fedora-appliance "%{supermindir}" \
108 "%{appliancedir}/kernel" "%{appliancedir}/initrd" "%{appliancedir}/root" && \
109 echo "Fedora %{fedora} appliance built in %{appliancedir}"
113 if [ "$1" -eq 0 ]; then
114 rm -f "%{appliancedir}/kernel" "%{appliancedir}/initrd" "%{appliancedir}/root"
119 %defattr(-,root,root,-)
122 %{_libdir}/a-fedora-appliance/
123 %{_libexecdir}/build-a-fedora-appliance
124 %{_bindir}/boot-a-fedora-appliance
128 * Mon Oct 10 2011 Richard W.M. Jones <rjones@redhat.com> - 1.0-@RELEASE@