]> git.pld-linux.org Git - packages/exmap.git/blob - exmap.spec
ff229f940e35f2ec30c026de8d000bb84756041a
[packages/exmap.git] / exmap.spec
1 # Conditional build:
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)
8
9 %if %{without kernel}
10 %undefine       with_dist_kernel
11 %endif
12
13 %define         _rel    0.1
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
16 Name:           exmap
17 Version:        0.10
18 Release:        %{_rel}
19 Epoch:          0
20 License:        GPL v2
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/
27 %if %{with kernel}
28 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.14}
29 BuildRequires:  rpmbuild(macros) >= 1.330
30 %endif
31 %if %{with userspace}
32 BuildRequires:  boost-devel
33 BuildRequires:  pcre-devel
34 %endif
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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.
43
44 #%description -l pl
45
46 # kernel subpackages.
47
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}
52 Group:          Base/Kernel
53 Requires(post,postun):  /sbin/depmod
54 %if %{with dist_kernel}
55 %requires_releq_kernel_up
56 Requires(postun):       %releq_kernel_up
57 %endif
58
59 %description -n kernel%{_alt_kernel}-misc-exmap
60 This is driver for exmap for Linux.
61
62 This package contains Linux module.
63
64 %description -n kernel%{_alt_kernel}-misc-exmap -l pl
65 Sterownik dla Linuksa do exmap.
66
67 Ten pakiet zawiera modu³ j±dra Linuksa.
68
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}
73 Group:          Base/Kernel
74 Requires(post,postun):  /sbin/depmod
75 %if %{with dist_kernel}
76 %requires_releq_kernel_smp
77 Requires(postun):       %releq_kernel_smp
78 %endif
79
80 %description -n kernel%{_alt_kernel}-smp-misc-exmap
81 This is driver for exmap for Linux.
82
83 This package contains Linux SMP module.
84
85 %description -n kernel%{_alt_kernel}-smp-misc-exmap -l pl
86 Sterownik dla Linuksa do exmap.
87
88 Ten pakiet zawiera modu³ j±dra Linuksa SMP.
89
90 %prep
91 %setup -q
92 %patch0 -p1
93 %patch1 -p1
94 # remove binaries packed in src tarball
95 rm -f src/{*.so,munged-ls-threeloads,prelinked-amule}
96
97 # prepare makefile:
98 cat > kernel/Makefile << EOF
99 obj-m += exmap.o
100 CFLAGS += -DCONFIG_exmap_SOME_OPTION=1
101 %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1}
102 EOF
103
104 %build
105 %if %{with userspace}
106 %{__make} \
107         CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}"
108
109 %endif
110
111 %if %{with kernel}
112 %build_kernel_modules -C kernel -m exmap
113 %endif
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117
118 %if %{with userspace}
119 install -d $RPM_BUILD_ROOT%{_bindir}
120 install src/gexmap $RPM_BUILD_ROOT%{_bindir}
121 %endif
122
123 %if %{with kernel}
124 %install_kernel_modules -m kernel/exmap -d misc
125
126 # to avoid conflict with in-kernel modules, and prepare modprobe config:
127 #%%install_kernel_modules -s current -n NAME -m exmap -d misc
128 %endif
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %post   -n kernel%{_alt_kernel}-misc-exmap
134 %depmod %{_kernel_ver}
135
136 %postun -n kernel%{_alt_kernel}-misc-exmap
137 %depmod %{_kernel_ver}
138
139 %post   -n kernel%{_alt_kernel}-smp-misc-exmap
140 %depmod %{_kernel_ver}smp
141
142 %postun -n kernel%{_alt_kernel}-smp-misc-exmap
143 %depmod %{_kernel_ver}smp
144
145 %if %{with kernel}
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*
150 %endif
151
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*
156 %endif
157 %endif
158
159 %if %{with userspace}
160 %files
161 %defattr(644,root,root,755)
162 %doc README TODO
163 %attr(755,root,root) %{_bindir}/*
164 %endif
This page took 0.100741 seconds and 3 git commands to generate.