# run "make check" by default
%bcond_without check

%define prereq_ge()  %(LC_ALL="C" rpm -q --queryformat 'Requires(post):%%{NAME} >= %%{VERSION}' %1| grep -v "is not")

Summary: A GNU tool for automatically configuring source code.
Summary(ja): ソースコードを自動的に設定するための GNU ツール
Name: autoconf
Version: 2.72
Release: 1%{?_dist_release}
Group: programming
Vendor: Project Vine
Distribution: Vine Linux

License: GPL
URL: https://www.gnu.org/software/autoconf/
Source: https://ftp.gnu.org/pub/gnu/autoconf/autoconf-%{version}.tar.xz

# Vine Source(s)
Source10: autoconf-mode-install.sh
Source11: autoconf-mode-remove.sh

Requires(post,preun): /sbin/install-info
Requires: gawk, m4, mktemp, perl, textutils
Obsoletes: autoconf253 < 2.54
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%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
would like to create shell scripts that 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.

%description -l ja
GNU autoconf はソースコードと Makefile を自動的に設定する GNU ツール
です．Autoconf を使えば，プログラマは移植や設定が容易なパッケージを
作ることができます．そのため，パッケージ作成者はさまざまな設定
オプションを指定できます。

ソフトウェアを開発していてソースコードパッケージを設定するシェル
スクリプトを生成したいとお考えなら，Autoconf をインストールしてください．
Autoconf をインストールするためには GNU m4 パッケージもインストールする
必要があります．

Autoconf が生成したスクリプトを使ってソフトウェアを設定するかもしれない
エンドユーザには Autoconf パッケージが必要ないことに注目してください．
Autoconf が必要になるのはスクリプトを生成するときのみで，使うときには
必要ありません．


%package mode
Summary: Emacs-lisp autoconf-mode for autoconf/autotest
Group: programming
BuildRequires: emacs
%prereq_ge emacsen-common
Requires: emacsen

%description mode
Emacs-lisp autoconf-mode for autoconf/autotest


%prep
%setup -q -n autoconf-%{version}


%build
%configure
make %{?_smp_mflags}


%install
rm -rf ${RPM_BUILD_ROOT}
%makeinstall

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

# We don't want to include the standards.info stuff in the package,
# because it comes from binutils...
rm -f ${RPM_BUILD_ROOT}%{_infodir}/standards*
# cp install-sh ${RPM_BUILD_ROOT}%{_datadir}/autoconf

# remove info dir file since it isn't packaged
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir

# move elisp files
pushd ${RPM_BUILD_ROOT}/%{_datadir}/emacs/site-lisp
mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/emacs/site-lisp/autoconf-mode
mv *.el autoconf-mode/
popd

# emacsen-common-ize
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/emacs/site-lisp/autoconf-mode
#mkdir -p $RPM_BUILD_ROOT/%{_libdir}/emacsen-common/packages/install
#mkdir -p $RPM_BUILD_ROOT/%{_libdir}/emacsen-common/packages/remove
mkdir -p $RPM_BUILD_ROOT/%{emacsen_pkgdir}/install
mkdir -p $RPM_BUILD_ROOT/%{emacsen_pkgdir}/remove

%_installemacsenscript autoconf-mode %{SOURCE10} 

%_removeemacsenscript  autoconf-mode %{SOURCE11}

rm -f %{buildroot}%{_datadir}/emacs/site-lisp/auto*-mode.elc


%check
%if %{with check}
make check %{?_smp_mflags}
%endif


%post mode
if [ "$1" = 2 ]; then
%_emacsenPackageRemove autoconf-mode
fi
%_addemacsenlist autoconf-mode
%_emacsenPackageInstall autoconf-mode

%preun mode
if [ "$1" = 0 ]; then
%_emacsenPackageRemove autoconf-mode
%_removeemacsenlist autoconf-mode
fi


%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README THANKS TODO
%{_bindir}/*
%{_infodir}/*.info*
%{_datadir}/autoconf
%{_mandir}/man1/*

%files mode
%defattr(-,root,root)
%{_datadir}/emacs/site-lisp/autoconf-mode/
#/usr/lib/emacsen-common/packages/install/autoconf-mode
#/usr/lib/emacsen-common/packages/remove/autoconf-mode
%{emacsen_pkgdir}/install/autoconf-mode
%{emacsen_pkgdir}/remove/autoconf-mode


%changelog
* Sun Jul 07 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.72-1
- updated to 2.72.

* Wed Feb 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.71-1
- updated to 2.71.
- dropped Patch1 and 3: fixed in upstream.
- updated Patch2.

* Thu Aug 29 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.69-2
- added Patch1-3.

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.69-1
- update to 2.69

* Sun Nov 13 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2.68-1
- new upstream release

* Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> 2.65-2
- rebuilt with rpm-4.8.1-3

* Sun Apr 04 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.65-1
- new upstream release

* Sun Sep 21 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.63-1
- new upstream release
- dropped Patch0 (merged into upstream)

* Wed Sep 10 2008 Shu KONNO <owa@bg.wakwak.com> 2.62-3
- added %%emacsen_pkgdir macro
- spec in utf-8

* Wed Jun 18 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.62-2
- import Patch0 from Fedora 2.62-2
  * Fri Jun 06 2008 Karsten Hopp <karsten@redhat.com> 2.62-2
  - add upstream fix from Eric Blake for #449973, 
    m4_if releated error message from autotest

* Sun May  4 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.62-1
- new upstream release

* Thu Apr 26 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.61-0vl1
- new upstream release

* Tue Sep 12 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.59-2vl4
- changed autoconf-mode Group to Appliations/Editors/Emacs <BTS:VineLinux:163>
- added Japanese summary and description from vinedocs.sourceforge.jp
- s/Copyright/License/

* Wed Feb 25 2004 Tomoya TAKA <taka@vinelinux.org> 2.59-2vl3
- rebuild

* Fri Feb 20 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2.59-2vl2
- rebuild

* Mon Jan 12 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2.59-2vl1
- update to 2.59 bugfix release

* Mon Nov 17 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.58-0vl1
- new upstream release

* Tue Apr 08 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2.57-3vl1
- source update

* Sun Dec 08 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.56-1vl2
- don't show annoying messages during elisp compilation

* Sun Dec 08 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.56-1vl1
- based on 2.56-1 from Rawhide and built for Vine Linux
- emacsen-common-ize

* Mon Nov 18 2002 Jens Petersen <petersen@redhat.com> 2.56-1
- update to 2.56
- obsolete autoheader-warn patch
- no longer provide autoconf253
- include site-lisp and man files
- remove info dir which is not in the manifest
- do not version suffix bin files for now

* Mon Aug 19 2002 Jens Petersen <petersen@redhat.com> 2.53-8
- make check

* Fri Jun 28 2002 Jens Petersen <petersen@redhat.com> 2.53-7
- update url (#66840)
- added doc files

* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.53-6
- automated rebuild

* Sun May 26 2002 Tim Powers <timp@redhat.com> 2.53-5
- automated rebuild

* Mon May 20 2002 Bill Nottingham <notting@redhat.com> 2.53-4
- provide autoconf253

* Thu May 16 2002 Bill Nottingham <notting@redhat.com> 2.53-3
- obsolete autoconf253

* Wed May  8 2002 Jens Petersen <petersen@redhat.com> 2.53-2
- patch autoheader so that --warnings=CATEGORY works (#64566)
  [reported with fix by hjl@gnu.org]

* Tue Apr 23 2002 Jens Petersen <petersen@redhat.com> 2.53-1
- update to autoconf-2.53
- drop mawk patch again
- version suffix bindir files and add symlinks to unversioned names

* Fri Feb  1 2002 Jens Petersen <petersen@redhat.com> 2.52-7
- revert to 2.52 (also fixes #58210!)
- remove relversion variable
- bring back mawk -> gawk patch

* Wed Jan 09 2002 Tim Powers <timp@redhat.com> 2.52-6
- automated rebuild

* Thu Dec 20 2001 Jens Petersen <petersen@redhat.com> 2.52-5
- update to 2.52f
- add URL
- minor description improvements
- define relversion to carry version number
- mawk.patch no longer needed

* Sat Nov 17 2001 Florian La Roche <Florian.LaRoche@redhat.de> 2.52-4
- rebuild

* Wed Sep 19 2001 Jens Petersen <petersen@redhat.com> 2.52-3
- restore patch to prefer gawk to mawk

* Tue Sep 18 2001 Florian La Roche <Florian.LaRoche@redhat.de> 2.52-2
- update to 2.52d

* Mon Sep 17 2001 Jens Petersen <petersen@redhat.com> 2.52-1
- update to 2.52
- remove obsolete patches, since already new version
- dont install install-sh

* Tue Jul 10 2001 Jens Petersen <petersen@redhat.com>
- add patch to include various standard C headers as needed
  by various autoconf tests (#19114)
- add patch to autoscan.pl to get a better choice of init
  file (#42071), to test for CPP after CC (#42072) and to
  detect C++ source and g++ (#42073).

* Tue Jun 26 2001 Jens Petersen <petersen@redhat.com>
- Add a back-port of _AC_PROG_CXX_EXIT_DECLARATION
  from version 2.50 to make detection of C++ exit()
  declaration prototype platform independent.  The check is
  done in AC_PROG_CXX with the result stored in "confdefs.h".
  The exit() prototype in AC_TRY_RUN_NATIVE is no longer needed.
  (fixes #18829)

* Wed Nov 29 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix up interoperability with glibc 2.2 and gcc 2.96:
  AC_TRY_RUN_NATIVE in C++ mode added a prototype for exit() to
  the test code without throwing an exception, causing a conflict
  with stdlib.h --> AC_TRY_RUN_NATIVE for C++ code including stdlib.h
  always failed, returning wrong results

* Fri Jul 21 2000 Nalin Dahyabhai <nalin@redhat.com>
- add textutils as a dependency (#14439)

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jun  5 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.

* Sun Mar 26 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- fix preun

* Fri Mar 26 1999 Cristian Gafton <gafton@redhat.com>
- add patch to help autoconf clean after itself and not leave /tmp clobbered
  with acin.* and acout.* files (can you say annoying?)

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 4)
- use gawk, not mawk

* Thu Mar 18 1999 Preston Brown <pbrown@redhat.com>
- moved /usr/lib/autoconf to /usr/share/autoconf (with automake)

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Tue Jan 12 1999 Jeff Johnson <jbj@redhat.com>
- update to 2.13.

* Fri Dec 18 1998 Cristian Gafton <gafton@redhat.com>
- build against glibc 2.1

* Mon Oct 05 1998 Cristian Gafton <gafton@redhat.com>
- requires perl

* Thu Aug 27 1998 Cristian Gafton <gafton@redhat.com>
- patch for fixing /tmp race conditions

* Sun Oct 19 1997 Erik Troan <ewt@redhat.com>
- spec file cleanups
- made a noarch package
- uses autoconf
- uses install-info

* Thu Jul 17 1997 Erik Troan <ewt@redhat.com>
- built with glibc

