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 gettextize --copy --force --intl; \
44 cp -f po/Makevars{.template,}; \
46 gettextize --copy --force; \
49 %__automake automake -a -c -f --foreign
50 %__autoconf autoconf %{?debug:-Wall}
52 #-----------------------------------------------------------------
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 ; \
59 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
60 %{?__cc:CC=%{__cc} ; export CC ; } \
61 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
62 %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
63 --host=%{_target_platform} \
65 --exec-prefix=%{_exec_prefix} \
67 --sbindir=%{_sbindir} \
68 --sysconfdir=%{_sysconfdir} \
69 --datadir=%{_datadir} \
70 --includedir=%{_includedir} \
72 --libexecdir=%{_libexecdir} \
73 --localstatedir=%{_localstatedir} \
74 --sharedstatedir=%{_sharedstatedir} \
76 --infodir=%{_infodir} \
79 #----------------------------------------------------------------
80 %configure {./configure \
81 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
82 CFLAGS="${CFLAGS:-%rpmcflags}" \
83 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
84 FFLAGS="${FFLAGS:-%rpmcflags}" \
85 CPPFLAGS="${CPPFLAGS:-}" \
87 %{?__cxx:CXX=%{__cxx}} \
88 --build=%{_target_platform} \
90 --exec-prefix=%{_exec_prefix} \
92 --sbindir=%{_sbindir} \
93 --sysconfdir=%{_sysconfdir} \
94 --datadir=%{_datadir} \
95 --includedir=%{_includedir} \
97 --libexecdir=%{_libexecdir} \
98 --localstatedir=%{_localstatedir} \
99 --sharedstatedir=%{_sharedstatedir} \
100 --mandir=%{_mandir} \
101 --infodir=%{_infodir} \
104 # Location of autoconf macros
105 %_aclocaldir %(aclocal --print-ac-dir)
107 # Location of omf files
108 %_omf_dest_dir %(scrollkeeper-config --omfdir)
110 # Location of pkgconfig files
111 %_pkgconfigdir /usr/lib/pkgconfig
113 # Location of top applink dir
114 %_applnkdir /usr/X11R6/share/applnk
116 # Location pixmaps for applnk/desktop files
117 %_pixmapsdir /usr/X11R6/share/pixmaps
119 # Location of fonts directories
120 %_fontsdir /usr/share/fonts
123 %date %(LC_ALL="C" date +"%a %b %d %Y")
126 %tmpdir %(echo "${TMPDIR:-/tmp}")
128 # Example files, programs, scripts...
129 %_examplesdir /usr/src/examples
131 # The directory holding Linux kernel sources
132 %_kernelsrcdir /usr/src/linux
134 # If non-empty "debug" macro defined, add "dbg" suffix to release number
135 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
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)")
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)
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 \
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"' \
163 ; do echo $l; done >> %1 \
166 #-----------------------------------------------------------------
167 # find and gzip all files in %{_mandir} and %{infodir}
169 # Requires: xargs, find
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; \
185 #-----------------------------------------------------------------
186 # Strip executable binaries and shared object files
188 # Requires: find, awk, strip, cut, xargs
190 #%no_install_post_strip 1
191 %__spec_install_post_strip {%{!?debug: \
192 %{!?no_install_post_strip: \
193 %{?verbose:set -x;} \
194 echo "Strip executable binaries, archives and shared object files."; \
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`; \
200 elfarchiveslist=`echo $filelist | xargs -r file | \
201 awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
202 if [ -n "$elfexelist" ]; then \
203 strip --remove-section=.note --remove-section=.comment $elfexelist; \
205 if [ -n "$elfsharedlist" ]; then \
206 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
208 if [ -n "$elfarchiveslist" ]; then \
209 strip --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
213 #-----------------------------------------------------------------
214 # Find and gzip all kernel modules
218 #%no_install_post_compress_modules 1
219 %__spec_install_post_compress_modules { \
220 %{!?no_install_post_compress_modules: \
221 echo "Compress kernel modules if any."; \
222 %{?verbose:set -x;} \
223 if test -d $RPM_BUILD_ROOT/lib/modules ; then \
224 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \
225 xargs -r %{__gzip} -9nf; \
226 find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
227 while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
231 %_source_payload w9.gzdio
232 %_binary_payload w9.bzdio
234 #-----------------------------------------------------------------
235 # Update all GConf2 schemas
239 %gconf_schema_install { \
240 GCONF_CONFIG_SOURCE="" \
241 %{_bindir}/gconftool-2 --makefile-install-rule \
242 /etc/X11/GNOME2/gconf/schemas/*.schemas > /dev/null \
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.
250 # - compress kernel modules if any
252 ###################################################################
253 # Requires/Provides automation
254 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
257 %{?_noautoreqfiles:_autoreqprov=y}\
258 %{?_noautoreq:_autoreqprov=y}\
259 %{?_noautoreqdep:_autoreqprov=y}\
260 %{?_noautoprovfiles:_autoreqprov=y}\
261 %{?_noautoprov:_autoreqprov=y}\
262 %{?_noautocompressdoc:_autoreqprov=y}\
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 \
269 rm -f %{_builddir}/__rpm_*\
270 touch %{_builddir}/__rpm_lock \
273 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
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}\
284 %{__spec_install_post_compress_modules}\
285 %{__arch_install_post}\
288 %__spec_clean_pre %{___build_pre}\
290 %{?_noautoreqfiles:_autoreqprov=y}\
291 %{?_noautoreq:_autoreqprov=y}\
292 %{?_noautoreqdep:_autoreqprov=y}\
293 %{?_noautoprovfiles:_autoreqprov=y}\
294 %{?_noautoprov:_autoreqprov=y}\
295 %{?_noautoreqfiles:_autoreqprov=y}\
296 %{?_noautocompressdoc:_autoreqprov=y}\
297 if [ "$_autoreqprov" = "y" ] ; then \
298 rm -f %{_builddir}/__rpm_* \
303 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
305 #%_noautoreqdep %{nil}
306 #%_noautoprovfiles %{nil}
308 %_missing_doc_files_terminate_build 1%{nil}
309 %_unpackaged_files_terminate_build %{nil}