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\.10\.' ; then \
43 if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
44 gettextize --copy --force --no-changelog; \
46 gettextize --copy --force --no-changelog --intl; \
48 if [ ! -f po/Makevars ]; then \
49 cp -f po/Makevars{.template,}; \
52 gettextize --copy --force; \
55 %__autopoint autopoint --force
56 %__automake automake -a -c -f --foreign
57 %__autoconf autoconf %{?debug:-Wall}
59 #-----------------------------------------------------------------
61 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
62 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
63 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
64 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
65 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
66 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
67 %{?__cc:CC=%{__cc} ; export CC ; } \
68 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
69 %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
70 --host=%{_target_platform} \
72 --exec-prefix=%{_exec_prefix} \
74 --sbindir=%{_sbindir} \
75 --sysconfdir=%{_sysconfdir} \
76 --datadir=%{_datadir} \
77 --includedir=%{_includedir} \
79 --libexecdir=%{_libexecdir} \
80 --localstatedir=%{_localstatedir} \
81 --sharedstatedir=%{_sharedstatedir} \
83 --infodir=%{_infodir} \
86 #----------------------------------------------------------------
88 %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
89 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
90 CFLAGS="${CFLAGS:-%rpmcflags}" \
91 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
92 FFLAGS="${FFLAGS:-%rpmcflags}" \
93 CPPFLAGS="${CPPFLAGS:-}" \
95 %{?__cxx:CXX=%{__cxx}} \
96 --build=%{_target_platform} \
98 --exec-prefix=%{_exec_prefix} \
100 --sbindir=%{_sbindir} \
101 --sysconfdir=%{_sysconfdir} \
102 --datadir=%{_datadir} \
103 --includedir=%{_includedir} \
104 --libdir=%{_libdir} \
105 --libexecdir=%{_libexecdir} \
106 --localstatedir=%{_localstatedir} \
107 --sharedstatedir=%{_sharedstatedir} \
108 --mandir=%{_mandir} \
109 --infodir=%{_infodir} \
112 # Location of autoconf macros
113 %_aclocaldir %(aclocal --print-ac-dir)
115 # Location of omf files
116 %_omf_dest_dir %(scrollkeeper-config --omfdir)
118 # Location of pkgconfig files
119 %_pkgconfigdir /usr/lib/pkgconfig
121 # Location of top applink dir
122 %_applnkdir /usr/X11R6/share/applnk
124 # Location of desktop files
125 %_desktopdir /usr/share/applications
127 # Location pixmaps for applnk/desktop files
128 %_pixmapsdir /usr/share/pixmaps
130 # Location of fonts directories
131 %_fontsdir /usr/share/fonts
133 # Location of Gtk and associated libraries documentation
134 %_gtkdocdir %{_defaultdocdir}/gtk-doc/html
137 %date %(LC_ALL="C" date +"%a %b %d %Y")
140 %tmpdir %(echo "${TMPDIR:-/tmp}")
142 # Example files, programs, scripts...
143 %_examplesdir /usr/src/examples
145 # The directory holding Linux kernel sources
146 %_kernelsrcdir /usr/src/linux
148 # If non-empty "debug" macro defined, add "dbg" suffix to release number
149 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
151 # Requires name = version-release
152 %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")
153 %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)")
154 %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)")
156 # kernel version-release handling
157 %__kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
158 %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not")
159 %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}})
160 %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
163 %xmlcat_add() /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog
164 %xmlcat_del() /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog
165 %xmlcat_add_rewrite /usr/bin/xmlcatalog --noout --add rewriteSystem
166 %xmlcat_create() /usr/bin/xmlcatalog --noout --create %1
167 %sgmlcat_add() /usr/bin/install-catalog --add %1 %2 > /dev/null
168 %sgmlcat_del() /usr/bin/install-catalog --remove %1 %2 > /dev/null
169 %docbook_sgmlcat_fix() { for l in \
171 ' -- default decl --' \
172 'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \
173 ' -- hacks for opensp --' \
174 'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
175 'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
177 ; do echo $l; done >> %1 \
180 #-----------------------------------------------------------------
181 # find and gzip all files in %{_mandir} and %{infodir}
183 # Requires: xargs, find
185 #%no_install_post_compress_docs 1
186 %__spec_install_post_compress_docs { \
187 echo "Compress man and info pages."; \
188 %{!?no_install_post_compress_docs: \
189 %{?verbose:set -x;} \
190 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
191 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
192 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
193 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
194 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
199 #-----------------------------------------------------------------
200 # Strip executable binaries and shared object files
202 # Requires: find, awk, strip, cut, xargs
204 #%no_install_post_strip 1
205 %__spec_install_post_strip {%{!?debug: \
206 %{!?no_install_post_strip: \
207 %{?verbose:set -x;} \
208 echo "Strip executable binaries, archives and shared object files."; \
209 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
210 elfexelist=`echo $filelist | xargs -r file | \
211 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
212 elfsharedlist=`echo $filelist | xargs -r file | \
213 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
214 elfarchiveslist=`echo $filelist | xargs -r file | \
215 awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
216 if [ -n "$elfexelist" ]; then \
217 strip --remove-section=.note --remove-section=.comment $elfexelist; \
219 if [ -n "$elfsharedlist" ]; then \
220 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
222 if [ -n "$elfarchiveslist" ]; then \
223 strip --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
227 #-----------------------------------------------------------------
228 # Find and gzip all kernel modules
232 #%no_install_post_compress_modules 1
233 %__spec_install_post_compress_modules { \
234 %{!?no_install_post_compress_modules: \
235 echo "Compress kernel modules if any."; \
236 %{?verbose:set -x;} \
237 if test -d $RPM_BUILD_ROOT/lib/modules ; then \
238 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \
239 xargs -r %{__gzip} -9nf; \
240 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
241 while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
245 %_source_payload w9.gzdio
246 %_binary_payload w9.bzdio
248 #-----------------------------------------------------------------
249 # Update all GConf2 schemas
253 %gconf_schema_install { umask 022; \
254 GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
255 /usr/bin/gconftool-2 --makefile-install-rule \
256 /etc/gconf/schemas/*.schemas > /dev/null \
259 #-----------------------------------------------------------------
260 # post %install sequence:
261 # - autodeps exceptions
262 # - compress all man and info pages,
263 # - strip all ELF executables and ELF shared objects if not %debug.
264 # - compress kernel modules if any
266 ###################################################################
267 # Requires/Provides automation
268 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
271 %{?_noautoreqfiles:_autoreqprov=y}\
272 %{?_noautoreq:_autoreqprov=y}\
273 %{?_noautoreqdep:_autoreqprov=y}\
274 %{?_noautoprovfiles:_autoreqprov=y}\
275 %{?_noautoprov:_autoreqprov=y}\
276 %{?_noautocompressdoc:_autoreqprov=y}\
277 if [ "$_autoreqprov" = "y" ] ; then \
278 if [ -f %{_builddir}/__rpm_lock ] ; then \
279 echo "Some package using \%_noauto* macros is already being built" >&2 \
280 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
283 rm -f %{_builddir}/__rpm_*\
284 touch %{_builddir}/__rpm_lock \
287 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
291 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
292 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
293 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
294 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
295 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
296 %{__spec_install_post_strip}\
297 %{__spec_install_post_compress_docs}\
298 %{__spec_install_post_compress_modules}\
299 %{__arch_install_post}\
302 %__spec_clean_pre %{___build_pre}\
304 %{?_noautoreqfiles:_autoreqprov=y}\
305 %{?_noautoreq:_autoreqprov=y}\
306 %{?_noautoreqdep:_autoreqprov=y}\
307 %{?_noautoprovfiles:_autoreqprov=y}\
308 %{?_noautoprov:_autoreqprov=y}\
309 %{?_noautoreqfiles:_autoreqprov=y}\
310 %{?_noautocompressdoc:_autoreqprov=y}\
311 if [ "$_autoreqprov" = "y" ] ; then \
312 rm -f %{_builddir}/__rpm_* \
317 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
319 #%_noautoreqdep %{nil}
320 #%_noautoprovfiles %{nil}
322 %_missing_doc_files_terminate_build 1%{nil}
323 %_unpackaged_files_terminate_build %{nil}