3 %_defaultdocdir %{_usr}/share/doc
4 %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@
6 %_topdir %(echo $HOME)/rpm
7 %_exec_prefix %{_prefix}
8 %_bindir %{_exec_prefix}/bin
9 %_sbindir %{_exec_prefix}/sbin
10 %_libexecdir %{_exec_prefix}/lib
11 %_datadir %{_prefix}/share
12 %_sharedstatedir %{_prefix}/com
14 %_libdir %{_exec_prefix}/%{_lib}
15 %_includedir %{_prefix}/include
16 %_oldincludedir /usr/include
19 %_infodir /usr/share/info
20 %_mandir %{_prefix}/share/man
21 #-----------------------------------------------------------------
22 # CFLAGS and LDFLAGS used to build
25 %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}
26 %rpmldflags %{!?debug:-s}
32 #-----------------------------------------------------------------
33 # Build system path macros.
35 %__libtoolize libtoolize --copy --force
36 %__automake automake -a -c -f --foreing
37 %__autoconf autoconf %{!?debug:-Wall}
39 #-----------------------------------------------------------------
41 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
42 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
43 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
44 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
45 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
46 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
47 %{?__cc:CC=%{__cc} ; export CC ; } \
48 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
50 --host=%{_target_platform} \
52 --exec-prefix=%{_exec_prefix} \
54 --sbindir=%{_sbindir} \
55 --sysconfdir=%{_sysconfdir} \
56 --datadir=%{_datadir} \
57 --includedir=%{_includedir} \
59 --libexecdir=%{_libexecdir} \
60 --localstatedir=%{_localstatedir} \
61 --sharedstatedir=%{_sharedstatedir} \
63 --infodir=%{_infodir} \
66 #----------------------------------------------------------------
67 %configure {./configure \
68 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
69 CFLAGS="${CFLAGS:-%rpmcflags}" \
70 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
71 FFLAGS="${FFLAGS:-%rpmcflags}" \
72 CPPFLAGS="${CPPFLAGS:-%rpmcflags}" \
74 %{?__cxx:CXX=%{__cxx}} \
75 --build=%{_target_platform} \
77 --exec-prefix=%{_exec_prefix} \
79 --sbindir=%{_sbindir} \
80 --sysconfdir=%{_sysconfdir} \
81 --datadir=%{_datadir} \
82 --includedir=%{_includedir} \
84 --libexecdir=%{_libexecdir} \
85 --localstatedir=%{_localstatedir} \
86 --sharedstatedir=%{_sharedstatedir} \
88 --infodir=%{_infodir} \
91 # Location of autoconf macros
92 %_aclocaldir %(aclocal --print-ac-dir)
94 # Location of omf files
95 %_omf_dest_dir %(scrollkeeper-config --omfdir)
97 # Location of pkgconfig files
98 %_pkgconfigdir /usr/lib/pkgconfig
100 # Location of top applink dir
101 %_applnkdir /usr/X11R6/share/applnk
103 # Location pixmaps for applnk/desktop files
104 %_pixmapsdir /usr/X11R6/share/pixmaps
106 # Location of fonts directories
107 %_fontsdir /usr/share/fonts
110 %date %(LC_ALL="C" date +"%a %b %d %Y")
113 %tmpdir %(echo "${TMPDIR:-/tmp}")
115 # Example files, programs, scripts...
116 %_examplesdir /usr/src/examples
118 # The directory holding Linux kernel sources
119 %_kernelsrcdir /usr/src/linux
121 # If non-empty "debug" macro defined, add "dbg" suffix to release number
122 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
124 # requires name = version-release
125 %requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
126 %requires_kernel_releq() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
127 %requires_releq_kernel_up() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-up = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
128 %requires_releq_kernel_smp() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-smp = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
130 # kernel version-release handling
131 %__kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
132 %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not")
133 %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}})
134 %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
136 #-----------------------------------------------------------------
137 # find and gzip all files in %{_mandir} and %{infodir}
139 # Requires: xargs, find
141 #%no_install_post_compress_docs 1
142 %__spec_install_post_compress_docs { \
143 echo "Compress man and info pages."; \
144 %{!?no_install_post_compress_docs: \
145 %{?verbose:set -x;} \
146 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
147 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
148 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
149 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
150 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
155 #-----------------------------------------------------------------
156 # Strip executable binaries and shared object files
158 # Requires: find, awk, strip, cut, xargs
160 #%no_install_post_strip 1
161 %__spec_install_post_strip {%{!?debug: \
162 %{!?no_install_post_strip: \
163 %{?verbose:set -x;} \
164 echo "Strip executable binaries and shared object files."; \
165 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
166 elfexelist=`echo $filelist | xargs -r file | \
167 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
168 elfsharedlist=`echo $filelist | xargs -r file | \
169 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
170 if [ -n "$elfexelist" ]; then \
171 strip --remove-section=.note --remove-section=.comment $elfexelist; \
173 if [ -n "$elfsharedlist" ]; then \
174 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
178 %_source_payload w9.gzdio
179 %_binary_payload w9.bzdio
181 #-----------------------------------------------------------------
182 # post %install sequence:
183 # - autodeps exceptions
184 # - compress all man and info pages,
185 # - strip all ELF executables and ELF shared objects if not %debug.
187 ###################################################################
188 # Requires/Provides automation
189 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
192 %{?_noautoreqfiles:_autoreqprov=y}\
193 %{?_noautoreq:_autoreqprov=y}\
194 %{?_noautoreqdep:_autoreqprov=y}\
195 %{?_noautoprovfiles:_autoreqprov=y}\
196 %{?_noautoprov:_autoreqprov=y}\
197 %{?_noautocompressdoc:_autoreqprov=y}\
198 if [ "$_autoreqprov" = "y" ] ; then \
199 if [ -f %{_builddir}/__rpm_lock ] ; then \
200 echo "Some package using \%_noauto* macros is already being built" >&2 \
201 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
204 rm -f %{_builddir}/__rpm_*\
205 touch %{_builddir}/__rpm_lock \
208 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
212 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
213 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
214 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
215 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
216 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
217 %{__spec_install_post_strip}\
218 %{__spec_install_post_compress_docs}\
219 %{__arch_install_post}\
222 %__spec_clean_pre %{___build_pre}\
224 %{?_noautoreqfiles:_autoreqprov=y}\
225 %{?_noautoreq:_autoreqprov=y}\
226 %{?_noautoreqdep:_autoreqprov=y}\
227 %{?_noautoprovfiles:_autoreqprov=y}\
228 %{?_noautoprov:_autoreqprov=y}\
229 %{?_noautoreqfiles:_autoreqprov=y}\
230 %{?_noautocompressdoc:_autoreqprov=y}\
231 if [ "$_autoreqprov" = "y" ] ; then \
232 rm -f %{_builddir}/__rpm_* \
237 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
239 #%_noautoreqdep %{nil}
240 #%_noautoprovfiles %{nil}