1 # Build recipe for valgrind.
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 tarname=${program}-${version}.tar.bz2
25 fetch=ftp://sourceware.org/pub/valgrind/$tarname
28 Generic framework for creating dynamic analysis tools.
30 Valgrind is an instrumentation framework for building dynamic analysis tools.
31 There are Valgrind tools that can automatically detect many memory management
32 and threading bugs, and profile your programs in detail. You can also use
33 Valgrind to build new tools.
36 homepage=http://valgrind.org/
39 # Source documentation
40 docs="AUTHORS COPYING* FAQ.txt NEWS* README*"
41 docsdir="${docdir}/${program}-${version}"
47 unpack "${tardir}/$tarname"
51 # Set installation for documentation directory
52 patch -p0 < "${worktree}/patches/valgrind/valgrind-docdir.patch"
54 # We don't pass any C flags in order to preserve all the debugging
55 # information as suggested in README_PACKAGERS
57 ./configure $configure_args \
58 --libdir=/usr/lib${libSuffix} \
62 --build="$(cc -dumpmachine)" \
68 make -j${jobs} DESTDIR="$destdir" install-strip
70 # Remove valgrind manual in order to reduce the package size
71 # considerably, we already provide the manual in HTML format
72 rm -f "${destdir}${docsdir}"/*.pdf "${destdir}${docsdir}"/*.ps
74 # Compress info documents deleting index file for the package
75 if test -d "${destdir}/$infodir"
77 rm -f "${destdir}/${infodir}/dir"
78 lzip -9 "${destdir}/${infodir}"/*
81 # Compress and link man pages (if needed)
82 if test -d "${destdir}/$mandir"
85 cd "${destdir}/$mandir"
86 find . -type f -exec lzip -9 '{}' +
87 find . -type l | while read -r file
89 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
96 mkdir -p "${destdir}${docsdir}"
102 cp -p $file "${destdir}${docsdir}"