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