Separate out the high-level API actions.
[libguestfs.git] / libguestfs.spec.in
index ed982a4..3a79276 100644 (file)
@@ -1,7 +1,5 @@
 # @configure_input@
 
-#%global mirror http://hakodate/mirrors/fedora/10/Fedora/x86_64/os/
-
 Summary:     Access and modify virtual machine disk images
 Name:        libguestfs
 Version:     @VERSION@
@@ -17,9 +15,18 @@ BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
 BuildRequires: febootstrap >= 1.5
 BuildRequires: augeas-devel >= 0.5.0
-BuildRequires: qemu
-
-# If you want to build the bindings for different languages:
+BuildRequires: readline-devel
+BuildRequires: qemu >= 0.10-7
+BuildRequires: createrepo
+
+# Build requirements for the appliance:
+# (see 'make-initramfs.sh.in' in the source)
+BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
+BuildRequires: MAKEDEV, net-tools, augeas-libs, file
+BuildRequires: module-init-tools, procps, strace, iputils
+
+# These are only required if you want to build the bindings for
+# different languages:
 BuildRequires: ocaml
 BuildRequires: ocaml-findlib-devel
 BuildRequires: perl-devel
@@ -28,9 +35,11 @@ BuildRequires: perl-Test-Pod
 BuildRequires: perl-Test-Pod-Coverage
 BuildRequires: perl-ExtUtils-MakeMaker
 BuildRequires: python-devel
+BuildRequires: ruby-devel
+BuildRequires: rubygem-rake
 
 # Runtime requires:
-Requires:    qemu
+Requires:    qemu >= 0.10-7
 
 
 %description
@@ -63,6 +72,8 @@ For OCaml bindings, see 'libguestfs-ocaml-devel'.
 
 For Python bindings, see 'libguestfs-python'.
 
+For Ruby bindings, see 'libguestfs-ruby'.
+
 
 %package devel
 Summary:     Development tools and libraries for %{name}
@@ -136,12 +147,25 @@ Requires:    %{name} = %{version}-%{release}
 %{name}-python contains Python bindings for %{name}.
 
 
+%package ruby
+Summary:     Ruby bindings for %{name}
+Group:       Development/Libraries
+Requires:    %{name} = %{version}-%{release}
+Requires:    ruby(abi) = 1.8
+Provides:    ruby(guestfs) = %{version}
+
+%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
+%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
+
+%description ruby
+%{name}-ruby contains Ruby bindings for %{name}.
+
+
 %prep
 %setup -q
 
 
 %build
-#%configure --with-mirror=%{mirror}
 %configure
 
 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
@@ -150,7 +174,7 @@ make INSTALLDIRS=vendor
 
 
 %check
-make check
+test -n "$QUICK_RPMBUILD" || make check
 
 
 %install
@@ -181,6 +205,21 @@ popd
 find $RPM_BUILD_ROOT -name perllocal.pod -delete
 find $RPM_BUILD_ROOT -name .packlist -delete
 
+rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
+rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
+
+if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
+   mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
+   mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
+     $RPM_BUILD_ROOT%{python_sitelib}/
+fi
+
+# Install ruby bindings by hand.
+mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
+mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
+install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
+install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -245,8 +284,24 @@ rm -rf $RPM_BUILD_ROOT
 
 %files python
 %defattr(-,root,root,-)
+%{python_sitearch}/*
+%{python_sitelib}/*.py
+%{python_sitelib}/*.pyc
+%{python_sitelib}/*.pyo
+
+
+%files ruby
+%defattr(-,root,root,-)
+%{ruby_sitelib}/guestfs.rb
+%{ruby_sitearch}/_guestfs.so
 
 
 %changelog
-* Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
+* Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
+- New upstream version @VERSION@.
+
+* Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
+- Multiple fixes to get it to scratch build in Koji.
+
+* Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1
 - Initial build.