2 %bcond_without dist_kernel # allow non-distribution kernel
3 %bcond_without kernel # don't build kernel modules
4 %bcond_without up # don't build UP module
5 %bcond_without smp # don't build SMP module
6 %bcond_without userspace # don't build userspace programs
7 %bcond_with verbose # verbose build (V=1)
10 %undefine with_dist_kernel
14 Summary: Determine how much physical memory and swap is used by individual processes
15 Summary(pl.UTF-8): Narzędzie do analizowania zużycia pamięci fizycznej i wymiany przez poszczególne procesy
21 Group: Applications/System
22 Source0: http://www.berthels.co.uk/exmap/download/%{name}-%{version}.tgz
23 # Source0-md5: b4f87fa02f6a218416b77ad4b9f48d74
24 Patch0: %{name}-Makefile.patch
25 Patch1: %{name}-vserver.patch
26 URL: http://www.berthels.co.uk/exmap/
28 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.14}
29 BuildRequires: rpmbuild(macros) >= 1.330
32 BuildRequires: boost-devel
33 BuildRequires: gtkmm-devel
34 BuildRequires: libstdc++-devel >= 4.1.1
35 BuildRequires: pcre-devel
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 Exmap is a tool which allows the real memory usage of a collection of
41 processes to be examined. A linux kernel loadable module is used to
42 export information to userspace, which is examined by a gtk
43 application to build a picture of how pages are shared amongst
44 processes and their shared libraries.
46 %description -l pl.UTF-8
47 Exmap jest narzędziem pozwalającym badać realne użycie pamięci przez
48 zbiór procesów. Moduł kernela jest używany do eksportowania
49 informacji do przestrzeni użytkownika, które są analizowane przez
50 aplikację gtk do zobrazowania jak wiele stron jest współdzielonych
51 między procesami i ich bibliotekami dzielonymi.
55 %package -n kernel%{_alt_kernel}-misc-exmap
56 Summary: Linux driver for exmap
57 Summary(pl.UTF-8): Sterownik dla Linuksa do exmap
58 Release: %{_rel}@%{_kernel_ver_str}
60 Requires(post,postun): /sbin/depmod
61 %if %{with dist_kernel}
62 %requires_releq_kernel_up
63 Requires(postun): %releq_kernel_up
66 %description -n kernel%{_alt_kernel}-misc-exmap
67 This is driver for exmap for Linux.
69 This package contains Linux module.
71 %description -n kernel%{_alt_kernel}-misc-exmap -l pl.UTF-8
72 Sterownik dla Linuksa do exmap.
74 Ten pakiet zawiera moduł jądra Linuksa.
76 %package -n kernel%{_alt_kernel}-smp-misc-exmap
77 Summary: Linux SMP driver for exmap
78 Summary(pl.UTF-8): Sterownik dla Linuksa SMP do exmap
79 Release: %{_rel}@%{_kernel_ver_str}
81 Requires(post,postun): /sbin/depmod
82 %if %{with dist_kernel}
83 %requires_releq_kernel_smp
84 Requires(postun): %releq_kernel_smp
87 %description -n kernel%{_alt_kernel}-smp-misc-exmap
88 This is driver for exmap for Linux.
90 This package contains Linux SMP module.
92 %description -n kernel%{_alt_kernel}-smp-misc-exmap -l pl.UTF-8
93 Sterownik dla Linuksa do exmap.
95 Ten pakiet zawiera moduł jądra Linuksa SMP.
101 # remove binaries packed in src tarball
102 rm -f src/{*.so,munged-ls-threeloads,prelinked-amule}
105 cat > kernel/Makefile << EOF
107 CFLAGS += -DCONFIG_exmap_SOME_OPTION=1
108 %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1}
112 %if %{with userspace}
114 CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}"
119 %build_kernel_modules -C kernel -m exmap
123 rm -rf $RPM_BUILD_ROOT
125 %if %{with userspace}
126 install -d $RPM_BUILD_ROOT%{_bindir}
127 install src/gexmap $RPM_BUILD_ROOT%{_bindir}
131 %install_kernel_modules -m kernel/exmap -d misc
133 # to avoid conflict with in-kernel modules, and prepare modprobe config:
134 #%%install_kernel_modules -s current -n NAME -m exmap -d misc
138 rm -rf $RPM_BUILD_ROOT
140 %post -n kernel%{_alt_kernel}-misc-exmap
141 %depmod %{_kernel_ver}
143 %postun -n kernel%{_alt_kernel}-misc-exmap
144 %depmod %{_kernel_ver}
146 %post -n kernel%{_alt_kernel}-smp-misc-exmap
147 %depmod %{_kernel_ver}smp
149 %postun -n kernel%{_alt_kernel}-smp-misc-exmap
150 %depmod %{_kernel_ver}smp
153 %if %{with up} || %{without dist_kernel}
154 %files -n kernel%{_alt_kernel}-misc-exmap
155 %defattr(644,root,root,755)
156 /lib/modules/%{_kernel_ver}/misc/*.ko*
159 %if %{with smp} && %{with dist_kernel}
160 %files -n kernel%{_alt_kernel}-smp-misc-exmap
161 %defattr(644,root,root,755)
162 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
166 %if %{with userspace}
168 %defattr(644,root,root,755)
170 %attr(755,root,root) %{_bindir}/*