1 #-----------------------------------------------------------------
3 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
4 LDFLAGS="${LDFLAGS:-%{!?debug: -s}}" ; export LDFLAGS ; \
5 CFLAGS="${CFLAGS:-%{!?debug:%optflags}%{?debug: -g -O0}}" ; export CFLAGS ; \
6 CXXFLAGS="${CXXFLAGS:-%{!?debug:%optflags}%{?debug: -g -O0}}" ; export CXXFLAGS ; \
7 FFLAGS="${FFLAGS:-%{!?debug:%optflags}%{?debug: -g -O0}}" ; export FFLAGS ; \
8 ./configure %{_target_platform} \
10 --exec-prefix=%{_exec_prefix} \
12 --sbindir=%{_sbindir} \
13 --sysconfdir=%{_sysconfdir} \
14 --datadir=%{_datadir} \
15 --includedir=%{_includedir} \
17 --libexecdir=%{_libexecdir} \
18 --localstatedir=%{_localstatedir} \
19 --sharedstatedir=%{_sharedstatedir} \
21 --infodir=%{_infodir} \
24 #------------------------------------------------------------------------------
25 # The GNUconfigure macro does the following:
26 # update config.guess and config.sub.
27 # regenerate all autoconf/automake files
28 # optionally change to a directory (make the directory if requested).
29 # run configure with correct prefix, platform, and CFLAGS.
30 # optionally restore current directory.
32 # Based on autogen.sh from GNOME and orginal GNUconfigure
35 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
36 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
37 for coin in `echo ${dirs}` \
39 dr=`dirname ${coin}`; \
40 if test -f ${dr}/NO-AUTO-GEN; then \
43 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
45 aclocalinclude="${ACLOCAL_FLAGS}"; \
46 for k in ${macrodirs}; do \
47 if test -d ${k}; then \
48 aclocalinclude="${aclocalinclude} -I ${k}"; \
50 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
53 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
54 if grep "sed.*POTFILES" configure.in >/dev/null; then \
55 : do nothing -- we still have an old unmodified configure.in \
57 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
58 echo "no" | gettextize --force --copy; \
59 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
62 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
63 %{__libtoolize} --force --copy; \
65 aclocal ${aclocalinclude}; \
66 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
69 echo "Running automake --gnu ${am_opt} ..."; \
70 %{__automake} --add-missing --gnu ${am_opt}; \
75 %{-C:${_mydir}}%{!-C:.}/%{configure} \
76 %{-C:cd ${_mydir}; unset _mydir}
78 # Location of autoconf macros
79 %_aclocaldir %(aclocal --print-ac-dir)
81 # Location of top applink dir
82 %_applnkdir /usr/X11R6/share/applnk
84 # Location pixmaps for applnk/desktop files
85 %_pixmapsdir /usr/X11R6/share/pixmaps
88 %date %(LC_ALL="C" date +"%a %b %d %Y")
91 %tmpdir %(echo "${TMPDIR:-/tmp}")
93 # Example files, programs, scripts...
94 %_examplesdir /usr/src/examples
96 # If non-empty "debug" macro defined, add "dbg" suffix to release number
97 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
99 #-----------------------------------------------------------------
100 # find and gzip all files in %{_mandir} and %{infodir}
102 # Requires: xargs, find
104 #%no_install_post_compress_docs 1
105 %__spec_install_post_compress_docs { \
106 echo "Compress man and info pages."; \
107 %{!?no_install_post_compress_docs: \
108 %{?verbose:set -x;} \
109 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
110 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
111 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
112 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
113 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
118 #-----------------------------------------------------------------
119 # Strip executable binaries and shared object files
121 # Requires: find, awk, strip, cut, xargs
123 #%no_install_post_strip 1
124 %__spec_install_post_strip {%{!?debug: \
125 %{!?no_install_post_strip: \
126 %{?verbose:set -x;} \
127 echo "Strip executable binaries and shared object files."; \
128 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
129 elfexelist=`echo $filelist | xargs -r file | \
130 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
131 elfsharedlist=`echo $filelist | xargs -r file | \
132 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
133 if [ -n "$elfexelist" ]; then \
134 strip --remove-section=.note --remove-section=.comment $elfexelist; \
136 if [ -n "$elfsharedlist" ]; then \
137 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
141 #-----------------------------------------------------------------
142 # post %install sequence:
143 # - compress all man and info pages,
144 # - strip all ELF executables and ELF shared objects if not %debug.
146 %__spec_install_post { \
147 %{__spec_install_post_strip} \
148 %{__spec_install_post_compress_docs} }
150 %_source_payload w9.gzdio
151 %_binary_payload w9.bzdio
153 ###################################################################
154 # Requires/Provides automation
155 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
156 %__spec_install_pre %{___build_pre}\
157 rm -f %{_builddir}/__rpm_*\
160 %__spec_install_post \
161 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
162 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
163 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
164 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
165 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
166 %{__arch_install_post}\
167 %{__os_install_post}\
170 %__spec_clean_pre %{___build_pre}\
171 rm -f %{_builddir}/__rpm_*\
175 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
177 #%_noautoreqdep %{nil}
178 #%_noautoprovfiles %{nil}