]>
Commit | Line | Data |
---|---|---|
cd33aab7 AM |
1 | #----------------------------------------------------------------- |
2 | # CFLAGS and LDFLAGS used to build | |
3 | ||
4 | %debugcflags -O0 -g | |
5 | %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags} | |
6 | %rpmldflags %{!?debug:-s} | |
7 | ||
8 | #----------------------------------------------------------------- | |
9 | %configure { \ | |
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 \ | |
fa74a11c | 16 | --host=%{_target_platform} \ |
cd33aab7 AM |
17 | --prefix=%{_prefix} \ |
18 | --exec-prefix=%{_exec_prefix} \ | |
19 | --bindir=%{_bindir} \ | |
20 | --sbindir=%{_sbindir} \ | |
21 | --sysconfdir=%{_sysconfdir} \ | |
22 | --datadir=%{_datadir} \ | |
23 | --includedir=%{_includedir} \ | |
24 | --libdir=%{_libdir} \ | |
25 | --libexecdir=%{_libexecdir} \ | |
26 | --localstatedir=%{_localstatedir} \ | |
27 | --sharedstatedir=%{_sharedstatedir} \ | |
28 | --mandir=%{_mandir} \ | |
29 | --infodir=%{_infodir} \ | |
30 | } | |
31 | ||
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. | |
39 | # | |
40 | # Based on autogen.sh from GNOME and orginal GNUconfigure | |
41 | # | |
42 | %GNUconfigure(MCs:) \ | |
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}` \ | |
46 | do \ | |
47 | dr=`dirname ${coin}`; \ | |
48 | if test -f ${dr}/NO-AUTO-GEN; then \ | |
49 | : \ | |
50 | else \ | |
51 | macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \ | |
52 | ( cd ${dr}; \ | |
53 | aclocalinclude="${ACLOCAL_FLAGS}"; \ | |
54 | for k in ${macrodirs}; do \ | |
55 | if test -d ${k}; then \ | |
56 | aclocalinclude="${aclocalinclude} -I ${k}"; \ | |
57 | ##else \ | |
58 | ## echo "**Warning**: No such directory \`${k}'. Ignored." \ | |
59 | fi \ | |
60 | done \ | |
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 \ | |
64 | else \ | |
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; \ | |
68 | fi \ | |
69 | fi \ | |
70 | if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \ | |
71 | %{__libtoolize} --force --copy; \ | |
72 | fi \ | |
73 | aclocal ${aclocalinclude}; \ | |
74 | if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \ | |
75 | %{__autoheader}; \ | |
76 | fi \ | |
77 | echo "Running automake --gnu ${am_opt} ..."; \ | |
78 | %{__automake} --add-missing --gnu ${am_opt}; \ | |
79 | %{__autoconf}; \ | |
80 | ); \ | |
81 | fi \ | |
82 | done \ | |
83 | %{-C:${_mydir}}%{!-C:.}/%{configure} \ | |
84 | %{-C:cd ${_mydir}; unset _mydir} | |
85 | ||
86 | # Location of autoconf macros | |
87 | %_aclocaldir %(aclocal --print-ac-dir) | |
88 | ||
c5eece2c | 89 | # Location of pkgconfig files |
895ccc5b | 90 | %_pkgconfigdir /usr/lib/pkgconfig |
c5eece2c | 91 | |
cd33aab7 AM |
92 | # Location of top applink dir |
93 | %_applnkdir /usr/X11R6/share/applnk | |
94 | ||
95 | # Location pixmaps for applnk/desktop files | |
96 | %_pixmapsdir /usr/X11R6/share/pixmaps | |
97 | ||
c5eece2c JB |
98 | # Location of fonts directories |
99 | %_fontsdir /usr/share/fonts | |
100 | ||
cd33aab7 AM |
101 | # Current date |
102 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
103 | ||
104 | # tmp directory | |
105 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
106 | ||
107 | # Example files, programs, scripts... | |
108 | %_examplesdir /usr/src/examples | |
109 | ||
110 | # If non-empty "debug" macro defined, add "dbg" suffix to release number | |
111 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm | |
112 | ||
113 | #----------------------------------------------------------------- | |
114 | # find and gzip all files in %{_mandir} and %{infodir} | |
115 | # | |
116 | # Requires: xargs, find | |
117 | # | |
118 | #%no_install_post_compress_docs 1 | |
119 | %__spec_install_post_compress_docs { \ | |
120 | echo "Compress man and info pages."; \ | |
121 | %{!?no_install_post_compress_docs: \ | |
122 | %{?verbose:set -x;} \ | |
123 | for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \ | |
124 | if [ -d "$RPM_BUILD_ROOT$i" ]; then \ | |
125 | find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \ | |
126 | find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \ | |
127 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ | |
128 | fi; \ | |
129 | done; \ | |
130 | } } | |
131 | ||
132 | #----------------------------------------------------------------- | |
133 | # Strip executable binaries and shared object files | |
134 | # | |
135 | # Requires: find, awk, strip, cut, xargs | |
136 | # | |
137 | #%no_install_post_strip 1 | |
138 | %__spec_install_post_strip {%{!?debug: \ | |
139 | %{!?no_install_post_strip: \ | |
140 | %{?verbose:set -x;} \ | |
141 | echo "Strip executable binaries and shared object files."; \ | |
142 | filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \ | |
143 | elfexelist=`echo $filelist | xargs -r file | \ | |
144 | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \ | |
145 | elfsharedlist=`echo $filelist | xargs -r file | \ | |
146 | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \ | |
147 | if [ -n "$elfexelist" ]; then \ | |
148 | strip --remove-section=.note --remove-section=.comment $elfexelist; \ | |
149 | fi; \ | |
150 | if [ -n "$elfsharedlist" ]; then \ | |
151 | strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ | |
152 | fi; } \ | |
153 | } } | |
154 | ||
155 | %_source_payload w9.gzdio | |
156 | %_binary_payload w9.bzdio | |
157 | ||
158 | #----------------------------------------------------------------- | |
159 | # post %install sequence: | |
160 | # - autodeps exceptions | |
161 | # - compress all man and info pages, | |
162 | # - strip all ELF executables and ELF shared objects if not %debug. | |
163 | ||
164 | ################################################################### | |
165 | # Requires/Provides automation | |
166 | # exceptions system by Jacek Konieczny <jajcus@pld.org.pl> | |
167 | %__spec_install_pre %{___build_pre}\ | |
168 | rm -f %{_builddir}/__rpm_*\ | |
169 | %{nil} | |
170 | ||
171 | %__spec_install_post \ | |
172 | %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\ | |
173 | %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\ | |
174 | %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\ | |
175 | %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\ | |
176 | %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\ | |
177 | %{__spec_install_post_strip}\ | |
178 | %{__spec_install_post_compress_docs}\ | |
179 | %{__arch_install_post}\ | |
180 | %{__os_install_post}\ | |
181 | %{nil} | |
182 | ||
183 | %__spec_clean_pre %{___build_pre}\ | |
184 | rm -f %{_builddir}/__rpm_*\ | |
185 | %{nil} | |
186 | ||
187 | ||
188 | #%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*" | |
189 | #%_noautoreq %{nil} | |
190 | #%_noautoreqdep %{nil} | |
191 | #%_noautoprovfiles %{nil} | |
192 | #%_noautoprov %{nil} | |
193 | ||
194 |