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 top applink dir
90 %_applnkdir /usr/X11R6/share/applnk
92 # Location pixmaps for applnk/desktop files
93 %_pixmapsdir /usr/X11R6/share/pixmaps
96 %date %(LC_ALL="C" date +"%a %b %d %Y")
99 %tmpdir %(echo "${TMPDIR:-/tmp}")
101 # Example files, programs, scripts...
102 %_examplesdir /usr/src/examples
104 # If non-empty "debug" macro defined, add "dbg" suffix to release number
105 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
107 #-----------------------------------------------------------------
108 # find and gzip all files in %{_mandir} and %{infodir}
110 # Requires: xargs, find
112 #%no_install_post_compress_docs 1
113 %__spec_install_post_compress_docs { \
114 echo "Compress man and info pages."; \
115 %{!?no_install_post_compress_docs: \
116 %{?verbose:set -x;} \
117 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
118 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
119 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
120 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
121 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
126 #-----------------------------------------------------------------
127 # Strip executable binaries and shared object files
129 # Requires: find, awk, strip, cut, xargs
131 #%no_install_post_strip 1
132 %__spec_install_post_strip {%{!?debug: \
133 %{!?no_install_post_strip: \
134 %{?verbose:set -x;} \
135 echo "Strip executable binaries and shared object files."; \
136 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
137 elfexelist=`echo $filelist | xargs -r file | \
138 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
139 elfsharedlist=`echo $filelist | xargs -r file | \
140 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
141 if [ -n "$elfexelist" ]; then \
142 strip --remove-section=.note --remove-section=.comment $elfexelist; \
144 if [ -n "$elfsharedlist" ]; then \
145 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
149 %_source_payload w9.gzdio
150 %_binary_payload w9.bzdio
152 #-----------------------------------------------------------------
153 # post %install sequence:
154 # - autodeps exceptions
155 # - compress all man and info pages,
156 # - strip all ELF executables and ELF shared objects if not %debug.
158 ###################################################################
159 # Requires/Provides automation
160 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
161 %__spec_install_pre %{___build_pre}\
162 rm -f %{_builddir}/__rpm_*\
165 %__spec_install_post \
166 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
167 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
168 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
169 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
170 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
171 %{__spec_install_post_strip}\
172 %{__spec_install_post_compress_docs}\
173 %{__arch_install_post}\
174 %{__os_install_post}\
177 %__spec_clean_pre %{___build_pre}\
178 rm -f %{_builddir}/__rpm_*\
182 #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
184 #%_noautoreqdep %{nil}
185 #%_noautoprovfiles %{nil}