3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without userspace # don't build userspace programs
6 %bcond_with verbose # verbose build (V=1)
9 %undefine with_dist_kernel
13 Summary: Determine how much physical memory and swap is used by individual processes
14 Summary(pl.UTF-8): Narzędzie do analizowania zużycia pamięci fizycznej i wymiany przez poszczególne procesy
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
24 Patch1: %{name}-vserver.patch
25 URL: http://www.berthels.co.uk/exmap/
27 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.14}
28 BuildRequires: rpmbuild(macros) >= 1.330
31 BuildRequires: boost-devel
32 BuildRequires: gtkmm-devel
33 BuildRequires: libstdc++-devel >= 4.1.1
34 BuildRequires: pcre-devel
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
41 export information to userspace, which is examined by a GTK+
42 application to build a picture of how pages are shared amongst
43 processes and their shared libraries.
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
49 aplikację GTK+ do zobrazowania jak wiele stron jest współdzielonych
50 między procesami i ich bibliotekami dzielonymi.
54 %package -n kernel%{_alt_kernel}-misc-exmap
55 Summary: Linux driver for exmap
56 Summary(pl.UTF-8): Sterownik dla Linuksa do exmap
57 Release: %{_rel}@%{_kernel_ver_str}
59 Requires(post,postun): /sbin/depmod
60 %if %{with dist_kernel}
61 %requires_releq_kernel
62 Requires(postun): %releq_kernel
65 %description -n kernel%{_alt_kernel}-misc-exmap
66 This is driver for exmap for Linux.
68 This package contains Linux module.
70 %description -n kernel%{_alt_kernel}-misc-exmap -l pl.UTF-8
71 Sterownik dla Linuksa do exmap.
73 Ten pakiet zawiera moduł jądra Linuksa.
79 # remove binaries packed in src tarball
80 rm -f src/{*.so,munged-ls-threeloads,prelinked-amule}
83 cat > kernel/Makefile << EOF
85 CFLAGS += -DCONFIG_exmap_SOME_OPTION=1
86 %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1}
92 CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}"
97 %build_kernel_modules -C kernel -m exmap
101 rm -rf $RPM_BUILD_ROOT
103 %if %{with userspace}
104 install -d $RPM_BUILD_ROOT%{_bindir}
105 install src/gexmap $RPM_BUILD_ROOT%{_bindir}
109 %install_kernel_modules -m kernel/exmap -d misc
111 # to avoid conflict with in-kernel modules, and prepare modprobe config:
112 #%%install_kernel_modules -s current -n NAME -m exmap -d misc
116 rm -rf $RPM_BUILD_ROOT
118 %post -n kernel%{_alt_kernel}-misc-exmap
119 %depmod %{_kernel_ver}
121 %postun -n kernel%{_alt_kernel}-misc-exmap
122 %depmod %{_kernel_ver}
125 %files -n kernel%{_alt_kernel}-misc-exmap
126 %defattr(644,root,root,755)
127 /lib/modules/%{_kernel_ver}/misc/*.ko*
131 %if %{with userspace}
133 %defattr(644,root,root,755)
135 %attr(755,root,root) %{_bindir}/*