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 ; \
15 ./configure %{_target_platform} \
17 --exec-prefix=%{_exec_prefix} \
19 --sbindir=%{_sbindir} \
20 --sysconfdir=%{_sysconfdir} \
21 --datadir=%{_datadir} \
22 --includedir=%{_includedir} \
24 --libexecdir=%{_libexecdir} \
25 --localstatedir=%{_localstatedir} \
26 --sharedstatedir=%{_sharedstatedir} \
28 --infodir=%{_infodir} \
31 #------------------------------------------------------------------------------
32 # The GNUconfigure macro does the following:
33 # update config.guess and config.sub.
34 # regenerate all autoconf/automake files
35 # optionally change to a directory (make the directory if requested).
36 # run configure with correct prefix, platform, and CFLAGS.
37 # optionally restore current directory.
39 # Based on autogen.sh from GNOME and orginal GNUconfigure
42 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
43 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
44 for coin in `echo ${dirs}` \
46 dr=`dirname ${coin}`; \
47 if test -f ${dr}/NO-AUTO-GEN; then \
50 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
52 aclocalinclude="${ACLOCAL_FLAGS}"; \
53 for k in ${macrodirs}; do \
54 if test -d ${k}; then \
55 aclocalinclude="${aclocalinclude} -I ${k}"; \
57 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
60 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
61 if grep "sed.*POTFILES" configure.in >/dev/null; then \
62 : do nothing -- we still have an old unmodified configure.in \
64 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
65 echo "no" | gettextize --force --copy; \
66 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
69 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
70 %{__libtoolize} --force --copy; \
72 aclocal ${aclocalinclude}; \
73 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
76 echo "Running automake --gnu ${am_opt} ..."; \
77 %{__automake} --add-missing --gnu ${am_opt}; \
82 %{-C:${_mydir}}%{!-C:.}/%{configure} \
83 %{-C:cd ${_mydir}; unset _mydir}
85 # Location of autoconf macros
86 %_aclocaldir %(aclocal --print-ac-dir)
88 # Location of top applink dir
89 %_applnkdir /usr/X11R6/share/applnk
91 # Location pixmaps for applnk/desktop files
92 %_pixmapsdir /usr/X11R6/share/pixmaps
95 %date %(LC_ALL="C" date +"%a %b %d %Y")
98 %tmpdir %(echo "${TMPDIR:-/tmp}")
100 # Example files, programs, scripts...
101 %_examplesdir /usr/src/examples
103 # If non-empty "debug" macro defined, add "dbg" suffix to release number
104 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
106 #-----------------------------------------------------------------
107 # find and gzip all files in %{_mandir} and %{infodir}
109 # Requires: xargs, find
111 #%no_install_post_compress_docs 1
112 %__spec_install_post_compress_docs { \
113 echo "Compress man and info pages."; \
114 %{!?no_install_post_compress_docs: \
115 %{?verbose:set -x;} \
116 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
117 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
118 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
119 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
120 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
125 #-----------------------------------------------------------------
126 # Strip executable binaries and shared object files
128 # Requires: find, awk, strip, cut, xargs
130 #%no_install_post_strip 1
131 %__spec_install_post_strip {%{!?debug: \
132 %{!?no_install_post_strip: \
133 %{?verbose:set -x;} \
134 echo "Strip executable binaries and shared object files."; \
135 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
136 elfexelist=`echo $filelist | xargs -r file | \
137 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
138 elfsharedlist=`echo $filelist | xargs -r file | \
139 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
140 if [ -n "$elfexelist" ]; then \
141 strip --remove-section=.note --remove-section=.comment $elfexelist; \
143 if [ -n "$elfsharedlist" ]; then \
144 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
148 %_source_payload w9.gzdio
149 %_binary_payload w9.bzdio
151 #-----------------------------------------------------------------
152 # post %install sequence:
153 # - autodeps exceptions
154 # - compress all man and info pages,
155 # - strip all ELF executables and ELF shared objects if not %debug.
157 ###################################################################
158 # Requires/Provides automation
159 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
160 %__spec_install_pre %{___build_pre}\
161 rm -f %{_builddir}/__rpm_*\
164 %__spec_install_post \
165 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
166 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
167 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
168 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
169 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
170 %{__spec_install_post_strip}\
171 %{__spec_install_post_compress_docs}\
172 %{__arch_install_post}\
173 %{__os_install_post}\
176 %__spec_clean_pre %{___build_pre}\
177 rm -f %{_builddir}/__rpm_*\
181 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
183 #%_noautoreqdep %{nil}
184 #%_noautoprovfiles %{nil}