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 %{?__cc:CC=%{__cc} ; export CC ; } \
40 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
42 --host=%{_target_platform} \
44 --exec-prefix=%{_exec_prefix} \
46 --sbindir=%{_sbindir} \
47 --sysconfdir=%{_sysconfdir} \
48 --datadir=%{_datadir} \
49 --includedir=%{_includedir} \
51 --libexecdir=%{_libexecdir} \
52 --localstatedir=%{_localstatedir} \
53 --sharedstatedir=%{_sharedstatedir} \
55 --infodir=%{_infodir} \
58 #----------------------------------------------------------------
59 %configure {./configure \
60 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
61 CFLAGS="${CFLAGS:-%rpmcflags}" \
62 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
63 FFLAGS="${FFLAGS:-%rpmcflags}" \
65 %{?__cxx:CXX=%{__cxx}} \
66 --build=%{_target_platform} \
68 --exec-prefix=%{_exec_prefix} \
70 --sbindir=%{_sbindir} \
71 --sysconfdir=%{_sysconfdir} \
72 --datadir=%{_datadir} \
73 --includedir=%{_includedir} \
75 --libexecdir=%{_libexecdir} \
76 --localstatedir=%{_localstatedir} \
77 --sharedstatedir=%{_sharedstatedir} \
79 --infodir=%{_infodir} \
82 # Location of autoconf macros
83 %_aclocaldir %(aclocal --print-ac-dir)
85 # Location of pkgconfig files
86 %_pkgconfigdir /usr/lib/pkgconfig
88 # Location of top applink dir
89 %_applnkdir /usr/X11R6/share/applnk
91 # Location pixmaps for applnk/desktop files
92 %_pixmapsdir /usr/X11R6/share/pixmaps
94 # Location of fonts directories
95 %_fontsdir /usr/share/fonts
98 %date %(LC_ALL="C" date +"%a %b %d %Y")
101 %tmpdir %(echo "${TMPDIR:-/tmp}")
103 # Example files, programs, scripts...
104 %_examplesdir /usr/src/examples
106 # The directory holding Linux kernel sources
107 %_kernelsrcdir /usr/src/linux
109 # If non-empty "debug" macro defined, add "dbg" suffix to release number
110 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
112 # requires name = version-release
113 %requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
114 %requires_kernel_releq() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
115 %requires_releq_kernel_up() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-up = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
116 %requires_releq_kernel_smp() %(LC_ALL="C" rpm -q --queryformat 'Prereq:kernel-smp = %%{VERSION}-%%{RELEASE}' kernel-headers | grep -v "is not")
118 #-----------------------------------------------------------------
119 # find and gzip all files in %{_mandir} and %{infodir}
121 # Requires: xargs, find
123 #%no_install_post_compress_docs 1
124 %__spec_install_post_compress_docs { \
125 echo "Compress man and info pages."; \
126 %{!?no_install_post_compress_docs: \
127 %{?verbose:set -x;} \
128 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
129 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
130 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
131 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
132 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
137 #-----------------------------------------------------------------
138 # Strip executable binaries and shared object files
140 # Requires: find, awk, strip, cut, xargs
142 #%no_install_post_strip 1
143 %__spec_install_post_strip {%{!?debug: \
144 %{!?no_install_post_strip: \
145 %{?verbose:set -x;} \
146 echo "Strip executable binaries and shared object files."; \
147 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
148 elfexelist=`echo $filelist | xargs -r file | \
149 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
150 elfsharedlist=`echo $filelist | xargs -r file | \
151 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
152 if [ -n "$elfexelist" ]; then \
153 strip --remove-section=.note --remove-section=.comment $elfexelist; \
155 if [ -n "$elfsharedlist" ]; then \
156 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
160 %_source_payload w9.gzdio
161 %_binary_payload w9.bzdio
163 #-----------------------------------------------------------------
164 # post %install sequence:
165 # - autodeps exceptions
166 # - compress all man and info pages,
167 # - strip all ELF executables and ELF shared objects if not %debug.
169 ###################################################################
170 # Requires/Provides automation
171 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
174 %{?_noautoreqfiles:_autoreqprov=y}\
175 %{?_noautoreq:_autoreqprov=y}\
176 %{?_noautoreqdep:_autoreqprov=y}\
177 %{?_noautoprovfiles:_autoreqprov=y}\
178 %{?_noautoprov:_autoreqprov=y}\
179 if [ "$_autoreqprov" = "y" ] ; then \
180 if [ -f %{_builddir}/__rpm_lock ] ; then \
181 echo "Some package using \%_noauto* macros is already being built" >&2 \
182 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
185 rm -f %{_builddir}/__rpm_*\
186 touch %{_builddir}/__rpm_lock \
192 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
193 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
194 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
195 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
196 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
197 %{__spec_install_post_strip}\
198 %{__spec_install_post_compress_docs}\
199 %{__arch_install_post}\
202 %__spec_clean_pre %{___build_pre}\
204 %{?_noautoreqfiles:_autoreqprov=y}\
205 %{?_noautoreq:_autoreqprov=y}\
206 %{?_noautoreqdep:_autoreqprov=y}\
207 %{?_noautoprovfiles:_autoreqprov=y}\
208 %{?_noautoprov:_autoreqprov=y}\
209 %{?_noautoreqfiles:_autoreqprov=y}\
210 if [ "$_autoreqprov" = "y" ] ; then \
211 rm -f %{_builddir}/__rpm_* \
216 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
218 #%_noautoreqdep %{nil}
219 #%_noautoprovfiles %{nil}