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}
28 #-----------------------------------------------------------------
30 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
31 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
32 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
33 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
34 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
35 %{?__cc:CC=%{__cc} ; export CC ; } \
36 %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
38 --host=%{_target_platform} \
40 --exec-prefix=%{_exec_prefix} \
42 --sbindir=%{_sbindir} \
43 --sysconfdir=%{_sysconfdir} \
44 --datadir=%{_datadir} \
45 --includedir=%{_includedir} \
47 --libexecdir=%{_libexecdir} \
48 --localstatedir=%{_localstatedir} \
49 --sharedstatedir=%{_sharedstatedir} \
51 --infodir=%{_infodir} \
54 #----------------------------------------------------------------
55 %configure {./configure \
56 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
57 CFLAGS="${CFLAGS:-%rpmcflags}" \
58 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
59 FFLAGS="${FFLAGS:-%rpmcflags}" \
61 %{?__cxx:CXX=%{__cxx}} \
62 --build=%{_target_platform} \
64 --exec-prefix=%{_exec_prefix} \
66 --sbindir=%{_sbindir} \
67 --sysconfdir=%{_sysconfdir} \
68 --datadir=%{_datadir} \
69 --includedir=%{_includedir} \
71 --libexecdir=%{_libexecdir} \
72 --localstatedir=%{_localstatedir} \
73 --sharedstatedir=%{_sharedstatedir} \
75 --infodir=%{_infodir} \
78 # Location of autoconf macros
79 %_aclocaldir %(aclocal --print-ac-dir)
81 # Location of pkgconfig files
82 %_pkgconfigdir /usr/lib/pkgconfig
84 # Location of top applink dir
85 %_applnkdir /usr/X11R6/share/applnk
87 # Location pixmaps for applnk/desktop files
88 %_pixmapsdir /usr/X11R6/share/pixmaps
90 # Location of fonts directories
91 %_fontsdir /usr/share/fonts
94 %date %(LC_ALL="C" date +"%a %b %d %Y")
97 %tmpdir %(echo "${TMPDIR:-/tmp}")
99 # Example files, programs, scripts...
100 %_examplesdir /usr/src/examples
102 # The directory holding Linux kernel sources
103 %_kernelsrcdir /usr/src/linux
105 # If non-empty "debug" macro defined, add "dbg" suffix to release number
106 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
108 # requires name = version-release
109 %requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
111 #-----------------------------------------------------------------
112 # find and gzip all files in %{_mandir} and %{infodir}
114 # Requires: xargs, find
116 #%no_install_post_compress_docs 1
117 %__spec_install_post_compress_docs { \
118 echo "Compress man and info pages."; \
119 %{!?no_install_post_compress_docs: \
120 %{?verbose:set -x;} \
121 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
122 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
123 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
124 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
125 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
130 #-----------------------------------------------------------------
131 # Strip executable binaries and shared object files
133 # Requires: find, awk, strip, cut, xargs
135 #%no_install_post_strip 1
136 %__spec_install_post_strip {%{!?debug: \
137 %{!?no_install_post_strip: \
138 %{?verbose:set -x;} \
139 echo "Strip executable binaries and shared object files."; \
140 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
141 elfexelist=`echo $filelist | xargs -r file | \
142 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
143 elfsharedlist=`echo $filelist | xargs -r file | \
144 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
145 if [ -n "$elfexelist" ]; then \
146 strip --remove-section=.note --remove-section=.comment $elfexelist; \
148 if [ -n "$elfsharedlist" ]; then \
149 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
153 %_source_payload w9.gzdio
154 %_binary_payload w9.bzdio
156 #-----------------------------------------------------------------
157 # post %install sequence:
158 # - autodeps exceptions
159 # - compress all man and info pages,
160 # - strip all ELF executables and ELF shared objects if not %debug.
162 ###################################################################
163 # Requires/Provides automation
164 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
167 %{?_noautoreqfiles:_autoreqprov=y}\
168 %{?_noautoreq:_autoreqprov=y}\
169 %{?_noautoreqdep:_autoreqprov=y}\
170 %{?_noautoprovfiles:_autoreqprov=y}\
171 %{?_noautoprov:_autoreqprov=y}\
172 if [ "$_autoreqprov" = "y" ] ; then \
173 if [ -f %{_builddir}/__rpm_lock ] ; then \
174 echo "Some package using \%_noauto* macros is already being built" >&2 \
175 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
178 rm -f %{_builddir}/__rpm_*\
179 touch %{_builddir}/__rpm_lock \
185 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
186 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
187 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
188 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
189 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
190 %{__spec_install_post_strip}\
191 %{__spec_install_post_compress_docs}\
192 %{__arch_install_post}\
195 %__spec_clean_pre %{___build_pre}\
197 %{?_noautoreqfiles:_autoreqprov=y}\
198 %{?_noautoreq:_autoreqprov=y}\
199 %{?_noautoreqdep:_autoreqprov=y}\
200 %{?_noautoprovfiles:_autoreqprov=y}\
201 %{?_noautoprov:_autoreqprov=y}\
202 %{?_noautoreqfiles:_autoreqprov=y}\
203 if [ "$_autoreqprov" = "y" ] ; then \
204 rm -f %{_builddir}/__rpm_* \
209 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
211 #%_noautoreqdep %{nil}
212 #%_noautoprovfiles %{nil}