1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-20 12:36:14 +02:00
build/pkg/openrc/build
David Oberhollenzer 525b36aa89 Cleanup deploy/devdeploy split
- Don't duplicate shared objects, use the ones from the deploy
   directory when building dependend packages
 - Add helper function for moving headers, static libraries
   and pkgconfig data to devdeploy directory

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-02-10 19:59:51 +01:00

81 lines
1.9 KiB
Plaintext
Executable file

VERSION="0.34.11"
SRCDIR="openrc-${VERSION}"
TARBALL="${VERSION}.tar.gz"
URL="https://github.com/OpenRC/openrc/archive"
SHA256SUM="4e7b7510c363e99622400feba4b009ec0e0b57dbb99fd4cc678a7b5d2036e00a"
DEPENDS="ncurses"
prepare() {
return
}
build() {
local SOURCE="$1"
local BUILD="$2"
local DEPLOY="$3"
cp -R ${SOURCE}/* ${BUILD}
apply_patches
make CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \
LD=${TARGET}-ld LIBTERMCAP="-lncursesw" \
SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" \
MKNET=no MKSELINUX=no MKSTATICLIBS=no MKSYSVINIT=yes \
MKTERMCAP=ncurses UPREFIX="" \
-j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local BUILD="$2"
local DEPLOY="$3"
local DEVDEPLOY="$4"
make SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" UPREFIX="" \
install
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
rm -r ${DEPLOY}/share
rm -r ${DEPLOY}/etc
for i in ${DEPLOY}/bin/*; do
if [ -f $i ]; then
${TARGET}-strip --discard-all $i
fi
done
for i in $(find "$DEPLOY/libexec/rc/bin" -type f -print | \
xargs file | grep ELF | cut -d: -f1); do
${TARGET}-strip --discard-all $i
done
for i in $(find "$DEPLOY/libexec/rc/sbin" -type f -print | \
xargs file | grep ELF | cut -d: -f1); do
${TARGET}-strip --discard-all $i
done
mkdir -p ${DEPLOY}/etc/{conf.d,init.d,runlevels,sysctl.d}
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}
cp -R "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY"
source "$SCRIPTDIR/board/$BOARD/INIT"
for i in $GETTY_TTY; do
cat > "$DEPLOY/etc/conf.d/agetty.$i" << _EOF
#quiet="yes"
#baud="38400"
term_type="linux"
#agetty_options=""
_EOF
ln -s "/etc/init.d/agetty" "$DEPLOY/etc/init.d/agetty.$i"
ln -s "/etc/init.d/agetty.$i" "$DEPLOY/etc/runlevels/default/agetty.$i"
done
unset -v i GETTY_TTY
}