# Tests by default. No tests: rpmbuild -ba --define 'dotests 0' *.spec
%{!?dotests: %global dotests 1}

Summary: A GNU tool for automatically configuring source code.
Name: autoconf
Version: 2.72
Release: 1
License: GPL
Group: Development/Tools
URL: http://www.gnu.org/software/autoconf
Source: ftp://ftp.gnu.org/gnu/autoconf/%{name}-%{version}.tar.gz

Requires: m4 >= 1.4.19
BuildArchitectures: noarch

%description
GNU's Autoconf is a tool for configuring source code and Makefiles.  Using
Autoconf, programmers can create portable and configurable packages, since the
person building the package is allowed to specify various configuration options.

You should install Autoconf if you are developing software and you'd like to
use it to create shell scripts which will configure your source code packages.
If you are installing Autoconf, you will also need to install the GNU m4
package.

Note that the Autoconf package is not required for the end user who may be
configuring software with an Autoconf-generated script; Autoconf is only
required for the generation of the scripts, not their use.

%prep
%setup -q

%build
export CC="/opt/freeware/bin/gcc -maix64 -O2"
export CXX="/opt/freeware/bin/g++ -maix64 -O2"
export LDFLAGS="-Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -L/opt/freeware/lib64 -L/opt/freeware/lib"
export OBJECT_MODE=64

./configure -v \
            --prefix=%{_prefix} 

gmake %{?_smp_mflags}

if [ "%{dotests}" == 1 ]
then
  (gmake check || true)
fi


%install
rm -rf $RPM_BUILD_ROOT

make prefix=$RPM_BUILD_ROOT%{_prefix} install
mv $RPM_BUILD_ROOT%{_prefix}/share/info $RPM_BUILD_ROOT%{_prefix}

gzip -9nf $RPM_BUILD_ROOT%{_prefix}/info/autoconf.info*

rm -f $RPM_BUILD_ROOT%{_prefix}/info/standards*

cp build-aux/install-sh $RPM_BUILD_ROOT%{_prefix}/share/autoconf

cd $RPM_BUILD_ROOT
mkdir -p usr/bin || true 
mkdir -p usr/share || true 
for file in autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
do
   ln -sf ../..%{_prefix}/bin/$file usr/bin/$file
done
ln -sf ../..%{_prefix}/share/autoconf usr/share/autoconf

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/install-info %{_prefix}/info/autoconf.info.* %{_prefix}/info/dir 2>/dev/null || :

%preun
if [ "$1" = 0 ]; then
  if [ -f %{_prefix}/info/autoconf.info.gz ]; then
    /sbin/install-info --delete %{_prefix}/info/autoconf.info.gz %{_prefix}/info/dir 2>/dev/null || :
  fi
fi

%files
%defattr(-,root,system)
%doc AUTHORS BUGS COPYING INSTALL NEWS README TODO THANKS
%{_prefix}/bin/autoconf
%{_prefix}/bin/autoheader
%{_prefix}/bin/autoreconf
%{_prefix}/bin/autoscan
%{_prefix}/bin/autoupdate
%{_prefix}/bin/autom4te
%{_prefix}/bin/ifnames
%{_prefix}/info/autoconf*
%{_prefix}/share/autoconf

%changelog
* Fri Mar 27 2026 Sumitra Dawn <Sumitra.Dawn@ibm.com> - 2.72-1
- Update to latest version

* Mon Feb 08 2021 Rishita Saha <risaha16@in.ibm.com> - 2.71-1
- Update to version 2.71
- No longer shipping files in /usr 

* Wed Mar 2 2016 Ayappan P <ayappap2@in.ibm.com> 2.69-1
- update to level 2.69

* Fri Sep 7 2012 Raunaq Bathija	<raunaq12@in.ibm.com> 2.63-1
- update to level 2.63

* Fri Apr 22 2005 David Clissold <cliss@austin.ibm.com> 2.59-1
- update to level 2.59
