# Maintainer: Olliver Schinagl pkgname=mtd-utils pkgver=2.1.0 pkgrel=0 pkgdesc="Utilities for handling MTD devices, and for dealing with FTL, NFTL JFFS2, etc." url="http://www.linux-mtd.infradead.org/" arch="noarch" license="GPL-2.0-only" makedepends=" acl-dev autoconf automake coreutils cmocka-dev libtool linux-headers lzo-dev openssl-dev util-linux-dev zlib-dev " checkdepends="findutils" options="!check" # checks fail on builders _subpackages=" $pkgname-flash::all $pkgname-jffs::all $pkgname-misc::all $pkgname-nand::all $pkgname-nor::all $pkgname-ubi::all " subpackages="$pkgname-doc $_subpackages" _githash="1dba7944fe18978415a3ffc43932359a36b99b25" source=" $pkgname-$pkgver.tar.gz::http://git.infradead.org/mtd-utils.git/snapshot/$_githash.tar.gz 0001-unittests-test_lib-Include-proper-header-for-_IOC_SI.patch 0002-unittests-libmtd_test-Include-fcntl-header.patch 0003-unittests-Define-the-use-of-_GNU_SOURCE.patch " builddir="$srcdir/$pkgname-$(echo "$_githash" | cut -c1-7)" build() { ./autogen.sh ./configure \ --build="$CBUILD" \ --enable-tests \ --enable-unit-tests \ --host="$CHOST" \ --mandir="/usr/share/man" \ --prefix="/usr" \ --sysconfdir="/etc" make } _cat_found_file() { local _rc="$?" find -name "$1" -type f -ls -printf '%P {{{\n' -exec cat -v -n '{}' ';' -printf '}}} %P\n' return "$_rc" } check() { make check || _cat_found_file 'test-suite.log' } flash() { pkgdesc="MTD utils (flash commands)" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \( \ -iname '*flash*' \) \ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } jffs() { pkgdesc="MTD utils (JFFS* commands)" echo "$subpkgdir" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \(\ -iname '*jffs*' -o -iname 'sumtool' \)\ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } misc() { pkgdesc="MTD utils (miscellaneous commands)" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \(\ -iname '*doc*' -o -iname 'ftl*' -o \ -iname 'mtdpart' -o -iname 'mtd_debug' -o \ -iname 'recv_image' -o -iname 'serve_image' \)\ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } nand() { pkgdesc="MTD utils (NAND and FTL commands)" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \(\ -iname 'nand*' -o -iname 'nftl*' \)\ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } nor() { pkgdesc="MTD utils (NOR flash commands)" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \(\ -iname '*nor*' -o -iname 'rfd*' \)\ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } ubi() { pkgdesc="MTD utils (UBI and UBIFS commands)" mkdir -p "$subpkgdir/usr/sbin" find "$pkgdir/usr/sbin/" -type f \(\ -iname '*ubi*' -o \ -iname 'lsmtd' -o -iname 'mtdinfo' \)\ -exec mv -t "$subpkgdir/usr/sbin/" "{}" + } package() { depends="$_subpackages" make DESTDIR="$pkgdir" install } sha512sums="bb64b6cbdaee3c731ed1dc136064507fbfffe8a45879b0c4024a2b46d320875252f42af8dc268b30247ebb81a7a89b951e19a896bb415de38877c45b031e1081 mtd-utils-2.1.0.tar.gz 70013f50fad529e94733cd86349d4efe4d99c5febd7c407ab3db0c2995fd6be0524b3ebc59537ff13a4be9a8f63100468a9faa8590ea4d84f79995398b0fd7d9 0001-unittests-test_lib-Include-proper-header-for-_IOC_SI.patch eb6d72e2810218c90044f562ec2d58543f42066ca4719ec5c1199dfdebeacacbde931b59ad12a39df7834fb2b8cef240bed839840c11b3cac9761dd44e63bca8 0002-unittests-libmtd_test-Include-fcntl-header.patch e29c485a96b959c26f39a0a05a78e2a562f2bda0a2acc7ed532b6ebda46139f9e4c88b4df0f9dc13051dd5aa50ad60f82880f3da412b59d46fca527a88a30f5d 0003-unittests-Define-the-use-of-_GNU_SOURCE.patch"