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