diff --git a/srcpkgs/libguestfs-devel b/srcpkgs/libguestfs-devel new file mode 120000 index 00000000000..33472cd4389 --- /dev/null +++ b/srcpkgs/libguestfs-devel @@ -0,0 +1 @@ +libguestfs \ No newline at end of file diff --git a/srcpkgs/libguestfs/files/update-libguestfs-appliance b/srcpkgs/libguestfs/files/update-libguestfs-appliance new file mode 100644 index 00000000000..3c51ebc69ad --- /dev/null +++ b/srcpkgs/libguestfs/files/update-libguestfs-appliance @@ -0,0 +1,58 @@ +#!/bin/bash +# +# update-guestfs-appliance: download and install a guestfs binary appliance +# Copyright (C) 2013 Nikos Skalkotos +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +VERSION=1.32.0 +SHA512SUM="202d0dde45612f9ef45cdb73cd4aeba6c75dcd52790e7f156b2ff404616887af4019e5bd061e3c6607f4f96ac136132c31d180dda31a71bfb31ade5da508b832" + +set -e +umask 022 + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" >&2 + exit 1 +fi + +echo >&2 +echo "Downloading binary appliance v$VERSION for libguestfs ... " >&2 +echo >&2 + +# Cache file to avoid redownloading it on a second run +mkdir -p /var/cache/guestfs +cd /var/cache/guestfs +silent= +if [ ! -t 1 ]; then + echo "Output is not a TTY, not outputting progress (be patient!)" >&2 + silent=-nv +fi +wget $silent --continue -O appliance-${VERSION}.tar.xz \ + http://libguestfs.org/download/binaries/appliance/appliance-${VERSION}.tar.xz + +echo -n "Checking checksum ... " >&2 +echo "$SHA512SUM appliance-${VERSION}.tar.xz" | sha512sum -c + +echo >&2 +echo "Extracting binary appliance files to /usr/lib/guestfs:" >&2 +tar -xvf appliance-${VERSION}.tar.xz -C /usr/lib/guestfs \ + --no-same-owner --strip-components=1 + +echo "Correcting permissions:" >&2 +chmod -v 644 "/usr/lib/guestfs/"{kernel,initrd,root,README.fixed} + +echo >&2 +echo "Binary appliance installation finished successfully!" >&2 diff --git a/srcpkgs/libguestfs/template b/srcpkgs/libguestfs/template new file mode 100644 index 00000000000..690892485c8 --- /dev/null +++ b/srcpkgs/libguestfs/template @@ -0,0 +1,53 @@ +# Template file for 'libguestfs' +pkgname=libguestfs +version=1.33.46 +revision=1 +_version_short=${version%.*} +build_style=gnu-configure +configure_args="--disable-static --disable-probes --disable-appliance +--disable-daemon --without-java --enable-introspection=no +--disable-erlang --disable-haskell --disable-gobject --without-gtk +$(vopt_enable ruby) $(vopt_enable python) $(vopt_enable go golang) +$(vopt_enable php) $(vopt_enable lua)" +hostmakedepends="cpio gperf cdrtools flex pkg-config automake libtool qemu git +ocaml ocaml-findlib perl-Module-Build perl +$(vopt_if ruby ruby) $(vopt_if python python) $(vopt_if go go) $(vopt_if php php) $(vopt_if lua lua)" +makedepends="ncurses-devel pcre-devel augeas-devel libxml2-devel gettext-devel +yajl-devel perl $(vopt_if ruby ruby-devel) $(vopt_if python python-devel) +$(vopt_if php php-devel) $(vopt_if lua lua-devel)" +short_desc="Access and modify virtual machine disk image" +maintainer="Andrea Brancaleoni " +license="GPL-2" +homepage="http://libguestfs.org" +distfiles="http://libguestfs.org/download/$_version_short-development/$pkgname-$version.tar.gz" +checksum=1ffad08469aae6efd118018616400d15bf6416a665573cad56065bc55dc5af99 + +conf_files="etc/libguestfs-tools.conf +etc/xdg/virt-builder/repos.d/libguestfs.conf +etc/xdg/virt-builder/repos.d/libguestfs.gpg" + +nopie=yes +nocross=yes + +only_for_archs="i686 x86_64" + +build_options="ruby python go php lua" +build_options_default="ruby" +desc_option_ruby="include ruby support" +desc_option_go="include golang support" +desc_option_php="include php support" + +pre_configure() { + sed -i 's|LD = @LD@|LD = cc|g' perl/Makefile.in + vbin ${FILESDIR}/update-libguestfs-appliance +} + +libguestfs-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +}