1 #Maintainer: Jens Staal <staal1978@gmail.com>
3 pkgname="gnu2busybox-coreutils"
6 pkgdesc="Replacing the GNU coreutils with the corresponding commands from Busybox"
8 url="https://wiki.archlinux.org/index.php/Base2busybox"
11 optdepends=('perl-digest-sha')
12 provides=('coreutils')
13 conflicts=('coreutils')
14 source=('scripts.tar.gz')
15 md5sums=('7d580744d46ebf6956898e7ea7812e85')
17 _bin=($srcdir/scripts/coreutils.bin.ls)
18 _usrbin=($srcdir/scripts/coreutils.usr.bin.ls)
19 _usrsbin=($srcdir/scripts/coreutils.usr.sbin.ls)
22 msg "WARNING: this is an experimental package. Do not install on production systems"
23 msg "There may be corner cases where the system expect stuff specific for GNU coreutils"
24 msg "A list of files not provided by busybox is saved in text format in /usr/share/info"
26 msg "creating package directories"
29 mkdir "$pkgdir/usr/bin"
30 mkdir "$pkgdir/usr/sbin"
32 mkdir "$pkgdir/usr/share"
33 mkdir "$pkgdir/usr/share/man"
34 mkdir "$pkgdir/usr/share/man/man1"
35 mkdir "$pkgdir/usr/share/info"
37 msg "creating symlinks for /bin"
42 ln -s /bin/busybox $pkgdir/bin/$i
48 # msg "copying script files for /bin"
49 # cp $srcdir/scripts/bin/* $pkgdir/bin/
51 msg "ceating symlinks for /usr/bin"
54 for i in $(cat $_usrbin)
56 ln -s /bin/busybox $pkgdir/usr/bin/$i
61 msg "copying script files for /usr/bin"
62 cp $srcdir/scripts/usrbin/* $pkgdir/usr/bin/
64 msg "creating symlinks for /usr/sbin"
67 for i in $(cat $_usrsbin)
69 ln -s /bin/busybox $pkgdir/usr/sbin/$i
72 msg "adding corresponding coreutils-dependent settings files"
73 # Do we need to add more privilige rules in this file to get a secure system?
74 cp $srcdir/scripts/busybox.conf $pkgdir/etc/busybox.conf
76 # /usr/lib/libstdbuf.so is not needed since busybox does not provide stdbuf
77 # alternative solutions welcome
80 # todo: setting up locale support for busybox. Not in stock package - can it be added?
82 msg "setting up manpage entries"
83 #future improvement: to get the symlink to jumt to the relevant part of the busybox man
85 cd $pkgdir/usr/share/man/man1
88 echo "Busybox symlink. For help, type: busybox $i --help" > $i.1
94 for i in $(cat $_usrbin)
96 echo "Busybox symlink. For help, type: busybox $i --help" > $i.1
101 for i in $(cat $_usrsbin)
103 echo "Busybox symlink. For help, type: busybox $i --help" > $i.1
106 _shavariants=($srcdir/scripts/shavariants)
107 for i in $(cat $_shavariants)
109 ln -s /usr/share/man/man1/shasum.1p.gz sha${i}sum.1
112 msg "Warning: $(cat $srcdir/scripts/coreutils.gnuonly.ls)"
113 msg "copying list of files not provided by busybox to /usr/share/info"
114 cp $srcdir/scripts/coreutils.gnuonly.ls $pkgdir/usr/share/info/