add packaging
[platform/upstream/ltrace.git] / packaging / ltrace.spec
1 #
2 # spec file for package ltrace
3 #
4 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
16 #
17
18
19 Name:           ltrace
20 BuildRequires:  binutils-devel
21 BuildRequires:  dejagnu
22 BuildRequires:  gcc-c++
23 BuildRequires:  libelf-devel
24 Url:            http://ltrace.org/
25 # bug437293
26 %ifarch ppc64
27 Obsoletes:      ltrace-64bit
28 %endif
29 #
30 Summary:        Trace the Library and System Calls a Program Makes
31 License:        GPL-2.0+
32 Group:          Development/Tools/Debuggers
33 Version:        0.5.3
34 Release:        0
35 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
36 ExclusiveArch:  %ix86 s390 s390x ppc ppc64 armv4l x86_64 alpha ia64
37 Prefix:         /usr
38 Source:         ltrace-%{version}.tar.bz2
39 Source2:        baselibs.conf
40 Patch1:         ltrace.s390-more-arguments.patch
41 Patch2:         ltrace.demangle-lib.cstdlib.patch
42 Patch3:         ltrace.ppc.patch
43
44 %description
45 Ltrace is a program that runs the specified command until it exits. It
46 intercepts and records the dynamic library calls that are called by the
47 executed process and the signals that are received by that process. It
48 can also intercept and print the system calls executed by the program.
49
50 The program to trace need not be recompiled for this, so you can use
51 ltrace on binaries for which you do not have access to the source.
52
53 This is still a work in progress, so, for example, the tracking to
54 child processes may fail or some things may not work as expected.
55
56
57
58 Authors:
59 --------
60     Juan Cespedes
61
62 %prep
63 %setup -q
64 %patch1 -p1
65 %patch2 -p1
66 %patch3 -p1
67
68 %build
69 export CFLAGS="%{optflags} -W -Wall"
70 ./configure --prefix=/usr \
71             --sysconfdir=/etc \
72             --mandir=%{_mandir} \
73 %ifarch armv4l
74             --build=arm-suse-linux
75 %else
76             --build=%{_target_cpu}-suse-linux
77 %endif
78 make
79 %if 1
80 if make check
81 then
82         echo 'no make check errors' > testresults.txt
83 else
84         for file in `find testsuite -name "*.ltrace"`
85         do
86                 echo
87                 echo $file
88                 echo
89                 cat $file
90                 echo
91         done >> testresults.txt
92 fi
93 mv testresults.txt %{_target_cpu}-testresults.txt
94 ln testsuite/testrun.sum testsuite/%{_target_cpu}-testrun.sum
95 %else
96 echo no make check > %{_target_cpu}-testresults.txt
97 echo no make check > testsuite/%{_target_cpu}-testrun.sum
98 %endif
99
100 %install
101 make install DESTDIR=%{buildroot}
102 rm -rf %{buildroot}/usr/share/doc/ltrace
103
104 %files
105 %defattr(-,root,root)
106 %doc COPYING README ChangeLog %{_target_cpu}-testresults.txt testsuite/%{_target_cpu}-testrun.sum
107 %{_bindir}/ltrace
108 %{_mandir}/man1/ltrace.1.gz
109 %config /etc/ltrace.conf
110
111 %changelog