Files
binary-repo/sys/base/busybox/ympbuild
T
2024-11-10 09:05:50 +00:00

65 lines
1.8 KiB
Bash

#!/bin/bash
name=busybox
version=1.37.0
release=3
url='https://busybox.net'
description='BusyBox is a software suite that provides several Unix utilities in a single executable file.'
email='parduscix@yandex.ru'
maintainer='sulincix'
license=('GPLv3')
arch=(x86_64)
group=(sys.base)
makedepends=(musl)
source=("https://busybox.net/downloads/busybox-$version.tar.bz2"
"files/busybox.sysconf"
"files/busybox.initramfs"
"files/udhcpc.openrc"
"files/udhcpc.script"
"data-user.patch"
"busybox-1.36.1-kernel-6.8.patch"
)
sha256sums=("3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4"
"SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP"
)
export PATH=$PATH:/usr/bin/core_perl
cd $name-$version
prepare(){
for tool in ar strip ; do
ln -s /usr/bin/$tool ../musl-$tool
done
patch -Np1 -i ../data-user.patch
patch -Np1 -i ../busybox-1.36.1-kernel-6.8.patch
}
setup(){
make defconfig
sed -i "s|.*CONFIG_STATIC_LIBGCC .*|CONFIG_STATIC_LIBGCC=y|" .config
sed -i "s|.*CONFIG_STATIC .*|CONFIG_STATIC=y|" .config
echo 'CONFIG_CROSS_COMPILER_PREFIX="musl-"' >> .config
}
build(){
make $jobs
}
package(){
mkdir -p ${DESTDIR}/bin/ ${DESTDIR}/etc/sysconf.d ${DESTDIR}/usr/share/initramfs-tools/{hooks,conf-hooks.d}/
install busybox ${DESTDIR}/bin/busybox
install ../busybox.sysconf ${DESTDIR}/etc/sysconf.d/busybox
install ../busybox.initramfs ${DESTDIR}/usr/share/initramfs-tools/hooks/zz-busybox
echo "BUSYBOXDIR=/bin" > ${DESTDIR}/usr/share/initramfs-tools/conf-hooks.d/busybox
# install udhcpc script and service
mkdir -p ${DESTDIR}/usr/share/udhcpc/ ${DESTDIR}/etc/init.d/
install ../udhcpc.script ${DESTDIR}/usr/share/udhcpc/default.script
install ../udhcpc.openrc ${DESTDIR}/etc/init.d/udhcpc
}