]>
Commit | Line | Data |
---|---|---|
aaa6895a | 1 | #----------------------------------------------------------------- |
2 | %configure { \ | |
3 | if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ | |
4 | LDFLAGS="${LDFLAGS}%{!?debug: -s}" ; export LDFLAGS ; \ | |
5 | CFLAGS="${CFLAGS:-%optflags}%{?debug: -g -O}" ; export CFLAGS ; \ | |
6 | CXXFLAGS="${CXXFLAGS:-%optflags}%{?debug: -g -O}" ; export CXXFLAGS ; \ | |
7 | FFLAGS="${FFLAGS:-%optflags}%{?debug: -g -O}" ; export FFLAGS ; \ | |
aaa6895a | 8 | ./configure %{_target_platform} \ |
9 | --prefix=%{_prefix} \ | |
10 | --exec-prefix=%{_exec_prefix} \ | |
11 | --bindir=%{_bindir} \ | |
12 | --sbindir=%{_sbindir} \ | |
13 | --sysconfdir=%{_sysconfdir} \ | |
14 | --datadir=%{_datadir} \ | |
15 | --includedir=%{_includedir} \ | |
16 | --libdir=%{_libdir} \ | |
17 | --libexecdir=%{_libexecdir} \ | |
18 | --localstatedir=%{_localstatedir} \ | |
19 | --sharedstatedir=%{_sharedstatedir} \ | |
20 | --mandir=%{_mandir} \ | |
ddb6f826 | 21 | --infodir=%{_infodir} \ |
22 | } | |
aaa6895a | 23 | |
35f40bec AF |
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. | |
31 | # | |
32 | # Based on autogen.sh from GNOME and orginal GNUconfigure | |
33 | # | |
34 | %GNUconfigure(MCs:) \ | |
d6f89cbe AF |
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}` \ | |
35f40bec AF |
38 | do \ |
39 | dr=`dirname ${coin}`; \ | |
40 | if test -f ${dr}/NO-AUTO-GEN; then \ | |
41 | : \ | |
42 | else \ | |
43 | macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \ | |
44 | ( cd ${dr}; \ | |
45 | aclocalinclude="${ACLOCAL_FLAGS}"; \ | |
46 | for k in ${macrodirs}; do \ | |
47 | if test -d ${k}; then \ | |
48 | aclocalinclude="${aclocalinclude} -I ${k}"; \ | |
49 | ##else \ | |
50 | ## echo "**Warning**: No such directory \`${k}'. Ignored." \ | |
51 | fi \ | |
52 | done \ | |
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 \ | |
56 | else \ | |
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; \ | |
60 | fi \ | |
61 | fi \ | |
62 | if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \ | |
63 | %{__libtoolize} --force --copy; \ | |
64 | fi \ | |
65 | aclocal ${aclocalinclude}; \ | |
66 | if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \ | |
67 | %{__autoheader}; \ | |
68 | fi \ | |
69 | echo "Running automake --gnu ${am_opt} ..."; \ | |
70 | %{__automake} --add-missing --gnu ${am_opt}; \ | |
71 | %{__autoconf}; \ | |
72 | ); \ | |
73 | fi \ | |
74 | done \ | |
5f7bb560 | 75 | %{-C:${_mydir}}%{!-C:.}/%{configure} \ |
77f26b17 AF |
76 | %{-C:cd ${_mydir}; unset _mydir} |
77 | ||
4703c2f4 AF |
78 | # Location of autoconf macros |
79 | %_aclocaldir %(aclocal --print-ac-dir) | |
80 | ||
61486e21 | 81 | # Location of top applink dir |
4703c2f4 AF |
82 | %_applnkdir /usr/X11R6/share/applnk |
83 | ||
61486e21 | 84 | # Location pixmaps for applnk/desktop files |
85 | %_pixmapsdir /usr/X11R6/share/pixmaps | |
86 | ||
4703c2f4 AF |
87 | # Current date |
88 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
cb18eb1c | 89 | |
4703c2f4 AF |
90 | # tmp directory |
91 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
16c9dd8b SZ |
92 | |
93 | # Example files, programs, scripts... | |
94 | %_examplesdir /usr/src/examples | |
95 | ||
96 | # Find-requires and directories excluded from auto-req | |
97 | %_noautoreqdir %{_defaultdocdir} %{_examplesdir} | |
98 | %_noautoreqdep %{nil} | |
8c211fa7 SZ |
99 | #%__find_requires_pre /usr/lib/rpm/find-requires-pre %{_noautoreqdir} |
100 | #%__find_requires_core /usr/lib/rpm/find-requires | |
101 | #%__find_requires_post /usr/lib/rpm/find-requires-post | |
102 | #%__find_requires %{__find_requires_pre} | %{__find_requires_core} | %{__find_requires_post} | |
16c9dd8b | 103 | |
f4b256a1 | 104 | # If non-empty "debug" macro defined, add "dbg" suffix to release number |
105 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm | |
2b1f7eff | 106 | |
ddb6f826 | 107 | #----------------------------------------------------------------- |
108 | # find and gzip all files in %{_mandir} and %{infodir} | |
109 | # | |
110 | # Requires: xargs, find | |
111 | # | |
a91ad004 | 112 | #%no_install_post_compress_docs 1 |
ddb6f826 | 113 | %__spec_install_post_compress_docs { \ |
021f95aa | 114 | echo "Compress man and info pages."; \ |
a91ad004 | 115 | %{!?no_install_post_compress_docs: \ |
0d2f4c96 | 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; \ | |
0d2f4c96 | 121 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ |
0d2f4c96 | 122 | fi; \ |
123 | done; \ | |
315400bc | 124 | } \ |
ddb6f826 | 125 | } |
126 | ||
127 | #----------------------------------------------------------------- | |
6893305c | 128 | # Strip executable binaries and shared object files |
ddb6f826 | 129 | # |
021f95aa | 130 | # Requires: find, awk, strip, cut, xargs |
ddb6f826 | 131 | # |
a91ad004 | 132 | #%no_install_post_strip 1 |
021f95aa | 133 | %__spec_install_post_strip {%{!?debug: \ |
a91ad004 | 134 | %{!?no_install_post_strip: \ |
021f95aa | 135 | %{?verbose:set -x;} \ |
136 | echo "Strip executable binaries and shared object files."; \ | |
137 | filelist=`find $RPM_BUILD_ROOT -type f`; \ | |
138 | elfexelist=`echo $filelist | xargs -r file | \ | |
139 | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \ | |
140 | elfsharedlist=`echo $filelist | xargs -r file | \ | |
141 | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \ | |
142 | if [ -n "$elfexelist" ]; then \ | |
143 | strip --remove-section=.note --remove-section=.comment $elfexelist; \ | |
144 | fi; \ | |
145 | if [ -n "$elfsharedlist" ]; then \ | |
146 | strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ | |
147 | fi; } \ | |
0d2f4c96 | 148 | } \ |
ddb6f826 | 149 | } |
150 | ||
151 | #----------------------------------------------------------------- | |
152 | # post %install sequence: | |
153 | # - compress all man and info pages, | |
154 | # - strip all ELF executables and ELF shared objects if not %debug. | |
155 | # | |
156 | %__spec_install_post { \ | |
021f95aa | 157 | %{__spec_install_post_strip} \ |
158 | %{__spec_install_post_compress_docs} \ | |
ddb6f826 | 159 | } |
59d32fb5 | 160 | |
161 | %_source_payload w9.gzdio | |
162 | %_binary_payload w9.bzdio |