From 4ef0931782e0176b2fadd7259016003026d7f3f5 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 9 May 2026 13:51:13 +0300 Subject: [PATCH] Build entire elfutils repository --- pkg.info | 40 +++++++++++++++++++++++++++++++++------- source.sh | 47 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 71 insertions(+), 16 deletions(-) diff --git a/pkg.info b/pkg.info index 7b811cd..64790ec 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ -name: libelf -description: ELF handling library +name: elfutils +description: Handle ELF object files and DWARF debugging information (Utilities) version: "0.195" -revision: 1 +revision: 2 url: https://sourceware.org/elfutils/ license: GPL2-or-later OR LGPL3-or-later maintainers: @@ -9,18 +9,44 @@ maintainers: architecture: any type: source depends: + - gcc-libs + - glibc + - libarchive + - libelf=0.195 + - sh +make_depends: - bzip2 - curl - - glibc - json-c + - libarchive + - sqlite - xz-utils - zlib - zstd -make_depends: - - libarchive - - sqlite downloads: - url: https://sourceware.org/ftp/elfutils/${BPM_PKG_VERSION}/elfutils-${BPM_PKG_VERSION}.tar.bz2 extract_to: ${BPM_SOURCE} extract_strip_components: 1 checksum: 37629fdf7f1f3dc2818e138fca2b8094177d6c2d0f701d3bb650a561218dc026 +split_packages: + - name: elfutils + - name: libelf + description: Handle ELF object files and DWARF debugging information (Libraries) + depends: + - bzip2 + - curl + - glibc + - json-c + - xz-utils + - zlib + - zstd + - name: debuginfod + description: Handle ELF object files and DWARF debugging information (Debuginfod) + depends: + - gcc-libs + - glibc + - json-c + - libarchive + - libelf=0.195 + - sqlite + - xz-utils diff --git a/source.sh b/source.sh index c3b1387..8ff1d84 100644 --- a/source.sh +++ b/source.sh @@ -17,8 +17,8 @@ build() { export CFLAGS="${CFLAGS} -ffat-lto-objects -g" ./configure --prefix=/usr \ - --disable-debuginfod \ - --enable-libdebuginfod=dummy \ + --sysconfdir=/etc \ + --program-prefix="eu-" \ --enable-deterministic-archives \ --enable-maintainer-mode make @@ -31,16 +31,45 @@ check() { make check } +_pick() { + local p="$1" f d; shift + for f; do + [ -d "$BPM_WORKDIR"/output_"$p" ] || { echo "Split package $p not found"; exit 1; } + d="$BPM_WORKDIR"/output_"$p"/"${f#$BPM_OUTPUT}" + mkdir -p "$(dirname "$d")" + mv "$f" "$d" + rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" + done +} + # The package function is executed in the source directory # This function is used to move the compiled files into the output directory -package() { - make -C libelf DESTDIR="$BPM_OUTPUT" install +package_elfutils() { + make DESTDIR="$BPM_OUTPUT" install - # Install pkgconfig file - install -Dm644 config/libelf.pc "$BPM_OUTPUT"/usr/lib/pkgconfig/libelf.pc + cd "$BPM_OUTPUT" + + # Move libelf files into split package + _pick libelf etc/debuginfod + _pick libelf etc/profile.d/* + _pick libelf usr/{include,lib} + _pick libelf usr/share/man/*/{,lib}elf* + + # Move debuginfod files into split package + _pick debuginfod usr/bin/debuginfod* + _pick debuginfod usr/share/fish/vendor_conf.d/debuginfod.fish + _pick debuginfod usr/share/man/*/debuginfod* # Install package licenses - install -Dm644 "$BPM_SOURCE"/COPYING-GPLV2 "$BPM_OUTPUT"/usr/share/licenses/libelf/COPYING-GPLV2 - install -Dm644 "$BPM_SOURCE"/COPYING-LGPLV3 "$BPM_OUTPUT"/usr/share/licenses/libelf/COPYING-LGPLV3 - install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/libelf/COPYING + install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/elfutils +} + +package_libelf() { + # Install package licenses + install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/libelf +} + +package_debuginfod() { + # Install package licenses + install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/debuginfod }