1 | # |
---|
2 | # Please send bugfixes or comments to |
---|
3 | # http://www.rtems.org/bugzilla |
---|
4 | # |
---|
5 | |
---|
6 | %define _prefix /opt/rtems-4.10 |
---|
7 | %define _exec_prefix %{_prefix} |
---|
8 | %define _bindir %{_exec_prefix}/bin |
---|
9 | %define _sbindir %{_exec_prefix}/sbin |
---|
10 | %define _libexecdir %{_exec_prefix}/libexec |
---|
11 | %define _datarootdir %{_prefix}/share |
---|
12 | %define _datadir %{_datarootdir} |
---|
13 | %define _sysconfdir %{_prefix}/etc |
---|
14 | %define _sharedstatedir %{_prefix}/com |
---|
15 | %define _localstatedir %{_prefix}/var |
---|
16 | %define _includedir %{_prefix}/include |
---|
17 | %define _libdir %{_exec_prefix}/%{_lib} |
---|
18 | %define _mandir %{_datarootdir}/man |
---|
19 | %define _infodir %{_datarootdir}/info |
---|
20 | %define _localedir %{_datarootdir}/locale |
---|
21 | |
---|
22 | %ifos cygwin cygwin32 mingw mingw32 |
---|
23 | %define _exeext .exe |
---|
24 | %define debug_package %{nil} |
---|
25 | %define _libdir %{_exec_prefix}/lib |
---|
26 | %else |
---|
27 | %define _exeext %{nil} |
---|
28 | %endif |
---|
29 | |
---|
30 | %ifos cygwin cygwin32 |
---|
31 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
32 | %endif |
---|
33 | |
---|
34 | %ifos mingw mingw32 |
---|
35 | %if %{defined _mingw32_cflags} |
---|
36 | %define optflags %{_mingw32_cflags} |
---|
37 | %else |
---|
38 | %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields |
---|
39 | %endif |
---|
40 | %endif |
---|
41 | |
---|
42 | %if "%{_build}" != "%{_host}" |
---|
43 | %define _host_rpmprefix %{_host}- |
---|
44 | %else |
---|
45 | %define _host_rpmprefix %{nil} |
---|
46 | %endif |
---|
47 | |
---|
48 | %define srcvers 2.68 |
---|
49 | %define rpmvers %{expand:%(echo "2.68" | tr - _ )} |
---|
50 | |
---|
51 | %define name rtems-4.10-autoconf |
---|
52 | |
---|
53 | # --with alltests enable all tests |
---|
54 | %bcond_with alltests |
---|
55 | |
---|
56 | Name: %{name} |
---|
57 | License: GPL |
---|
58 | URL: http://www.gnu.org/software/autoconf |
---|
59 | Group: Development/Tools |
---|
60 | Version: %{rpmvers} |
---|
61 | Release: 2%{?dist} |
---|
62 | Summary: Tool for automatically generating GNU style Makefile.in's |
---|
63 | |
---|
64 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
65 | BuildArch: noarch |
---|
66 | BuildRequires: perl m4 gawk emacs |
---|
67 | %if "%{version}" >= "2.62" |
---|
68 | BuildRequires: m4 >= 1.4.5 |
---|
69 | %endif |
---|
70 | Requires: m4 gawk |
---|
71 | Requires(post): /sbin/install-info |
---|
72 | Requires(preun): /sbin/install-info |
---|
73 | |
---|
74 | Source0: ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{srcvers}.tar.bz2 |
---|
75 | %if "%{srcvers}" == "2.66" |
---|
76 | # Fedora's patch to fix |
---|
77 | # http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html |
---|
78 | # http://lists.gnu.org/archive/html/bug-autoconf/2010-07/msg00012.html |
---|
79 | Patch0: autoconf-2.66-611661.diff |
---|
80 | %endif |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | %description |
---|
85 | GNU's Autoconf is a tool for configuring source code and Makefiles. |
---|
86 | Using Autoconf, programmers can create portable and configurable |
---|
87 | packages, since the person building the package is allowed to |
---|
88 | specify various configuration options. |
---|
89 | You should install Autoconf if you are developing software and you'd |
---|
90 | like to use it to create shell scripts which will configure your |
---|
91 | source code packages. |
---|
92 | Note that the Autoconf package is not required for the end user who |
---|
93 | may be configuring software with an Autoconf-generated script; |
---|
94 | Autoconf is only required for the generation of the scripts, not |
---|
95 | their use. |
---|
96 | |
---|
97 | %prep |
---|
98 | %setup -q -n autoconf-%{srcvers} |
---|
99 | %{?PATCH0:%patch0 -p1} |
---|
100 | |
---|
101 | # Work around rpm inserting bogus perl-module deps |
---|
102 | cat << \EOF > %{name}-prov |
---|
103 | #!/bin/sh |
---|
104 | %{__perl_provides} $* |\ |
---|
105 | sed -e '/^perl(Autom4te/d' |
---|
106 | EOF |
---|
107 | %define __perl_provides %{_builddir}/autoconf-%{srcvers}/%{name}-prov |
---|
108 | chmod +x %{__perl_provides} |
---|
109 | |
---|
110 | cat << \EOF > %{name}-requ |
---|
111 | #!/bin/sh |
---|
112 | %{__perl_requires} $* |\ |
---|
113 | sed -e '/^perl(Autom4te/d' |
---|
114 | EOF |
---|
115 | %define __perl_requires %{_builddir}/autoconf-%{srcvers}/%{name}-requ |
---|
116 | chmod +x %{__perl_requires} |
---|
117 | |
---|
118 | %build |
---|
119 | ./configure --prefix=%{_prefix} --infodir=%{_infodir} --mandir=%{_mandir} \ |
---|
120 | --bindir=%{_bindir} --datadir=%{_datadir} |
---|
121 | make |
---|
122 | |
---|
123 | %check |
---|
124 | %if "%{_build}" == "%{_host}" |
---|
125 | %if "%{srcvers}" <= "2.66" |
---|
126 | # test 193 fails sporadically |
---|
127 | # test 199 fails deterministically |
---|
128 | TESTSUITEFLAGS='-192 194-198 200-' |
---|
129 | %endif |
---|
130 | |
---|
131 | %if "%{srcvers}" == "2.67" |
---|
132 | # test 199 fails deterministically |
---|
133 | TESTSUITEFLAGS='-198 200-' |
---|
134 | %endif |
---|
135 | |
---|
136 | %if "%{srcvers}" == "2.68" |
---|
137 | # test 205 fails deterministically |
---|
138 | TESTSUITEFLAGS='-204 206-' |
---|
139 | %endif |
---|
140 | |
---|
141 | make check %{!?with_alltests:TESTSUITEFLAGS="${TESTSUITEFLAGS}"} |
---|
142 | %endif |
---|
143 | |
---|
144 | %install |
---|
145 | rm -rf "${RPM_BUILD_ROOT}" |
---|
146 | make DESTDIR=${RPM_BUILD_ROOT} install |
---|
147 | |
---|
148 | # Create this directory to prevent the corresponding line |
---|
149 | # in %%files below to fail |
---|
150 | mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp |
---|
151 | |
---|
152 | # RTEMS's standards.info comes from binutils |
---|
153 | rm -f $RPM_BUILD_ROOT%{_infodir}/standards.info* |
---|
154 | |
---|
155 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
156 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
157 | |
---|
158 | # Extract %%__os_install_post into os_install_post~ |
---|
159 | cat << \EOF > os_install_post~ |
---|
160 | %__os_install_post |
---|
161 | EOF |
---|
162 | |
---|
163 | # Generate customized brp-*scripts |
---|
164 | cat os_install_post~ | while read a x y; do |
---|
165 | case $a in |
---|
166 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
167 | */brp-strip*) |
---|
168 | b=$(basename $a) |
---|
169 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
170 | chmod a+x $b |
---|
171 | ;; |
---|
172 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
173 | */brp-compress*) |
---|
174 | b=$(basename $a) |
---|
175 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
176 | chmod a+x $b |
---|
177 | ;; |
---|
178 | esac |
---|
179 | done |
---|
180 | |
---|
181 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
182 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
183 | < os_install_post~ > os_install_post |
---|
184 | %define __os_install_post . ./os_install_post |
---|
185 | |
---|
186 | %clean |
---|
187 | rm -rf $RPM_BUILD_ROOT |
---|
188 | |
---|
189 | %post |
---|
190 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz ||: |
---|
191 | |
---|
192 | %preun |
---|
193 | if [ $1 -eq 0 ]; then |
---|
194 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz ||: |
---|
195 | fi |
---|
196 | |
---|
197 | %files |
---|
198 | %defattr(-,root,root) |
---|
199 | # %doc AUTHORS COPYING ChangeLog NEWS README THANKS |
---|
200 | %dir %{_bindir} |
---|
201 | %{_bindir}/* |
---|
202 | %dir %{_infodir} |
---|
203 | %ghost %{_infodir}/dir |
---|
204 | |
---|
205 | %{_infodir}/autoconf.info* |
---|
206 | %dir %{_mandir} |
---|
207 | %dir %{_mandir}/man1 |
---|
208 | %{_mandir}/man1/* |
---|
209 | %dir %{_datadir} |
---|
210 | %{_datadir}/autoconf |
---|
211 | %exclude %{_datadir}/emacs/site-lisp |
---|