]>
Commit | Line | Data |
---|---|---|
baf61606 | 1 | # |
d13e2951 | 2 | # Conditional build: |
3 | %bcond_without dist_kernel # allow non-distribution kernel | |
4 | %bcond_without kernel # don't build kernel modules | |
d13e2951 | 5 | %bcond_without userspace # don't build userspace programs |
6 | %bcond_with verbose # verbose build (V=1) | |
7 | ||
8 | %if %{without kernel} | |
9 | %undefine with_dist_kernel | |
10 | %endif | |
11 | ||
8a721a51 | 12 | %define _rel 1 |
d13e2951 | 13 | Summary: Determine how much physical memory and swap is used by individual processes |
037cd5a1 | 14 | Summary(pl.UTF-8): Narzędzie do analizowania zużycia pamięci fizycznej i wymiany przez poszczególne procesy |
d13e2951 | 15 | Name: exmap |
16 | Version: 0.10 | |
17 | Release: %{_rel} | |
18 | Epoch: 0 | |
19 | License: GPL v2 | |
20 | Group: Applications/System | |
21 | Source0: http://www.berthels.co.uk/exmap/download/%{name}-%{version}.tgz | |
22 | # Source0-md5: b4f87fa02f6a218416b77ad4b9f48d74 | |
23 | Patch0: %{name}-Makefile.patch | |
50b96cee | 24 | Patch1: %{name}-vserver.patch |
d13e2951 | 25 | URL: http://www.berthels.co.uk/exmap/ |
26 | %if %{with kernel} | |
27 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.14} | |
28 | BuildRequires: rpmbuild(macros) >= 1.330 | |
29 | %endif | |
50b96cee | 30 | %if %{with userspace} |
31 | BuildRequires: boost-devel | |
e785eebb | 32 | BuildRequires: gtkmm-devel |
33 | BuildRequires: libstdc++-devel >= 4.1.1 | |
50b96cee | 34 | BuildRequires: pcre-devel |
35 | %endif | |
d13e2951 | 36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | Exmap is a tool which allows the real memory usage of a collection of | |
40 | processes to be examined. A linux kernel loadable module is used to | |
baf61606 | 41 | export information to userspace, which is examined by a GTK+ |
d13e2951 | 42 | application to build a picture of how pages are shared amongst |
43 | processes and their shared libraries. | |
44 | ||
7558bb7e JR |
45 | %description -l pl.UTF-8 |
46 | Exmap jest narzędziem pozwalającym badać realne użycie pamięci przez | |
47 | zbiór procesów. Moduł kernela jest używany do eksportowania | |
48 | informacji do przestrzeni użytkownika, które są analizowane przez | |
baf61606 | 49 | aplikację GTK+ do zobrazowania jak wiele stron jest współdzielonych |
7558bb7e | 50 | między procesami i ich bibliotekami dzielonymi. |
d13e2951 | 51 | |
52 | # kernel subpackages. | |
53 | ||
54 | %package -n kernel%{_alt_kernel}-misc-exmap | |
55 | Summary: Linux driver for exmap | |
037cd5a1 | 56 | Summary(pl.UTF-8): Sterownik dla Linuksa do exmap |
d13e2951 | 57 | Release: %{_rel}@%{_kernel_ver_str} |
58 | Group: Base/Kernel | |
59 | Requires(post,postun): /sbin/depmod | |
60 | %if %{with dist_kernel} | |
98a8bca4 AM |
61 | %requires_releq_kernel |
62 | Requires(postun): %releq_kernel | |
d13e2951 | 63 | %endif |
64 | ||
65 | %description -n kernel%{_alt_kernel}-misc-exmap | |
66 | This is driver for exmap for Linux. | |
67 | ||
68 | This package contains Linux module. | |
69 | ||
7558bb7e | 70 | %description -n kernel%{_alt_kernel}-misc-exmap -l pl.UTF-8 |
d13e2951 | 71 | Sterownik dla Linuksa do exmap. |
72 | ||
7558bb7e | 73 | Ten pakiet zawiera moduł jądra Linuksa. |
d13e2951 | 74 | |
d13e2951 | 75 | %prep |
76 | %setup -q | |
77 | %patch0 -p1 | |
50b96cee | 78 | %patch1 -p1 |
d13e2951 | 79 | # remove binaries packed in src tarball |
80 | rm -f src/{*.so,munged-ls-threeloads,prelinked-amule} | |
81 | ||
82 | # prepare makefile: | |
83 | cat > kernel/Makefile << EOF | |
84 | obj-m += exmap.o | |
85 | CFLAGS += -DCONFIG_exmap_SOME_OPTION=1 | |
86 | %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1} | |
87 | EOF | |
88 | ||
89 | %build | |
90 | %if %{with userspace} | |
91 | %{__make} \ | |
92 | CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}" | |
93 | ||
94 | %endif | |
95 | ||
96 | %if %{with kernel} | |
97 | %build_kernel_modules -C kernel -m exmap | |
98 | %endif | |
99 | ||
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %if %{with userspace} | |
104 | install -d $RPM_BUILD_ROOT%{_bindir} | |
105 | install src/gexmap $RPM_BUILD_ROOT%{_bindir} | |
106 | %endif | |
107 | ||
108 | %if %{with kernel} | |
109 | %install_kernel_modules -m kernel/exmap -d misc | |
110 | ||
111 | # to avoid conflict with in-kernel modules, and prepare modprobe config: | |
112 | #%%install_kernel_modules -s current -n NAME -m exmap -d misc | |
113 | %endif | |
114 | ||
115 | %clean | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %post -n kernel%{_alt_kernel}-misc-exmap | |
119 | %depmod %{_kernel_ver} | |
120 | ||
121 | %postun -n kernel%{_alt_kernel}-misc-exmap | |
122 | %depmod %{_kernel_ver} | |
123 | ||
d13e2951 | 124 | %if %{with kernel} |
d13e2951 | 125 | %files -n kernel%{_alt_kernel}-misc-exmap |
126 | %defattr(644,root,root,755) | |
127 | /lib/modules/%{_kernel_ver}/misc/*.ko* | |
128 | %endif | |
129 | ||
d13e2951 | 130 | |
131 | %if %{with userspace} | |
132 | %files | |
8cbf44b1 | 133 | %defattr(644,root,root,755) |
d13e2951 | 134 | %doc README TODO |
8cbf44b1 | 135 | %attr(755,root,root) %{_bindir}/* |
d13e2951 | 136 | %endif |