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 #-----------------------------------------------------------------
34 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
35 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
36 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
37 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
38 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
39 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
40 %{?__cc:CC=%{__cc} ; export CC ; } \
41 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
43 --host=%{_target_platform} \
45 --exec-prefix=%{_exec_prefix} \
47 --sbindir=%{_sbindir} \
48 --sysconfdir=%{_sysconfdir} \
49 --datadir=%{_datadir} \
50 --includedir=%{_includedir} \
52 --libexecdir=%{_libexecdir} \
53 --localstatedir=%{_localstatedir} \
54 --sharedstatedir=%{_sharedstatedir} \
56 --infodir=%{_infodir} \
59 #----------------------------------------------------------------
60 %configure {./configure \
61 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
62 CFLAGS="${CFLAGS:-%rpmcflags}" \
63 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
64 FFLAGS="${FFLAGS:-%rpmcflags}" \
65 CPPFLAGS="${CPPFLAGS:-%rpmcflags}" \
67 %{?__cxx:CXX=%{__cxx}} \
68 --build=%{_target_platform} \
70 --exec-prefix=%{_exec_prefix} \
72 --sbindir=%{_sbindir} \
73 --sysconfdir=%{_sysconfdir} \
74 --datadir=%{_datadir} \
75 --includedir=%{_includedir} \
77 --libexecdir=%{_libexecdir} \
78 --localstatedir=%{_localstatedir} \
79 --sharedstatedir=%{_sharedstatedir} \
81 --infodir=%{_infodir} \
84 # Location of autoconf macros
85 %_aclocaldir %(aclocal --print-ac-dir)
87 # Location of omf files
88 %_omf_dest_dir %(scrollkeeper-config --omfdir)
90 # Location of pkgconfig files
91 %_pkgconfigdir /usr/lib/pkgconfig
93 # Location of top applink dir
94 %_applnkdir /usr/X11R6/share/applnk
96 # Location pixmaps for applnk/desktop files
97 %_pixmapsdir /usr/X11R6/share/pixmaps
99 # Location of fonts directories
100 %_fontsdir /usr/share/fonts
103 %date %(LC_ALL="C" date +"%a %b %d %Y")
106 %tmpdir %(echo "${TMPDIR:-/tmp}")
108 # Example files, programs, scripts...
109 %_examplesdir /usr/src/examples
111 # The directory holding Linux kernel sources
112 %_kernelsrcdir /usr/src/linux
114 # If non-empty "debug" macro defined, add "dbg" suffix to release number
115 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
117 # requires name = version-release
118 %requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
119 %requires_kernel_releq() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
120 %requires_releq_kernel_up() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-up = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
121 %requires_releq_kernel_smp() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-smp = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
123 # kernel version-release handling
124 %__kernel_ver %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
125 %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not")
126 %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}})
127 %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
129 #-----------------------------------------------------------------
130 # find and gzip all files in %{_mandir} and %{infodir}
132 # Requires: xargs, find
134 #%no_install_post_compress_docs 1
135 %__spec_install_post_compress_docs { \
136 echo "Compress man and info pages."; \
137 %{!?no_install_post_compress_docs: \
138 %{?verbose:set -x;} \
139 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
140 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
141 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
142 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
143 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
148 #-----------------------------------------------------------------
149 # Strip executable binaries and shared object files
151 # Requires: find, awk, strip, cut, xargs
153 #%no_install_post_strip 1
154 %__spec_install_post_strip {%{!?debug: \
155 %{!?no_install_post_strip: \
156 %{?verbose:set -x;} \
157 echo "Strip executable binaries and shared object files."; \
158 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
159 elfexelist=`echo $filelist | xargs -r file | \
160 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
161 elfsharedlist=`echo $filelist | xargs -r file | \
162 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
163 if [ -n "$elfexelist" ]; then \
164 strip --remove-section=.note --remove-section=.comment $elfexelist; \
166 if [ -n "$elfsharedlist" ]; then \
167 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
171 %_source_payload w9.gzdio
172 %_binary_payload w9.bzdio
174 #-----------------------------------------------------------------
175 # post %install sequence:
176 # - autodeps exceptions
177 # - compress all man and info pages,
178 # - strip all ELF executables and ELF shared objects if not %debug.
180 ###################################################################
181 # Requires/Provides automation
182 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
185 %{?_noautoreqfiles:_autoreqprov=y}\
186 %{?_noautoreq:_autoreqprov=y}\
187 %{?_noautoreqdep:_autoreqprov=y}\
188 %{?_noautoprovfiles:_autoreqprov=y}\
189 %{?_noautoprov:_autoreqprov=y}\
190 %{?_noautocompressdoc:_autoreqprov=y}\
191 if [ "$_autoreqprov" = "y" ] ; then \
192 if [ -f %{_builddir}/__rpm_lock ] ; then \
193 echo "Some package using \%_noauto* macros is already being built" >&2 \
194 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
197 rm -f %{_builddir}/__rpm_*\
198 touch %{_builddir}/__rpm_lock \
201 %{?_noautocompressdoc:echo '%{_noautocompressdoc}' > %{_builddir}/__rpm_noautocompressdoc}\
205 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
206 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
207 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
208 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
209 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
210 %{__spec_install_post_strip}\
211 %{__spec_install_post_compress_docs}\
212 %{__arch_install_post}\
215 %__spec_clean_pre %{___build_pre}\
217 %{?_noautoreqfiles:_autoreqprov=y}\
218 %{?_noautoreq:_autoreqprov=y}\
219 %{?_noautoreqdep:_autoreqprov=y}\
220 %{?_noautoprovfiles:_autoreqprov=y}\
221 %{?_noautoprov:_autoreqprov=y}\
222 %{?_noautoreqfiles:_autoreqprov=y}\
223 %{?_noautocompressdoc:_autoreqprov=y}\
224 if [ "$_autoreqprov" = "y" ] ; then \
225 rm -f %{_builddir}/__rpm_* \
230 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
232 #%_noautoreqdep %{nil}
233 #%_noautoprovfiles %{nil}