db-move: moved linux-zen from [testing] to [extra] (x86_64)
[arch-packages.git] / elfutils / trunk / PKGBUILD
blobdb83f5d5237a79d4451bc72331b1d462eaba7729
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Laurent Carlier <lordheavym@gmail.com>
3 # Contributor: Stéphane Gaudreault <stephane@archlinux.org>
4 # Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>
6 pkgbase=elfutils
7 pkgname=(debuginfod elfutils libelf)
8 pkgver=0.189
9 pkgrel=1
10 pkgdesc="Handle ELF object files and DWARF debugging information"
11 arch=(x86_64)
12 url="https://sourceware.org/elfutils/"
13 license=(LGPL3 GPL3)
14 makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
15 options=(staticlibs)
16 source=(https://sourceware.org/$pkgbase/ftp/$pkgver/$pkgbase-$pkgver.tar.bz2{,.sig})
17 sha512sums=('93a877e34db93e5498581d0ab2d702b08c0d87e4cafd9cec9d6636dfa85a168095c305c11583a5b0fb79374dd93bc8d0e9ce6016e6c172764bcea12861605b71'
18             'SKIP')
19 b2sums=('30596271e14cf3408326abc38a9775b849b8cb0ee119a5455df9434a7d3b9a57afb15e0236a179a26c7bd400d303749964c9d6350c419f747784fd99d12517e0'
20         'SKIP')
21 validpgpkeys=(
22   '47CC0331081B8BC6D0FD4DA08370665B57816A6A'  # Mark J. Wielaard <mark@klomp.org>
23   'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A'  # Mark Wielaard <mjw@gnu.org>
26 _pick() {
27   local p="$1" f d; shift
28   for f; do
29     d="$srcdir/$p/${f#$pkgdir/}"
30     mkdir -p "$(dirname "$d")"
31     mv "$f" "$d"
32     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
33   done
36 prepare() {
37   # remove failing test due to missing glibc debug package during test: https://bugs.archlinux.org/task/74875
38   sed -e 's/run-backtrace-native.sh//g' -i $pkgbase-$pkgver/tests/Makefile.am
39   (
40     cd $pkgbase-$pkgver
41     autoreconf -fiv
42   )
44   cp -av $pkgbase-$pkgver $pkgbase-test-$pkgver
48 build() {
49   local configure_options=(
50     --prefix=/usr
51     --sysconfdir=/etc
52     --program-prefix="eu-"
53     --enable-deterministic-archives
54   )
56   (
57     # fat-lto-objects is required for non-mangled .a files in libelf
58     CFLAGS+=" -ffat-lto-objects"
59     cd $pkgbase-$pkgver
60     ./configure "${configure_options[@]}"
61     make
62   )
63   (
64     cd $pkgbase-test-$pkgver
65     # debugging information is required for test-suite
66     CFLAGS+=" -g"
67     # fat-lto-objects is required for non-mangled .a files in libelf
68     CFLAGS+=" -ffat-lto-objects"
69     ./configure "${configure_options[@]}"
70     make
71   )
74 check() {
75   make check -C $pkgbase-test-$pkgver
78 package_debuginfod() {
79   pkgdesc+=" (debuginfod)"
80   depends=(
81     gcc-libs
82     glibc
83     libarchive libarchive.so
84     libelf=$pkgver
85     libmicrohttpd libmicrohttpd.so
86     sqlite libsqlite3.so
87   )
88   optdepends=("elfutils=$pkgver: for translations")
90   make DESTDIR="$pkgdir" install -C $pkgbase-$pkgver
91   install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
93   # set the default DEBUGINFOD_URLS environment variable to the distribution's debuginfod URL
94   printf "https://debuginfod.archlinux.org\n" > "$pkgdir/etc/debuginfod/archlinux.urls"
96   (
97     cd "$pkgdir"
99     _pick libelf etc/debuginfod/*
100     _pick libelf etc/profile.d/*
101     _pick libelf usr/{include,lib}
102     _pick elfutils usr/bin/eu-*
103     _pick elfutils usr/share/locale
104     _pick elfutils usr/share/man/man1/eu-*
105     _pick elfutils usr/share/man/man3/elf_*
106   )
110 package_elfutils() {
111   pkgdesc+=" (utilities)"
112   depends=(gcc-libs glibc libelf=$pkgver)
114   mv -v elfutils/* "$pkgdir"
115   install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
118 package_libelf() {
119   pkgdesc+=" (libraries)"
120   depends=(
121     bzip2 libbz2.so
122     curl libcurl.so
123     gcc-libs
124     glibc
125     xz liblzma.so
126     zlib
127     zstd libzstd.so
128   )
129   # NOTE: the shared objects can not be added to provides as they are not versioned
131   mv -v libelf/* "$pkgdir"
132   install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"