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 %__gettextize gettextize --copy --force
37 %__automake automake -a -c -f --foreign
38 %__autoconf autoconf %{?debug:-Wall}
40 #-----------------------------------------------------------------
42 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
43 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
44 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
45 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
46 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
47 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
48 %{?__cc:CC=%{__cc} ; export CC ; } \
49 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
51 --host=%{_target_platform} \
53 --exec-prefix=%{_exec_prefix} \
55 --sbindir=%{_sbindir} \
56 --sysconfdir=%{_sysconfdir} \
57 --datadir=%{_datadir} \
58 --includedir=%{_includedir} \
60 --libexecdir=%{_libexecdir} \
61 --localstatedir=%{_localstatedir} \
62 --sharedstatedir=%{_sharedstatedir} \
64 --infodir=%{_infodir} \
67 #----------------------------------------------------------------
68 %configure {./configure \
69 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
70 CFLAGS="${CFLAGS:-%rpmcflags}" \
71 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
72 FFLAGS="${FFLAGS:-%rpmcflags}" \
73 CPPFLAGS="${CPPFLAGS:-%rpmcflags}" \
75 %{?__cxx:CXX=%{__cxx}} \
76 --build=%{_target_platform} \
78 --exec-prefix=%{_exec_prefix} \
80 --sbindir=%{_sbindir} \
81 --sysconfdir=%{_sysconfdir} \
82 --datadir=%{_datadir} \
83 --includedir=%{_includedir} \
85 --libexecdir=%{_libexecdir} \
86 --localstatedir=%{_localstatedir} \
87 --sharedstatedir=%{_sharedstatedir} \
89 --infodir=%{_infodir} \
92 # Location of autoconf macros
93 %_aclocaldir %(aclocal --print-ac-dir)
95 # Location of omf files
96 %_omf_dest_dir %(scrollkeeper-config --omfdir)
98 # Location of pkgconfig files
99 %_pkgconfigdir /usr/lib/pkgconfig
101 # Location of top applink dir
102 %_applnkdir /usr/X11R6/share/applnk
104 # Location pixmaps for applnk/desktop files
105 %_pixmapsdir /usr/X11R6/share/pixmaps
107 # Location of fonts directories
108 %_fontsdir /usr/share/fonts
111 %date %(LC_ALL="C" date +"%a %b %d %Y")
114 %tmpdir %(echo "${TMPDIR:-/tmp}")
116 # Example files, programs, scripts...
117 %_examplesdir /usr/src/examples
119 # The directory holding Linux kernel sources
120 %_kernelsrcdir /usr/src/linux
122 # If non-empty "debug" macro defined, add "dbg" suffix to release number
123 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
125 # requires name = version-release
126 %requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
127 %requires_kernel_releq() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
128 %requires_releq_kernel_up() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-up = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
129 %requires_releq_kernel_smp() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-smp = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
131 # kernel version-release handling
132 %__kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
133 %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not")
134 %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}})
135 %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
137 #-----------------------------------------------------------------
138 # find and gzip all files in %{_mandir} and %{infodir}
140 # Requires: xargs, find
142 #%no_install_post_compress_docs 1
143 %__spec_install_post_compress_docs { \
144 echo "Compress man and info pages."; \
145 %{!?no_install_post_compress_docs: \
146 %{?verbose:set -x;} \
147 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
148 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
149 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
150 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
151 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
156 #-----------------------------------------------------------------
157 # Strip executable binaries and shared object files
159 # Requires: find, awk, strip, cut, xargs
161 #%no_install_post_strip 1
162 %__spec_install_post_strip {%{!?debug: \
163 %{!?no_install_post_strip: \
164 %{?verbose:set -x;} \
165 echo "Strip executable binaries and shared object files."; \
166 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
167 elfexelist=`echo $filelist | xargs -r file | \
168 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
169 elfsharedlist=`echo $filelist | xargs -r file | \
170 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
171 if [ -n "$elfexelist" ]; then \
172 strip --remove-section=.note --remove-section=.comment $elfexelist; \
174 if [ -n "$elfsharedlist" ]; then \
175 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
179 %_source_payload w9.gzdio
180 %_binary_payload w9.bzdio
182 #-----------------------------------------------------------------
183 # post %install sequence:
184 # - autodeps exceptions
185 # - compress all man and info pages,
186 # - strip all ELF executables and ELF shared objects if not %debug.
188 ###################################################################
189 # Requires/Provides automation
190 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
193 %{?_noautoreqfiles:_autoreqprov=y}\
194 %{?_noautoreq:_autoreqprov=y}\
195 %{?_noautoreqdep:_autoreqprov=y}\
196 %{?_noautoprovfiles:_autoreqprov=y}\
197 %{?_noautoprov:_autoreqprov=y}\
198 %{?_noautocompressdoc:_autoreqprov=y}\
199 if [ "$_autoreqprov" = "y" ] ; then \
200 if [ -f %{_builddir}/__rpm_lock ] ; then \
201 echo "Some package using \%_noauto* macros is already being built" >&2 \
202 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
205 rm -f %{_builddir}/__rpm_*\
206 touch %{_builddir}/__rpm_lock \
209 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
213 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
214 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
215 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
216 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
217 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
218 %{__spec_install_post_strip}\
219 %{__spec_install_post_compress_docs}\
220 %{__arch_install_post}\
223 %__spec_clean_pre %{___build_pre}\
225 %{?_noautoreqfiles:_autoreqprov=y}\
226 %{?_noautoreq:_autoreqprov=y}\
227 %{?_noautoreqdep:_autoreqprov=y}\
228 %{?_noautoprovfiles:_autoreqprov=y}\
229 %{?_noautoprov:_autoreqprov=y}\
230 %{?_noautoreqfiles:_autoreqprov=y}\
231 %{?_noautocompressdoc:_autoreqprov=y}\
232 if [ "$_autoreqprov" = "y" ] ; then \
233 rm -f %{_builddir}/__rpm_* \
238 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
240 #%_noautoreqdep %{nil}
241 #%_noautoprovfiles %{nil}