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 #------------------------------------------------------------------------------
33 # The GNUconfigure macro does the following:
34 # update config.guess and config.sub.
35 # regenerate all autoconf/automake files
36 # optionally change to a directory (make the directory if requested).
37 # run configure with correct prefix, platform, and CFLAGS.
38 # optionally restore current directory.
40 # Based on autogen.sh from GNOME and orginal GNUconfigure
43 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
44 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
45 for coin in `echo ${dirs}` \
47 dr=`dirname ${coin}`; \
48 if test -f ${dr}/NO-AUTO-GEN; then \
51 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
53 aclocalinclude="${ACLOCAL_FLAGS}"; \
54 for k in ${macrodirs}; do \
55 if test -d ${k}; then \
56 aclocalinclude="${aclocalinclude} -I ${k}"; \
58 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
61 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
62 if grep "sed.*POTFILES" configure.in >/dev/null; then \
63 : do nothing -- we still have an old unmodified configure.in \
65 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
66 echo "no" | gettextize --force --copy; \
67 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
70 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
71 %{__libtoolize} --force --copy; \
73 aclocal ${aclocalinclude}; \
74 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
77 echo "Running automake --gnu ${am_opt} ..."; \
78 %{__automake} --add-missing --gnu ${am_opt}; \
83 %{-C:${_mydir}}%{!-C:.}/%{configure} \
84 %{-C:cd ${_mydir}; unset _mydir}
86 # Location of autoconf macros
87 %_aclocaldir %(aclocal --print-ac-dir)
89 # Location of pkgconfig files
90 %_pkgconfigdir /usr/lib/pkgconfig
92 # Location of top applink dir
93 %_applnkdir /usr/X11R6/share/applnk
95 # Location pixmaps for applnk/desktop files
96 %_pixmapsdir /usr/X11R6/share/pixmaps
98 # Location of fonts directories
99 %_fontsdir /usr/share/fonts
102 %date %(LC_ALL="C" date +"%a %b %d %Y")
105 %tmpdir %(echo "${TMPDIR:-/tmp}")
107 # Example files, programs, scripts...
108 %_examplesdir /usr/src/examples
110 # If non-empty "debug" macro defined, add "dbg" suffix to release number
111 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
113 #-----------------------------------------------------------------
114 # find and gzip all files in %{_mandir} and %{infodir}
116 # Requires: xargs, find
118 #%no_install_post_compress_docs 1
119 %__spec_install_post_compress_docs { \
120 echo "Compress man and info pages."; \
121 %{!?no_install_post_compress_docs: \
122 %{?verbose:set -x;} \
123 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
124 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
125 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
126 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
127 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
132 #-----------------------------------------------------------------
133 # Strip executable binaries and shared object files
135 # Requires: find, awk, strip, cut, xargs
137 #%no_install_post_strip 1
138 %__spec_install_post_strip {%{!?debug: \
139 %{!?no_install_post_strip: \
140 %{?verbose:set -x;} \
141 echo "Strip executable binaries and shared object files."; \
142 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
143 elfexelist=`echo $filelist | xargs -r file | \
144 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
145 elfsharedlist=`echo $filelist | xargs -r file | \
146 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
147 if [ -n "$elfexelist" ]; then \
148 strip --remove-section=.note --remove-section=.comment $elfexelist; \
150 if [ -n "$elfsharedlist" ]; then \
151 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
155 %_source_payload w9.gzdio
156 %_binary_payload w9.bzdio
158 #-----------------------------------------------------------------
159 # post %install sequence:
160 # - autodeps exceptions
161 # - compress all man and info pages,
162 # - strip all ELF executables and ELF shared objects if not %debug.
164 ###################################################################
165 # Requires/Provides automation
166 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
169 %{?_noautoreqfiles:_autoreqprov=y}\
170 %{?_noautoreq:_autoreqprov=y}\
171 %{?_noautoreqdep:_autoreqprov=y}\
172 %{?_noautoprovfiles:_autoreqprov=y}\
173 %{?_noautoprov:_autoreqprov=y}\
174 if [ "$_autoreqprov" = "y" ] ; then \
175 if [ -f %{_builddir}/__rpm_lock ] ; then \
176 echo "Some package using \%_noauto* macros is already being built" >&2 \
177 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
180 rm -f %{_builddir}/__rpm_*\
181 touch %{_builddir}/__rpm_lock \
186 %__spec_install_post \
187 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
188 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
189 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
190 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
191 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
192 %{__spec_install_post_strip}\
193 %{__spec_install_post_compress_docs}\
194 %{__arch_install_post}\
195 %{__os_install_post}\
198 %__spec_clean_pre %{___build_pre}\
200 %{?_noautoreqfiles:_autoreqprov=y}\
201 %{?_noautoreq:_autoreqprov=y}\
202 %{?_noautoreqdep:_autoreqprov=y}\
203 %{?_noautoprovfiles:_autoreqprov=y}\
204 %{?_noautoprov:_autoreqprov=y}\
205 %{?_noautoreqfiles:_autoreqprov=y}\
206 if [ "$_autoreqprov" = "y" ] ; then \
207 rm -f %{_builddir}/__rpm_* \
212 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
214 #%_noautoreqdep %{nil}
215 #%_noautoprovfiles %{nil}