-
Notifications
You must be signed in to change notification settings - Fork 3
/
exmap.spec
205 lines (152 loc) · 6.2 KB
/
exmap.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# This spec violates Fedora packaging guidelines.
# Specifically, packages must not contain add-on kernel modules (kmod-*);
# kernel modules should be submitted upstream.
# For details, see:
# http://fedoraproject.org/wiki/Packaging/Guidelines#No_External_Kernel_Modules
#
# Nevertheless, this spec build two packages:
# exmap (base userland)
# exmap-kmod (kernel module)
#
# The kmod subpackage is based on tips found at:
# http://fedoraproject.org/wiki/Obsolete/KernelModules
#
# Use global instead of define for scoping as recommended at:
# http://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
BuildRequires: pcre-devel
BuildRequires: boost-devel
BuildRequires: gtkmm24-devel
BuildRequires: asciidoc
# redhat-rpm-config provides /usr/lib/rpm/redhat/kmodtool
BuildRequires: redhat-rpm-config
buildrequires: kernel-devel
%global kmod_name exmap
# define the full path to kmodtool
%global kmodtool /usr/lib/rpm/redhat/kmodtool
# get the kernel version , but strip off the machine arch to
# avoid hard-coding the kernel version
%global dotvariant .%(uname -m 2> /dev/null)
%global my_verrel %(%{kmodtool} verrel | sed "s/\.$(uname -m)//" 2> /dev/null)
# The upstream git repo at http://github.com/jbert/exmap
# provides tags for intermediate releases,
# such as exmap-0.11-pre0
# To see the tags, use `git tag'.
# If you want to build an intermediate release,
# modify upstream_tag in the following definition.
# If not using a pre-release, just comment-out the next global.
%global upstream_tag .pre0
# ----------- base userland package ----------------
Name: exmap
Summary: see how much memory is in use by different processes
Version: 0.11
Release: 5%{?dist}%{?upstream_tag}
Group: Applications/Engineering
License: GPLv2
# NOTE: exmap downloads has not been updated since 28-Sep-2006
#URL: http://www.berthels.co.uk/exmap
# NOTE: original author is now on github
URL: http://github.com/jbert/exmap
Source0: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: pcre
Requires: boost
Requires: %{kmod_name}-kmod >= %{?epoch:%{epoch}:}%{version}-%{release}
%description
Exmap is a tool which allows you to see how much memory is in
use by different processes, mapped files, ELF sections and ELF
symbols at a given moment in time.
It accounts for shared memory in the following way: when a page
of memory is found to be shared between N processes, the totals
for each process are given a 1/N share of that page.
Exmap doesn't allow you to see details on how and where memory on
the heap is allocated. Tools such as valgrind/massif and memprof
are more useful in this case.
%prep
%setup -q
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README
%doc COPYING
%doc TODO
%doc README.fedora
%doc doc.asciidoc
%doc FAQ.asciidoc
%doc screenshot-processes.png
%doc screenshot-files.png
%{_bindir}/elftool
# ----------- GUI subpackage ----------------
%package gnome
Summary: GUI tool to see how much memory is in use by different processes
Requires: exmap = %{version}-%{release}
Requires: gtkmm24
%description gnome
Provides the graphical version of exmap.
Exmap is a tool which allows you to see how much memory is in
use by different processes, mapped files, ELF sections and ELF
symbols at a given moment in time.
It accounts for shared memory in the following way: when a page
of memory is found to be shared between N processes, the totals
for each process are given a 1/N share of that page.
Exmap doesn't allow you to see details on how and where memory on
the heap is allocated. Tools such as valgrind/massif and memprof
are more useful in this case.
%files gnome
%defattr(-,root,root,-)
%{_bindir}/gexmap
%doc doc.html
%doc FAQ.html
%doc screenshot-processes.png
%doc screenshot-files.png
# ----------- kmod subpackage ----------------
%package -n kmod-%{kmod_name}
Summary: %{kmod_name} kernel module(s)
Group: System Environment/Kernel
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i586 i686 x86_64 ppc ppc64
Provides: %{kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: kernel = %{my_verrel}
# module-init-tools provides /sbin/depmod
Requires(post): module-init-tools
Requires(postun): module-init-tools
%description -n kmod-%{kmod_name}
This package provides the %{kmod_name} kernel module built for the Linux
kernel %{my_verrel}%{?dotvariant}.
Exmap is a tool which allows you to see how much memory is in
use by different processes, mapped files, ELF sections and ELF
symbols at a given moment in time.
%post -n kmod-%{kmod_name}
/sbin/depmod -aeF /boot/System.map-%{my_verrel}%{?dotvariant} %{my_verrel}%{?dotvariant} &> /dev/null || :
%postun -n kmod-%{kmod_name}
/sbin/depmod -aF /boot/System.map-%{my_verrel}%{?dotvariant} %{my_verrel}%{?dotvariant} &> /dev/null || :
%files -n kmod-%{kmod_name}
%defattr(644,root,root,755)
/lib/modules/%{my_verrel}%{?dotvariant}/extra/%{kmod_name}/
# ------------- build files for both packages -------------
%build
make %{?_smp_mflags}
make docs
# ------------- install files for both packages -------------
%install
%{__rm} -rf %{buildroot}
# userland
%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -pm 755 src/gexmap %{buildroot}%{_bindir}
%{__install} -pm 755 src/elftool %{buildroot}%{_bindir}
# kmod
%{__mkdir_p} %{buildroot}/lib/modules/%{my_verrel}%{?dotvariant}/extra/%{kmod_name}
%{__install} -pm 755 kernel/%{kmod_name}.ko %{buildroot}/lib/modules/%{my_verrel}%{?dotvariant}/extra/%{kmod_name}
%changelog
* Sun Oct 17 2010 Paul Morgan <[email protected]> 0.11-5.pre0
- move screenshots to base directory ([email protected])
- better split of docs between pkgs ([email protected])
- split userland tool into 2 packages, base and -gnome ([email protected])
* Sun Oct 17 2010 Paul Morgan <[email protected]> 0.11-4.pre0
- add elftool userland tool to package ([email protected])
* Sun Oct 17 2010 Paul Morgan <[email protected]> 0.11-3.pre0
- build requires asciidoc ([email protected])
* Sun Oct 17 2010 Paul Morgan <[email protected]> 0.11-2.pre0
- add README.fedora with build instructions ([email protected])
* Sun Oct 17 2010 Paul Morgan <[email protected]> 0.11-1.pre0
- new package built with tito