1 # See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
2 # for more information on packaging from GIT sources.
4 # Maintainer: Your Name <youremail@domain.com>
8 pkgdesc="A tool aimed at determining if a given software bug is exploitable"
10 url="http://www.pmcma.org"
12 makedepends=('git' 'cmake' 'flex')
14 _gitroot=https://github.com/toucan-system/pmcma
19 msg "Connecting to GIT server...."
21 if [[ -d "$_gitname" ]]; then
22 cd "$_gitname" && git pull origin
23 msg "The local files are updated."
25 git clone "$_gitroot" "$_gitname"
28 msg "GIT checkout done or server timeout"
29 msg "Starting build..."
31 rm -rf "$srcdir/$_gitname-build"
32 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
33 cd "$srcdir/$_gitname-build"
35 sed -i 's#cd beaengine/ && :>CMakeCache.txt && cmake . && make#$(shell cd beaengine/ \&\& :>CMakeCache.txt \&\& cmake . \&\& make)#' Makefile
36 sed -i 's#/usr/#$(DESTDIR)/usr/#g' Makefile
43 cd "$srcdir/$_gitname-build"
44 install -d -m 755 "$pkgdir/usr/bin"
45 install -d -m 755 "$pkgdir/usr/share/man/man1/"
46 make DESTDIR="$pkgdir/" install
48 cat > ${pkgdir}/usr/bin/gcore << 'EOF'
51 # Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010, 2011
52 # Free Software Foundation, Inc.
54 # This program is free software; you can redistribute it and/or modify
55 # it under the terms of the GNU General Public License as published by
56 # the Free Software Foundation; either version 3 of the License, or
57 # (at your option) any later version.
59 # This program is distributed in the hope that it will be useful,
60 # but WITHOUT ANY WARRANTY; without even the implied warranty of
61 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 # GNU General Public License for more details.
64 # You should have received a copy of the GNU General Public License
65 # along with this program. If not, see <http://www.gnu.org/licenses/>.
69 # Script to generate a core file of a running program.
70 # It starts up gdb, attaches to the given PID and invokes the gcore command.
75 echo "usage: gcore [-o filename] pid"
79 # Need to check for -o option, but set default basename to "core".
86 # Not enough arguments.
87 echo "usage: gcore [-o filename] pid"
92 # Shift over to start of pid list
96 # Initialise return code.
102 # `</dev/null' to avoid touching interactive terminal if it is
103 # available but not accessible as GDB would get stopped on SIGTTIN.
104 gdb </dev/null --nx --batch \
105 -ex "set pagination off" -ex "set height 0" -ex "set width 0" \
106 -ex "attach $pid" -ex "gcore $name.$pid" -ex detach -ex quit
108 if [ -r $name.$pid ] ; then
111 echo gcore: failed to create $name.$pid
122 chmod +x ${pkgdir}/usr/bin/gcore
125 # vim:set ts=2 sw=2 et: