# Obarun        : 66 init/supervisor
# Maintainer    : Eric Vidal <eric@obarun.org>
# Maintainer    : Jean-Michel T.Dydak <jean-michel@obarun.org>
# Obarun PkgSrc : https://git.obarun.org/pkg/obcore/mkinitcpio
#----------------
#--------------------------------------------------------------
# DESCRIPTION ]

pkgname=mkinitcpio
pkgver=31
pkgrel=3

pkgdesc='Modular initramfs image creation utility'

url='https://github.com/archlinux/mkinitcpio'

source=(
    "https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"
    '001-remove-systemd-and-kept-gzip-as-default.patch'
)

#----------------------
# BUILD CONFIGURATION ]

makedepends=(
    'asciidoc'
    'git'
    'sed'
)

#------------------------
# INSTALL CONFIGURATION ]

arch=(x86_64)

install=mkinitcpio.install

depends=(
    'awk'
    'mkinitcpio-busybox>=1.19.4-2'
    'kmod'
    'util-linux>=2.23'
    'libarchive'
    'coreutils'
    'bash'
    'binutils'
    'diffutils'
    'findutils'
    'grep'
    'filesystem>=2011.10-1'
    'gzip'
    'lz4'
    'sed'
)

optdepends=(
    'xz: Use lzma or xz compression for the initramfs image'
    'bzip2: Use bzip2 compression for the initramfs image'
    'lzop: Use lzo compression for the initramfs image'
    'lz4: Use lz4 compression for the initramfs image'
    'zstd: Use zstd compression for the initramfs image'
    'mkinitcpio-nfs-utils: Support for root filesystem on NFS'
)

backup=(
    'etc/mkinitcpio.conf'
)

provides=(
    "mkinitcpio=$pkgver-$pkgrel"
    'initramfs'
)

#----------------
# BUILD PREPARE ]

prepare() {
    cd $pkgname-$pkgver

    ## Apply 0003-remove-systemd.patch
    patch -Np1 < $srcdir/001-remove-systemd-and-kept-gzip-as-default.patch

}

#--------
# CHECK ]

check() {
    make -C $pkgname-$pkgver check
}

#----------
# PACKAGE ]

package() {
    make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
}

#-------------------------
# LICENCE AND VALIDATION ]

license=(GPL)

sha512sums=(' ')
