]> git.pld-linux.org Git - packages/exmap.git/blob - exmap.spec
- tabs in preamble
[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    1
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
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:  gtkmm-devel
34 BuildRequires:  libstdc++-devel >= 4.1.1
35 BuildRequires:  pcre-devel
36 %endif
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
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.
45
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.
52
53 # kernel subpackages.
54
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}
59 Group:          Base/Kernel
60 Requires(post,postun):  /sbin/depmod
61 %if %{with dist_kernel}
62 %requires_releq_kernel_up
63 Requires(postun):       %releq_kernel_up
64 %endif
65
66 %description -n kernel%{_alt_kernel}-misc-exmap
67 This is driver for exmap for Linux.
68
69 This package contains Linux module.
70
71 %description -n kernel%{_alt_kernel}-misc-exmap -l pl.UTF-8
72 Sterownik dla Linuksa do exmap.
73
74 Ten pakiet zawiera moduł jądra Linuksa.
75
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}
80 Group:          Base/Kernel
81 Requires(post,postun):  /sbin/depmod
82 %if %{with dist_kernel}
83 %requires_releq_kernel_smp
84 Requires(postun):       %releq_kernel_smp
85 %endif
86
87 %description -n kernel%{_alt_kernel}-smp-misc-exmap
88 This is driver for exmap for Linux.
89
90 This package contains Linux SMP module.
91
92 %description -n kernel%{_alt_kernel}-smp-misc-exmap -l pl.UTF-8
93 Sterownik dla Linuksa do exmap.
94
95 Ten pakiet zawiera moduł jądra Linuksa SMP.
96
97 %prep
98 %setup -q
99 %patch0 -p1
100 %patch1 -p1
101 # remove binaries packed in src tarball
102 rm -f src/{*.so,munged-ls-threeloads,prelinked-amule}
103
104 # prepare makefile:
105 cat > kernel/Makefile << EOF
106 obj-m += exmap.o
107 CFLAGS += -DCONFIG_exmap_SOME_OPTION=1
108 %{?debug:CFLAGS += -DCONFIG_exmap_DEBUG=1}
109 EOF
110
111 %build
112 %if %{with userspace}
113 %{__make} \
114         CXX="%{__cxx}" CXXFLAGS="%{rpmcxxflags}" CFLAGS="%{rpmcflags}"
115
116 %endif
117
118 %if %{with kernel}
119 %build_kernel_modules -C kernel -m exmap
120 %endif
121
122 %install
123 rm -rf $RPM_BUILD_ROOT
124
125 %if %{with userspace}
126 install -d $RPM_BUILD_ROOT%{_bindir}
127 install src/gexmap $RPM_BUILD_ROOT%{_bindir}
128 %endif
129
130 %if %{with kernel}
131 %install_kernel_modules -m kernel/exmap -d misc
132
133 # to avoid conflict with in-kernel modules, and prepare modprobe config:
134 #%%install_kernel_modules -s current -n NAME -m exmap -d misc
135 %endif
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %post   -n kernel%{_alt_kernel}-misc-exmap
141 %depmod %{_kernel_ver}
142
143 %postun -n kernel%{_alt_kernel}-misc-exmap
144 %depmod %{_kernel_ver}
145
146 %post   -n kernel%{_alt_kernel}-smp-misc-exmap
147 %depmod %{_kernel_ver}smp
148
149 %postun -n kernel%{_alt_kernel}-smp-misc-exmap
150 %depmod %{_kernel_ver}smp
151
152 %if %{with kernel}
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*
157 %endif
158
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*
163 %endif
164 %endif
165
166 %if %{with userspace}
167 %files
168 %defattr(644,root,root,755)
169 %doc README TODO
170 %attr(755,root,root) %{_bindir}/*
171 %endif
This page took 0.08907 seconds and 3 git commands to generate.