From e5aa7ab72c4dd45e57a35ea3e8221bc79c73ba82 Mon Sep 17 00:00:00 2001 From: ItzYanick Date: Fri, 12 May 2023 18:55:42 +0200 Subject: [PATCH] first commit --- YAPMBUILD.toml | 23 +++++++++++++++++++++++ build.sh | 9 +++++++++ download.sh | 15 +++++++++++++++ install.sh | 21 +++++++++++++++++++++ prepare.sh | 7 +++++++ 5 files changed, 75 insertions(+) create mode 100644 YAPMBUILD.toml create mode 100755 build.sh create mode 100755 download.sh create mode 100755 install.sh create mode 100755 prepare.sh diff --git a/YAPMBUILD.toml b/YAPMBUILD.toml new file mode 100644 index 0000000..7006e0b --- /dev/null +++ b/YAPMBUILD.toml @@ -0,0 +1,23 @@ +[package] +name = "glibc" +description = "GNU C Library" +version = "2.37" +subversion = "1" +authors = ["GNU Project"] +packagers = ["ItzYanick"] + +[source] +script = "./download.sh" + +[prepare] +script = "./prepare.sh" + +[build] +script = "./build.sh" + +[install] +script = "./install.sh" + +[dependencies] + +[dependencies.build] \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..05d73fa --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +cd build + +echo "Building glibc..." +../glibc-$YAPM_PACKAGE_VERSION/configure --prefix=/usr --target=$YAPM_BUILD_TARGET +make -j$(nproc) diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..649f272 --- /dev/null +++ b/download.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +# check if downloaded file exists +if [ -f glibc-$YAPM_PACKAGE_VERSION.tar.gz ]; then + echo "glibc-$YAPM_PACKAGE_VERSION.tar.gz already exists. Skipping download." + exit 0 +fi + +echo "Downloading glibc source code..." +# download glibc source code +wget https://ftp.gnu.org/gnu/glibc/glibc-$YAPM_PACKAGE_VERSION.tar.gz -O glibc-$YAPM_PACKAGE_VERSION.tar.gz + +# ToDo: Verify checksum diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..43aa182 --- /dev/null +++ b/install.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +cd build + +echo "Installing glibc into install dir..." +make -j$(nproc) install DESTDIR=$YAPM_INSTALL_DIR + +# strip recursivly +strip -g $YAPM_INSTALL_DIR/bin/* \ + $YAPM_INSTALL_DIR/sbin/* \ + $YAPM_INSTALL_DIR/lib/* \ + $YAPM_INSTALL_DIR/lib64/* \ + $YAPM_INSTALL_DIR/usr/bin/* \ + $YAPM_INSTALL_DIR/usr/sbin/* \ + $YAPM_INSTALL_DIR/usr/lib/* \ + $YAPM_INSTALL_DIR/usr/lib64/* \ + $YAPM_INSTALL_DIR/usr/lib64/*/* \ + $YAPM_INSTALL_DIR/usr/libexec/* || + true diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..e76294f --- /dev/null +++ b/prepare.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +tar -xf glibc-$YAPM_PACKAGE_VERSION.tar.gz + +mkdir -p build