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): 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: pcre-devel
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Exmap is a tool which allows the real memory usage of a collection of
39 processes to be examined. A linux kernel loadable module is used to
40 export information to userspace, which is examined by a gtk
41 application to build a picture of how pages are shared amongst
42 processes and their shared libraries.
48 %package -n kernel%{_alt_kernel}-misc-exmap
49 Summary: Linux driver for exmap
50 Summary(pl): Sterownik dla Linuksa do exmap
51 Release: %{_rel}@%{_kernel_ver_str}
53 Requires(post,postun): /sbin/depmod
54 %if %{with dist_kernel}
55 %requires_releq_kernel_up
56 Requires(postun): %releq_kernel_up
59 %description -n kernel%{_alt_kernel}-misc-exmap
60 This is driver for exmap for Linux.
62 This package contains Linux module.
64 %description -n kernel%{_alt_kernel}-misc-exmap -l pl
65 Sterownik dla Linuksa do exmap.
67 Ten pakiet zawiera modu³ j±dra Linuksa.
69 %package -n kernel%{_alt_kernel}-smp-misc-exmap
70 Summary: Linux SMP driver for exmap
71 Summary(pl): Sterownik dla Linuksa SMP do exmap
72 Release: %{_rel}@%{_kernel_ver_str}
74 Requires(post,postun): /sbin/depmod
75 %if %{with dist_kernel}
76 %requires_releq_kernel_smp
77 Requires(postun): %releq_kernel_smp
80 %description -n kernel%{_alt_kernel}-smp-misc-exmap
81 This is driver for exmap for Linux.
83 This package contains Linux SMP module.
85 %description -n kernel%{_alt_kernel}-smp-misc-exmap -l pl
86 Sterownik dla Linuksa do exmap.
88 Ten pakiet zawiera modu³ j±dra Linuksa SMP.
94 # remove binaries packed in src tarball
95 rm -f src/{*.so,munged-ls-threeloads,prelinked-amule}
98 cat > kernel/Makefile << EOF
100 CFLAGS += -DCONFIG_exmap_SOME_OPTION=1
101 %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1}
105 %if %{with userspace}
107 CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}"
112 %build_kernel_modules -C kernel -m exmap
116 rm -rf $RPM_BUILD_ROOT
118 %if %{with userspace}
119 install -d $RPM_BUILD_ROOT%{_bindir}
120 install src/gexmap $RPM_BUILD_ROOT%{_bindir}
124 %install_kernel_modules -m kernel/exmap -d misc
126 # to avoid conflict with in-kernel modules, and prepare modprobe config:
127 #%%install_kernel_modules -s current -n NAME -m exmap -d misc
131 rm -rf $RPM_BUILD_ROOT
133 %post -n kernel%{_alt_kernel}-misc-exmap
134 %depmod %{_kernel_ver}
136 %postun -n kernel%{_alt_kernel}-misc-exmap
137 %depmod %{_kernel_ver}
139 %post -n kernel%{_alt_kernel}-smp-misc-exmap
140 %depmod %{_kernel_ver}smp
142 %postun -n kernel%{_alt_kernel}-smp-misc-exmap
143 %depmod %{_kernel_ver}smp
146 %if %{with up} || %{without dist_kernel}
147 %files -n kernel%{_alt_kernel}-misc-exmap
148 %defattr(644,root,root,755)
149 /lib/modules/%{_kernel_ver}/misc/*.ko*
152 %if %{with smp} && %{with dist_kernel}
153 %files -n kernel%{_alt_kernel}-smp-misc-exmap
154 %defattr(644,root,root,755)
155 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
159 %if %{with userspace}
161 %defattr(644,root,root,755)
163 %attr(755,root,root) %{_bindir}/*