]>
Commit | Line | Data |
---|---|---|
d54662bf AF |
1 | # PLD rpm macros |
2 | ||
8f74418b MM |
3 | %__id @__ID@ |
4 | %__id_u %{__id} -u | |
5 | %__chown_Rhf @__CHOWN_RHF@ | |
6 | %__chgrp_Rhf @__CHGRP_RHF@ | |
7 | ||
d54662bf AF |
8 | %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@ |
9 | %_fixgroup true | |
8f74418b | 10 | %_fixperms %{__chmod} -Rf @FIXPERMS@ |
d54662bf AF |
11 | %_topdir %(echo $HOME)/rpm |
12 | %_exec_prefix %{_prefix} | |
13 | %_bindir %{_exec_prefix}/bin | |
14 | %_sbindir %{_exec_prefix}/sbin | |
15 | %_libexecdir %{_exec_prefix}/lib | |
16 | %_datadir %{_prefix}/share | |
8f74418b | 17 | %_sharedstatedir /var/lib |
d54662bf AF |
18 | %_lib lib |
19 | %_libdir %{_exec_prefix}/%{_lib} | |
20 | %_includedir %{_prefix}/include | |
21 | %_oldincludedir /usr/include | |
22 | %_sysconfdir /etc | |
23 | %_localstatedir /var | |
24 | %_infodir /usr/share/info | |
25 | %_mandir %{_prefix}/share/man | |
8f74418b | 26 | %_defaultdocdir %{_usr}/share/doc |
9c404149 AM |
27 | #----------------------------------------------------------------- |
28 | # CFLAGS and LDFLAGS used to build | |
29 | ||
8f74418b | 30 | %debugcflags -O0 -g -Wall |
9c404149 AM |
31 | %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags} |
32 | %rpmldflags %{!?debug:-s} | |
33 | ||
ba1fdedc | 34 | # kernel compiler |
8f74418b MM |
35 | %kgcc gcc2 |
36 | %kgcc_package gcc2 | |
ba1fdedc | 37 | |
33040789 | 38 | # Build system path macros. |
39 | # | |
40 | %__libtoolize libtoolize --copy --force | |
83094b62 | 41 | %__gettextize { \ |
97589b6e | 42 | if [ -f po/Makevars ]; then \ |
83094b62 | 43 | gettextize --copy --force; \ |
97589b6e MM |
44 | elif gettextize --version | grep -q '0\.11\.' ; then \ |
45 | gettextize --copy --force --intl; \ | |
46 | cp -f po/Makevars{.template,}; \ | |
47 | else \ | |
48 | gettextize --copy --force; \ | |
83094b62 | 49 | fi; \ |
50 | } | |
bcdab9c2 | 51 | %__automake automake -a -c -f --foreign |
be3a1985 | 52 | %__autoconf autoconf %{?debug:-Wall} |
33040789 | 53 | |
9c404149 | 54 | #----------------------------------------------------------------- |
9f4ce098 | 55 | %configure2_13 { \ |
9c404149 AM |
56 | if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ |
57 | LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \ | |
58 | CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \ | |
59 | CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \ | |
60 | FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \ | |
8ec1a12b | 61 | CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \ |
ae5d93df AM |
62 | %{?__cc:CC=%{__cc} ; export CC ; } \ |
63 | %{?__cxx:CXX=%{__cxx} ; export CXX ; } \ | |
8f74418b | 64 | %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \ |
2a7cfd3f | 65 | --host=%{_target_platform} \ |
9c404149 AM |
66 | --prefix=%{_prefix} \ |
67 | --exec-prefix=%{_exec_prefix} \ | |
68 | --bindir=%{_bindir} \ | |
69 | --sbindir=%{_sbindir} \ | |
70 | --sysconfdir=%{_sysconfdir} \ | |
71 | --datadir=%{_datadir} \ | |
72 | --includedir=%{_includedir} \ | |
73 | --libdir=%{_libdir} \ | |
74 | --libexecdir=%{_libexecdir} \ | |
75 | --localstatedir=%{_localstatedir} \ | |
76 | --sharedstatedir=%{_sharedstatedir} \ | |
77 | --mandir=%{_mandir} \ | |
78 | --infodir=%{_infodir} \ | |
79 | } | |
80 | ||
4a6b0d54 | 81 | #---------------------------------------------------------------- |
9f4ce098 | 82 | %configure {./configure \ |
4a6b0d54 AF |
83 | LDFLAGS="${LDFLAGS:-%rpmldflags}" \ |
84 | CFLAGS="${CFLAGS:-%rpmcflags}" \ | |
85 | CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \ | |
86 | FFLAGS="${FFLAGS:-%rpmcflags}" \ | |
a2bd5992 | 87 | CPPFLAGS="${CPPFLAGS:-}" \ |
9f4ce098 AF |
88 | %{?__cc:CC=%{__cc}} \ |
89 | %{?__cxx:CXX=%{__cxx}} \ | |
4a6b0d54 AF |
90 | --build=%{_target_platform} \ |
91 | --prefix=%{_prefix} \ | |
92 | --exec-prefix=%{_exec_prefix} \ | |
93 | --bindir=%{_bindir} \ | |
94 | --sbindir=%{_sbindir} \ | |
95 | --sysconfdir=%{_sysconfdir} \ | |
96 | --datadir=%{_datadir} \ | |
97 | --includedir=%{_includedir} \ | |
98 | --libdir=%{_libdir} \ | |
99 | --libexecdir=%{_libexecdir} \ | |
100 | --localstatedir=%{_localstatedir} \ | |
101 | --sharedstatedir=%{_sharedstatedir} \ | |
102 | --mandir=%{_mandir} \ | |
103 | --infodir=%{_infodir} \ | |
104 | } | |
105 | ||
9c404149 AM |
106 | # Location of autoconf macros |
107 | %_aclocaldir %(aclocal --print-ac-dir) | |
108 | ||
e2804f99 AM |
109 | # Location of omf files |
110 | %_omf_dest_dir %(scrollkeeper-config --omfdir) | |
111 | ||
e987a186 | 112 | # Location of pkgconfig files |
d7021551 | 113 | %_pkgconfigdir /usr/lib/pkgconfig |
e987a186 | 114 | |
9c404149 AM |
115 | # Location of top applink dir |
116 | %_applnkdir /usr/X11R6/share/applnk | |
117 | ||
118 | # Location pixmaps for applnk/desktop files | |
119 | %_pixmapsdir /usr/X11R6/share/pixmaps | |
120 | ||
e987a186 JB |
121 | # Location of fonts directories |
122 | %_fontsdir /usr/share/fonts | |
123 | ||
9c404149 AM |
124 | # Current date |
125 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
126 | ||
127 | # tmp directory | |
128 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
129 | ||
130 | # Example files, programs, scripts... | |
131 | %_examplesdir /usr/src/examples | |
132 | ||
8377d27d | 133 | # The directory holding Linux kernel sources |
134 | %_kernelsrcdir /usr/src/linux | |
135 | ||
9c404149 | 136 | # If non-empty "debug" macro defined, add "dbg" suffix to release number |
8f74418b | 137 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm |
9c404149 | 138 | |
8f74418b MM |
139 | # Requires name = version-release |
140 | %requires_releq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") | |
141 | %requires_releq_kernel_up() %(LC_ALL="C" rpm -qf --qf 'Prereq: kernel-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)") | |
142 | %requires_releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf 'Prereq: kernel-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)") | |
b9d5d440 | 143 | |
144 | # kernel version-release handling | |
145 | %__kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2) | |
146 | %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not") | |
147 | %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}}) | |
148 | %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g) | |
87be1cf0 | 149 | |
e00dd7f6 | 150 | # sgml macros |
151 | %xmlcat_add() /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog | |
152 | %xmlcat_del() /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog | |
153 | %xmlcat_add_rewrite /usr/bin/xmlcatalog --noout --add rewriteSystem | |
154 | %xmlcat_create() /usr/bin/xmlcatalog --noout --create %1 | |
155 | %sgmlcat_add() /usr/bin/install-catalog --add %1 %2 > /dev/null | |
156 | %sgmlcat_del() /usr/bin/install-catalog --remove %1 %2 > /dev/null | |
157 | %docbook_sgmlcat_fix() { for l in \ | |
158 | '' \ | |
159 | ' -- default decl --' \ | |
160 | 'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \ | |
161 | ' -- hacks for opensp --' \ | |
162 | 'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
163 | 'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
164 | '' \ | |
165 | ; do echo $l; done >> %1 \ | |
166 | } | |
167 | ||
9c404149 AM |
168 | #----------------------------------------------------------------- |
169 | # find and gzip all files in %{_mandir} and %{infodir} | |
170 | # | |
171 | # Requires: xargs, find | |
172 | # | |
173 | #%no_install_post_compress_docs 1 | |
174 | %__spec_install_post_compress_docs { \ | |
175 | echo "Compress man and info pages."; \ | |
176 | %{!?no_install_post_compress_docs: \ | |
177 | %{?verbose:set -x;} \ | |
178 | for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \ | |
179 | if [ -d "$RPM_BUILD_ROOT$i" ]; then \ | |
180 | find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \ | |
181 | find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \ | |
182 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ | |
183 | fi; \ | |
184 | done; \ | |
185 | } } | |
186 | ||
187 | #----------------------------------------------------------------- | |
188 | # Strip executable binaries and shared object files | |
189 | # | |
190 | # Requires: find, awk, strip, cut, xargs | |
191 | # | |
192 | #%no_install_post_strip 1 | |
193 | %__spec_install_post_strip {%{!?debug: \ | |
194 | %{!?no_install_post_strip: \ | |
195 | %{?verbose:set -x;} \ | |
8f74418b | 196 | echo "Strip executable binaries, archives and shared object files."; \ |
9c404149 AM |
197 | filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \ |
198 | elfexelist=`echo $filelist | xargs -r file | \ | |
199 | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \ | |
200 | elfsharedlist=`echo $filelist | xargs -r file | \ | |
201 | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \ | |
8f74418b MM |
202 | elfarchiveslist=`echo $filelist | xargs -r file | \ |
203 | awk '/current ar archive/ {print $1}' | cut -d: -f1`; \ | |
9c404149 AM |
204 | if [ -n "$elfexelist" ]; then \ |
205 | strip --remove-section=.note --remove-section=.comment $elfexelist; \ | |
206 | fi; \ | |
207 | if [ -n "$elfsharedlist" ]; then \ | |
208 | strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ | |
8f74418b MM |
209 | fi; \ |
210 | if [ -n "$elfarchiveslist" ]; then \ | |
211 | strip --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \ | |
9c404149 AM |
212 | fi; } \ |
213 | } } | |
8f74418b | 214 | |
d72c185f | 215 | #----------------------------------------------------------------- |
ccb8ae8d | 216 | # Find and gzip all kernel modules |
217 | # | |
218 | # Requires: find | |
219 | # | |
220 | #%no_install_post_compress_modules 1 | |
221 | %__spec_install_post_compress_modules { \ | |
ccb8ae8d | 222 | %{!?no_install_post_compress_modules: \ |
fc1ea397 | 223 | echo "Compress kernel modules if any."; \ |
ccb8ae8d | 224 | %{?verbose:set -x;} \ |
d618340e | 225 | if test -d $RPM_BUILD_ROOT/lib/modules ; then \ |
fc1ea397 | 226 | find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \ |
d618340e | 227 | xargs -r %{__gzip} -9nf; \ |
fc1ea397 | 228 | find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \ |
03b234a5 | 229 | while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \ |
d618340e | 230 | fi; \ |
ccb8ae8d | 231 | } } |
9c404149 AM |
232 | |
233 | %_source_payload w9.gzdio | |
234 | %_binary_payload w9.bzdio | |
235 | ||
83094b62 | 236 | #----------------------------------------------------------------- |
237 | # Update all GConf2 schemas | |
238 | # | |
239 | # Requires: GConf2 | |
240 | # | |
3ee1090a | 241 | %gconf_schema_install { \ |
242 | GCONF_CONFIG_SOURCE="" \ | |
83094b62 | 243 | %{_bindir}/gconftool-2 --makefile-install-rule \ |
3ee1090a | 244 | /etc/X11/GNOME2/gconf/schemas/*.schemas > /dev/null \ |
245 | } | |
83094b62 | 246 | |
9c404149 AM |
247 | #----------------------------------------------------------------- |
248 | # post %install sequence: | |
249 | # - autodeps exceptions | |
250 | # - compress all man and info pages, | |
251 | # - strip all ELF executables and ELF shared objects if not %debug. | |
8f74418b | 252 | # - compress kernel modules if any |
9c404149 AM |
253 | |
254 | ################################################################### | |
255 | # Requires/Provides automation | |
256 | # exceptions system by Jacek Konieczny <jajcus@pld.org.pl> | |
7126cc1b JK |
257 | %__spec_prep_pre \ |
258 | _autoreqprov=n \ | |
259 | %{?_noautoreqfiles:_autoreqprov=y}\ | |
260 | %{?_noautoreq:_autoreqprov=y}\ | |
261 | %{?_noautoreqdep:_autoreqprov=y}\ | |
262 | %{?_noautoprovfiles:_autoreqprov=y}\ | |
263 | %{?_noautoprov:_autoreqprov=y}\ | |
f07a68c3 | 264 | %{?_noautocompressdoc:_autoreqprov=y}\ |
7126cc1b JK |
265 | if [ "$_autoreqprov" = "y" ] ; then \ |
266 | if [ -f %{_builddir}/__rpm_lock ] ; then \ | |
267 | echo "Some package using \%_noauto* macros is already being built" >&2 \ | |
268 | echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \ | |
269 | exit 1 \ | |
270 | else \ | |
271 | rm -f %{_builddir}/__rpm_*\ | |
272 | touch %{_builddir}/__rpm_lock \ | |
273 | fi \ | |
274 | fi \ | |
f07a68c3 | 275 | %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\ |
9c404149 AM |
276 | %{nil} |
277 | ||
ef437f4b | 278 | %__os_install_post \ |
9c404149 AM |
279 | %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\ |
280 | %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\ | |
281 | %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\ | |
282 | %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\ | |
283 | %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\ | |
284 | %{__spec_install_post_strip}\ | |
285 | %{__spec_install_post_compress_docs}\ | |
ccb8ae8d | 286 | %{__spec_install_post_compress_modules}\ |
9c404149 | 287 | %{__arch_install_post}\ |
9c404149 AM |
288 | %{nil} |
289 | ||
290 | %__spec_clean_pre %{___build_pre}\ | |
7126cc1b JK |
291 | _autoreqprov=n \ |
292 | %{?_noautoreqfiles:_autoreqprov=y}\ | |
293 | %{?_noautoreq:_autoreqprov=y}\ | |
294 | %{?_noautoreqdep:_autoreqprov=y}\ | |
295 | %{?_noautoprovfiles:_autoreqprov=y}\ | |
296 | %{?_noautoprov:_autoreqprov=y}\ | |
297 | %{?_noautoreqfiles:_autoreqprov=y}\ | |
f07a68c3 | 298 | %{?_noautocompressdoc:_autoreqprov=y}\ |
7126cc1b JK |
299 | if [ "$_autoreqprov" = "y" ] ; then \ |
300 | rm -f %{_builddir}/__rpm_* \ | |
301 | fi \ | |
9c404149 AM |
302 | %{nil} |
303 | ||
304 | ||
305 | #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*" | |
306 | #%_noautoreq %{nil} | |
307 | #%_noautoreqdep %{nil} | |
308 | #%_noautoprovfiles %{nil} | |
309 | #%_noautoprov %{nil} | |
8f74418b MM |
310 | %_missing_doc_files_terminate_build 1%{nil} |
311 | %_unpackaged_files_terminate_build %{nil} |