app=mdadm
version=4.0
build=1sml
homepage="https://git.kernel.org/cgit/utils/mdadm"
download="https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/snapshot/mdadm-$version.tar.gz"
desc="utility to create, manage and monitor software RAID devices"
requires="musl"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  make STRIP= \
    CHECK_RUN_DIR=0 \
    CC="$CC -include sys/sysmacros.h" \
    CWFLAGS="-Wall" \
    MANDIR="/share/man" \
    BINDIR="/bin" \
    RUNDIR="/var/run/mdadm" \
    UDEVDIR="/etc/udev" \
    DESTDIR="$pkg" all install

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
ad35d0e80f5ff42f0cd853a742d78b1cc51edb2fea285881bcb3c81e5830e220984b7c1bb6c5a645c51ed5cfa72ad18e23603b8c9ca5cc959a01ae17a86e65d9  mdadm-4.0.tar.lz
"
