]>
Commit | Line | Data |
---|---|---|
14d4c7d9 JB |
1 | #----------------------------------------------------------------- |
2 | # CFLAGS and LDFLAGS used to build | |
3 | ||
4 | %debugcflags -O0 -g | |
5 | %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags} | |
6 | %rpmldflags %{!?debug:-s} | |
7 | ||
950d2f74 | 8 | #----------------------------------------------------------------- |
9 | %configure { \ | |
10 | if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ | |
14d4c7d9 JB |
11 | LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \ |
12 | CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \ | |
13 | CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \ | |
14 | FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \ | |
950d2f74 | 15 | ./configure %{_target_platform} \ |
16 | --prefix=%{_prefix} \ | |
17 | --exec-prefix=%{_exec_prefix} \ | |
18 | --bindir=%{_bindir} \ | |
19 | --sbindir=%{_sbindir} \ | |
20 | --sysconfdir=%{_sysconfdir} \ | |
21 | --datadir=%{_datadir} \ | |
22 | --includedir=%{_includedir} \ | |
23 | --libdir=%{_libdir} \ | |
24 | --libexecdir=%{_libexecdir} \ | |
25 | --localstatedir=%{_localstatedir} \ | |
26 | --sharedstatedir=%{_sharedstatedir} \ | |
27 | --mandir=%{_mandir} \ | |
3dd68d85 | 28 | --infodir=%{_infodir} \ |
29 | } | |
950d2f74 | 30 | |
42dc0d85 AF |
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. | |
38 | # | |
39 | # Based on autogen.sh from GNOME and orginal GNUconfigure | |
40 | # | |
41 | %GNUconfigure(MCs:) \ | |
8dec30a1 AF |
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}` \ | |
42dc0d85 AF |
45 | do \ |
46 | dr=`dirname ${coin}`; \ | |
47 | if test -f ${dr}/NO-AUTO-GEN; then \ | |
48 | : \ | |
49 | else \ | |
50 | macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \ | |
51 | ( cd ${dr}; \ | |
52 | aclocalinclude="${ACLOCAL_FLAGS}"; \ | |
53 | for k in ${macrodirs}; do \ | |
54 | if test -d ${k}; then \ | |
55 | aclocalinclude="${aclocalinclude} -I ${k}"; \ | |
56 | ##else \ | |
57 | ## echo "**Warning**: No such directory \`${k}'. Ignored." \ | |
58 | fi \ | |
59 | done \ | |
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 \ | |
63 | else \ | |
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; \ | |
67 | fi \ | |
68 | fi \ | |
69 | if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \ | |
70 | %{__libtoolize} --force --copy; \ | |
71 | fi \ | |
72 | aclocal ${aclocalinclude}; \ | |
73 | if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \ | |
74 | %{__autoheader}; \ | |
75 | fi \ | |
76 | echo "Running automake --gnu ${am_opt} ..."; \ | |
77 | %{__automake} --add-missing --gnu ${am_opt}; \ | |
78 | %{__autoconf}; \ | |
79 | ); \ | |
80 | fi \ | |
81 | done \ | |
466db1d5 | 82 | %{-C:${_mydir}}%{!-C:.}/%{configure} \ |
1d2b3165 AF |
83 | %{-C:cd ${_mydir}; unset _mydir} |
84 | ||
7f97bd68 AF |
85 | # Location of autoconf macros |
86 | %_aclocaldir %(aclocal --print-ac-dir) | |
87 | ||
84021f4f | 88 | # Location of top applink dir |
7f97bd68 AF |
89 | %_applnkdir /usr/X11R6/share/applnk |
90 | ||
84021f4f | 91 | # Location pixmaps for applnk/desktop files |
92 | %_pixmapsdir /usr/X11R6/share/pixmaps | |
93 | ||
7f97bd68 AF |
94 | # Current date |
95 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
1b129f75 | 96 | |
7f97bd68 AF |
97 | # tmp directory |
98 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
b7cc3986 SZ |
99 | |
100 | # Example files, programs, scripts... | |
101 | %_examplesdir /usr/src/examples | |
102 | ||
ddee0a8f | 103 | # If non-empty "debug" macro defined, add "dbg" suffix to release number |
104 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm | |
33befaf9 | 105 | |
3dd68d85 | 106 | #----------------------------------------------------------------- |
107 | # find and gzip all files in %{_mandir} and %{infodir} | |
108 | # | |
109 | # Requires: xargs, find | |
110 | # | |
385aab94 | 111 | #%no_install_post_compress_docs 1 |
3dd68d85 | 112 | %__spec_install_post_compress_docs { \ |
65fdfa82 | 113 | echo "Compress man and info pages."; \ |
385aab94 | 114 | %{!?no_install_post_compress_docs: \ |
89092b54 | 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; \ | |
89092b54 | 120 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ |
89092b54 | 121 | fi; \ |
122 | done; \ | |
34cb90c5 | 123 | } } |
3dd68d85 | 124 | |
125 | #----------------------------------------------------------------- | |
ebf0c274 | 126 | # Strip executable binaries and shared object files |
3dd68d85 | 127 | # |
65fdfa82 | 128 | # Requires: find, awk, strip, cut, xargs |
3dd68d85 | 129 | # |
385aab94 | 130 | #%no_install_post_strip 1 |
65fdfa82 | 131 | %__spec_install_post_strip {%{!?debug: \ |
385aab94 | 132 | %{!?no_install_post_strip: \ |
65fdfa82 | 133 | %{?verbose:set -x;} \ |
134 | echo "Strip executable binaries and shared object files."; \ | |
8a472031 | 135 | filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \ |
65fdfa82 | 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; \ | |
142 | fi; \ | |
143 | if [ -n "$elfsharedlist" ]; then \ | |
144 | strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ | |
145 | fi; } \ | |
34cb90c5 | 146 | } } |
3dd68d85 | 147 | |
14d4c7d9 JB |
148 | %_source_payload w9.gzdio |
149 | %_binary_payload w9.bzdio | |
150 | ||
3dd68d85 | 151 | #----------------------------------------------------------------- |
152 | # post %install sequence: | |
14d4c7d9 | 153 | # - autodeps exceptions |
3dd68d85 | 154 | # - compress all man and info pages, |
155 | # - strip all ELF executables and ELF shared objects if not %debug. | |
e0061d15 JK |
156 | |
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_*\ | |
162 | %{nil} | |
163 | ||
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 }\ | |
14d4c7d9 JB |
170 | %{__spec_install_post_strip}\ |
171 | %{__spec_install_post_compress_docs}\ | |
e0061d15 JK |
172 | %{__arch_install_post}\ |
173 | %{__os_install_post}\ | |
174 | %{nil} | |
175 | ||
176 | %__spec_clean_pre %{___build_pre}\ | |
177 | rm -f %{_builddir}/__rpm_*\ | |
178 | %{nil} | |
179 | ||
180 | ||
181 | #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*" | |
182 | #%_noautoreq %{nil} | |
183 | #%_noautoreqdep %{nil} | |
184 | #%_noautoprovfiles %{nil} | |
185 | #%_noautoprov %{nil} | |
186 | ||
187 |