sickcodes / aur

Sick Codes AUR Packages
GNU General Public License v3.0
8 stars 5 forks source link

libguestfs-dev #2

Open stef204 opened 2 years ago

stef204 commented 2 years ago

I built your package and noticed virt-sparsify is not part of it -> no binary is created in /usr/bin/ for it. Is that intentional?

sickcodes commented 2 years ago

Hey @stef204 thanks for the note!

Apparently, this comes with libguestfs-tools, which I have found here: https://download.libguestfs.org/guestfs-tools/

Ill create an AUR shortly for libguestfs-tools using the RPM

sickcodes commented 2 years ago

Hey @stef204 I have a PKGBUILD for libguestfs-tools, however it conflicts with libguestfs itself, just working out how to put them together.

sickcodes commented 2 years ago

This should be libguestfs-git with tools and I may adopt the -git package:

Testing as we speak...


# Maintainer: Sick Codes <info at sick dot codes>
# Contributor: <coderobe @ archlinux.org>
# Contributor: Peter Wu <peter@lekensteyn.nl>
# Contributor: Evaggelos Balaskas <eblaskas _AT_ ebalaskas _DOT_ gr>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
# Contributor: Nikos Skalkotos <skalkoto (at) Gmail.com>

pkgname=libguestfs
pkgver=1.46.0
_pkgver_short=${pkgver%.*}
pkgrel=1
pkgdesc="Access and modify virtual machine disk images"
arch=('x86_64')
url="http://libguestfs.org/"
license=('GPL2' 'LGPL2.1')
_appliancedeps=('iproute2' 'mdadm' 'lvm2' 'libldm' 'btrfs-progs' 'dosfstools' 'gdisk' 'procps' 'psmisc'
                'rsync' 'xfsprogs' 'dhcpcd' 'iputils' 'ntfs-3g' 'vim' 'systemd-sysvcompat' 'openssh'
                'f2fs-tools' 'jfsutils' 'lsscsi' 'lsof' 'lzop' 'pciutils' 'squashfs-tools'
                'strace' 'syslinux' 'debootstrap' 'exfat-utils' 'grub' 'lrzip' 'mtools'
                'multipath-tools' 'nilfs-utils' 'reiserfsprogs' 'yara')
#               'scrub' 'zerofree' 'hfsprogs')
depends=('augeas' 'libvirt' 'jansson' 'fuse' 'hivex' 'sleuthkit' 'supermin' 'qemu-headless' 'libconfig'
         'perl-libintl-perl' "${_appliancedeps[@]}")
makedepends=('ocaml' 'ocaml-findlib' 'gperf' 'cdrtools' 'perl-module-build' 'python'
             'gobject-introspection' 'vala' 'bash-completion' 'cpio' 'java-environment'
             'php' 'erlang-nox' 'lua' 'rust')
# 'go' 'ghc' 'ruby')
checkdepends=('linux')
optdepends=('ocaml: OCaml Bindings'
            'python: Python Bindings'
            'gobject-introspection: GObject-Introspection Bindings')
provides=('libguestfs.so' 'libguestfs-gobject-1.0.so')
backup=('etc/libguestfs-tools.conf'
        'etc/xdg/virt-builder/repos.d/libguestfs.conf'
        'etc/xdg/virt-builder/repos.d/libguestfs.gpg'
        'etc/xdg/virt-builder/repos.d/opensuse.conf'
        'etc/xdg/virt-builder/repos.d/opensuse.gpg')
source=("https://download.libguestfs.org/$_pkgver_short-stable/$pkgname-$pkgver.tar.gz"{,.sig})
sha256sums=('11c5a39f241b514558f9a734b7dc1606a9b7cc5b1c8f3c5797a395547a3530ae'
            'SKIP')
validpgpkeys=('F7774FB1AD074A7E8C8767EA91738F73E1B768A0') # Richard W.M. Jones <rjones@redhat.com>

prepare() {
  cd "$pkgname-$pkgver"
  sed -i 's/ Sys::Virt / /g' m4/guestfs-perl.m4
  autoreconf -vi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --sbindir=/usr/bin \
    --disable-static \
    --disable-haskell \
    --disable-ruby \
    --with-extra-packages="libldm systemd-sysvcompat openssh qemu-headless" \
    --with-guestfs-path=/usr/lib/guestfs
  # ^ haskell & ruby bindings do not build
  make
}

check() {
  cd "$pkgname-$pkgver"
  #tests require /dev/kvm to be available
#  make quickcheck
#  make -k check ||: takes ages
}

package() {
  cd "$pkgname-$pkgver"
  make INSTALLDIRS=vendor DESTDIR="$pkgdir" install
  find "$pkgdir/usr/lib/perl5" -name '*.so' -exec chmod 644 {} +
  find "$pkgdir/usr/lib/perl5" -name '*.bs' -exec rm -f {} +

  # Remove obsolete binaries (RHBZ#1213298).
  rm -f "$pkgdir"/usr/bin/virt-list-{filesystems,partitions}
  rm -f "$pkgdir"/usr/bin/virt-tar
  rm -f "$pkgdir"/usr/share/man/man1/virt-list-{filesystems,partitions}.1*
  rm -f "$pkgdir"/usr/share/man/man1/virt-tar.1*
}
sickcodes commented 2 years ago

Added as libguestfs-bin since tools are provided as prebuilt binaries:

https://aur.archlinux.org/packages/libguestfs-bin/

sickcodes commented 2 years ago

... which was subsequently flagged for removal, so I emailed the community package maintainer to update to stable :

https://github.com/libguestfs/libguestfs/commits/v1.46.0

https://raw.githubusercontent.com/sickcodes/aur/master/libguestfs-bin/PKGBUILD

stef204 commented 2 years ago

great. let me check all this out, thanks!

stef204 commented 2 years ago

there is an error occurring multiple times in the PKGBUILD this one:

line 46: cd: libguestfs-bin-1.46.0: No such file or directory

cf the variable $pkgname and $_pkgname

also: the the above PKGBUILD does not seem to build the tools, or at least virt-sparsify binary is not present after building it.

are you going to create/maintain guestfs-tools as a separate package in AUR perhaps?

sickcodes commented 2 years ago

@stef204 I spoke to the the maintainer of official community libguestfs and it was updated we deleted libguestfs-bin.

stef204 commented 2 years ago

The guestfs-tools (virt-sparsify, etc.) are nowhere to be found, whether officially or in the aur. Are you interested in creating a package for it?

sickcodes commented 2 years ago

Hey Stef, they come pre-compiled according to the PKGBUILD of the AUR main package.

You just need libguestfs from Arch Community; it is libguestfs and libguestfs-tools

However, I would of course want them in this AUR dev fork.

According to: https://libguestfs.org/guestfs-building.1.html#selected-.-configure-settings

So I will test some flag options to get it running.

sickcodes commented 2 years ago

I am testing adding all the flags

stef204 commented 2 years ago

You just need libguestfs from Arch Community; it is libguestfs and libguestfs-tools

Cannot find libguestfs-tools or guestfs-tools (which does contain virt-sparsify) either as official package or in the aur. Am I missing something?

So I will test some flag options to get it running.

Thanks.

sickcodes commented 2 years ago

They both come in libguestfs on Arch

stef204 commented 2 years ago

At the moment, I have libguestfs official, version 1.46.0-1 and no sign of virt-sparsify for example, where that binary should build as is present in the source code. That's why I am asking "am I missing something"? Did you verify that on your side?