1 #-----------------------------------------------------------------
2 # CFLAGS and LDFLAGS used to build
5 %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}
6 %rpmldflags %{!?debug:-s}
8 #-----------------------------------------------------------------
10 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
11 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
12 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
13 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
14 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
16 --host=%{_target_platform} \
18 --exec-prefix=%{_exec_prefix} \
20 --sbindir=%{_sbindir} \
21 --sysconfdir=%{_sysconfdir} \
22 --datadir=%{_datadir} \
23 --includedir=%{_includedir} \
25 --libexecdir=%{_libexecdir} \
26 --localstatedir=%{_localstatedir} \
27 --sharedstatedir=%{_sharedstatedir} \
29 --infodir=%{_infodir} \
32 #----------------------------------------------------------------
34 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
36 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
37 CFLAGS="${CFLAGS:-%rpmcflags}" \
38 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
39 FFLAGS="${FFLAGS:-%rpmcflags}" \
40 --build=%{_target_platform} \
42 --exec-prefix=%{_exec_prefix} \
44 --sbindir=%{_sbindir} \
45 --sysconfdir=%{_sysconfdir} \
46 --datadir=%{_datadir} \
47 --includedir=%{_includedir} \
49 --libexecdir=%{_libexecdir} \
50 --localstatedir=%{_localstatedir} \
51 --sharedstatedir=%{_sharedstatedir} \
53 --infodir=%{_infodir} \
56 #------------------------------------------------------------------------------
57 # The GNUconfigure macro does the following:
58 # update config.guess and config.sub.
59 # regenerate all autoconf/automake files
60 # optionally change to a directory (make the directory if requested).
61 # run configure with correct prefix, platform, and CFLAGS.
62 # optionally restore current directory.
64 # Based on autogen.sh from GNOME and orginal GNUconfigure
67 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
68 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
69 for coin in `echo ${dirs}` \
71 dr=`dirname ${coin}`; \
72 if test -f ${dr}/NO-AUTO-GEN; then \
75 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
77 aclocalinclude="${ACLOCAL_FLAGS}"; \
78 for k in ${macrodirs}; do \
79 if test -d ${k}; then \
80 aclocalinclude="${aclocalinclude} -I ${k}"; \
82 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
85 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
86 if grep "sed.*POTFILES" configure.in >/dev/null; then \
87 : do nothing -- we still have an old unmodified configure.in \
89 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
90 echo "no" | gettextize --force --copy; \
91 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
94 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
95 %{__libtoolize} --force --copy; \
97 aclocal ${aclocalinclude}; \
98 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
101 echo "Running automake --gnu ${am_opt} ..."; \
102 %{__automake} --add-missing --gnu ${am_opt}; \
107 %{-C:${_mydir}}%{!-C:.}/%{configure} \
108 %{-C:cd ${_mydir}; unset _mydir}
110 # Location of autoconf macros
111 %_aclocaldir %(aclocal --print-ac-dir)
113 # Location of pkgconfig files
114 %_pkgconfigdir /usr/lib/pkgconfig
116 # Location of top applink dir
117 %_applnkdir /usr/X11R6/share/applnk
119 # Location pixmaps for applnk/desktop files
120 %_pixmapsdir /usr/X11R6/share/pixmaps
122 # Location of fonts directories
123 %_fontsdir /usr/share/fonts
126 %date %(LC_ALL="C" date +"%a %b %d %Y")
129 %tmpdir %(echo "${TMPDIR:-/tmp}")
131 # Example files, programs, scripts...
132 %_examplesdir /usr/src/examples
134 # If non-empty "debug" macro defined, add "dbg" suffix to release number
135 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
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 if [ "$_autoreqprov" = "y" ] ; then \
199 if [ -f %{_builddir}/__rpm_lock ] ; then \
200 echo "Some package using \%_noauto* macros is already being built" >&2 \
201 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
204 rm -f %{_builddir}/__rpm_*\
205 touch %{_builddir}/__rpm_lock \
210 %__spec_install_post \
211 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
212 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
213 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
214 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
215 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
216 %{__spec_install_post_strip}\
217 %{__spec_install_post_compress_docs}\
218 %{__arch_install_post}\
219 %{__os_install_post}\
222 %__spec_clean_pre %{___build_pre}\
224 %{?_noautoreqfiles:_autoreqprov=y}\
225 %{?_noautoreq:_autoreqprov=y}\
226 %{?_noautoreqdep:_autoreqprov=y}\
227 %{?_noautoprovfiles:_autoreqprov=y}\
228 %{?_noautoprov:_autoreqprov=y}\
229 %{?_noautoreqfiles:_autoreqprov=y}\
230 if [ "$_autoreqprov" = "y" ] ; then \
231 rm -f %{_builddir}/__rpm_* \
236 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
238 #%_noautoreqdep %{nil}
239 #%_noautoprovfiles %{nil}