aboutsummaryrefslogtreecommitdiffstats
path: root/community/mtd-utils/APKBUILD
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2019-04-16 10:43:33 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2019-04-19 20:59:00 +0000
commitfff74d81199e72bb8f4d95c14df42b3e7b3571c5 (patch)
tree3d973268f7b0b94d58b8e902ad71093a9977e9b4 /community/mtd-utils/APKBUILD
parentc520aa0a98e78909ccd6a47801055e25358494c8 (diff)
community/mtd-utils: Split into smaller subpackages
To stay in the alpine spirit, split mtd-utils into smaller targetted packages. E.g. if I have raw NAND flash, I don't care about the NOR tools. And depending on the filesystem, I may not care about ubi. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'community/mtd-utils/APKBUILD')
-rw-r--r--community/mtd-utils/APKBUILD78
1 files changed, 76 insertions, 2 deletions
diff --git a/community/mtd-utils/APKBUILD b/community/mtd-utils/APKBUILD
index 7aff888fe7c..822019d1c11 100644
--- a/community/mtd-utils/APKBUILD
+++ b/community/mtd-utils/APKBUILD
@@ -4,7 +4,7 @@ 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="all"
+arch="noarch"
license="GPL-2.0-only"
makedepends="
acl-dev
@@ -18,7 +18,15 @@ makedepends="
util-linux-dev
zlib-dev
"
-subpackages="${pkgname}-doc"
+_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
@@ -47,8 +55,74 @@ check()
make check
}
+flash()
+{
+ pkgdesc="MTD utils (flash commands)"
+
+ mkdir -p "${subpkgdir}/usr/sbin"
+ find "${pkgdir}/usr/sbin/" -type f \( \
+ -iname '*flash*' \)\
+ -exec mv "{}" "${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 "{}" "${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 "{}" "${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 "{}" "${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 "{}" "${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 "{}" "${subpkgdir}/usr/sbin/" +
+}
+
package()
{
+ depends="${_subpackages}"
+
make DESTDIR="${pkgdir}" install
}