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