5 %__chown_Rhf @__CHOWN_RHF@
6 %__chgrp_Rhf @__CHGRP_RHF@
8 %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@
10 %_fixperms %{__chmod} -Rf @FIXPERMS@
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
17 %_sharedstatedir /var/lib
19 %_libdir %{_exec_prefix}/%{_lib}
20 %_includedir %{_prefix}/include
21 %_oldincludedir /usr/include
24 %_infodir /usr/share/info
25 %_mandir %{_prefix}/share/man
26 %_defaultdocdir %{_usr}/share/doc
27 #-----------------------------------------------------------------
28 # CFLAGS and LDFLAGS used to build
30 %debugcflags -O0 -g -Wall
31 %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}
32 %rpmldflags %{!?debug:-s}
38 # Build system path macros.
40 %__libtoolize libtoolize --copy --force
42 if [ -f po/Makevars ]; then \
43 gettextize --copy --force; \
44 elif gettextize --version | grep -q '0\.11\.' ; then \
45 gettextize --copy --force --intl; \
46 cp -f po/Makevars{.template,}; \
48 gettextize --copy --force; \
51 %__automake automake -a -c -f --foreign
52 %__autoconf autoconf %{?debug:-Wall}
54 #-----------------------------------------------------------------
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 ; \
61 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
62 %{?__cc:CC=%{__cc} ; export CC ; } \
63 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
64 %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
65 --host=%{_target_platform} \
67 --exec-prefix=%{_exec_prefix} \
69 --sbindir=%{_sbindir} \
70 --sysconfdir=%{_sysconfdir} \
71 --datadir=%{_datadir} \
72 --includedir=%{_includedir} \
74 --libexecdir=%{_libexecdir} \
75 --localstatedir=%{_localstatedir} \
76 --sharedstatedir=%{_sharedstatedir} \
78 --infodir=%{_infodir} \
81 #----------------------------------------------------------------
82 %configure {./configure \
83 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
84 CFLAGS="${CFLAGS:-%rpmcflags}" \
85 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
86 FFLAGS="${FFLAGS:-%rpmcflags}" \
87 CPPFLAGS="${CPPFLAGS:-}" \
89 %{?__cxx:CXX=%{__cxx}} \
90 --build=%{_target_platform} \
92 --exec-prefix=%{_exec_prefix} \
94 --sbindir=%{_sbindir} \
95 --sysconfdir=%{_sysconfdir} \
96 --datadir=%{_datadir} \
97 --includedir=%{_includedir} \
99 --libexecdir=%{_libexecdir} \
100 --localstatedir=%{_localstatedir} \
101 --sharedstatedir=%{_sharedstatedir} \
102 --mandir=%{_mandir} \
103 --infodir=%{_infodir} \
106 # Location of autoconf macros
107 %_aclocaldir %(aclocal --print-ac-dir)
109 # Location of omf files
110 %_omf_dest_dir %(scrollkeeper-config --omfdir)
112 # Location of pkgconfig files
113 %_pkgconfigdir /usr/lib/pkgconfig
115 # Location of top applink dir
116 %_applnkdir /usr/X11R6/share/applnk
118 # Location pixmaps for applnk/desktop files
119 %_pixmapsdir /usr/X11R6/share/pixmaps
121 # Location of fonts directories
122 %_fontsdir /usr/share/fonts
125 %date %(LC_ALL="C" date +"%a %b %d %Y")
128 %tmpdir %(echo "${TMPDIR:-/tmp}")
130 # Example files, programs, scripts...
131 %_examplesdir /usr/src/examples
133 # The directory holding Linux kernel sources
134 %_kernelsrcdir /usr/src/linux
136 # If non-empty "debug" macro defined, add "dbg" suffix to release number
137 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
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)")
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)
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 \
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"' \
165 ; do echo $l; done >> %1 \
168 #-----------------------------------------------------------------
169 # find and gzip all files in %{_mandir} and %{infodir}
171 # Requires: xargs, find
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; \
187 #-----------------------------------------------------------------
188 # Strip executable binaries and shared object files
190 # Requires: find, awk, strip, cut, xargs
192 #%no_install_post_strip 1
193 %__spec_install_post_strip {%{!?debug: \
194 %{!?no_install_post_strip: \
195 %{?verbose:set -x;} \
196 echo "Strip executable binaries, archives and shared object files."; \
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`; \
202 elfarchiveslist=`echo $filelist | xargs -r file | \
203 awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
204 if [ -n "$elfexelist" ]; then \
205 strip --remove-section=.note --remove-section=.comment $elfexelist; \
207 if [ -n "$elfsharedlist" ]; then \
208 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
210 if [ -n "$elfarchiveslist" ]; then \
211 strip --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
215 #-----------------------------------------------------------------
216 # Find and gzip all kernel modules
220 #%no_install_post_compress_modules 1
221 %__spec_install_post_compress_modules { \
222 %{!?no_install_post_compress_modules: \
223 echo "Compress kernel modules if any."; \
224 %{?verbose:set -x;} \
225 if test -d $RPM_BUILD_ROOT/lib/modules ; then \
226 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \
227 xargs -r %{__gzip} -9nf; \
228 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
229 while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
233 %_source_payload w9.gzdio
234 %_binary_payload w9.bzdio
236 #-----------------------------------------------------------------
237 # Update all GConf2 schemas
241 %gconf_schema_install { \
242 GCONF_CONFIG_SOURCE="" \
243 %{_bindir}/gconftool-2 --makefile-install-rule \
244 /etc/X11/GNOME2/gconf/schemas/*.schemas > /dev/null \
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.
252 # - compress kernel modules if any
254 ###################################################################
255 # Requires/Provides automation
256 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
259 %{?_noautoreqfiles:_autoreqprov=y}\
260 %{?_noautoreq:_autoreqprov=y}\
261 %{?_noautoreqdep:_autoreqprov=y}\
262 %{?_noautoprovfiles:_autoreqprov=y}\
263 %{?_noautoprov:_autoreqprov=y}\
264 %{?_noautocompressdoc:_autoreqprov=y}\
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 \
271 rm -f %{_builddir}/__rpm_*\
272 touch %{_builddir}/__rpm_lock \
275 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
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}\
286 %{__spec_install_post_compress_modules}\
287 %{__arch_install_post}\
290 %__spec_clean_pre %{___build_pre}\
292 %{?_noautoreqfiles:_autoreqprov=y}\
293 %{?_noautoreq:_autoreqprov=y}\
294 %{?_noautoreqdep:_autoreqprov=y}\
295 %{?_noautoprovfiles:_autoreqprov=y}\
296 %{?_noautoprov:_autoreqprov=y}\
297 %{?_noautoreqfiles:_autoreqprov=y}\
298 %{?_noautocompressdoc:_autoreqprov=y}\
299 if [ "$_autoreqprov" = "y" ] ; then \
300 rm -f %{_builddir}/__rpm_* \
305 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
307 #%_noautoreqdep %{nil}
308 #%_noautoprovfiles %{nil}
310 %_missing_doc_files_terminate_build 1%{nil}
311 %_unpackaged_files_terminate_build %{nil}