Package bison: Specfile

Name: bison
Version: 3.7.6
Release: alt1

Summary: A GNU general-purpose parser generator
License: GPLv3+
Group: Development/Other
Url: https://www.gnu.org/software/bison/

%define srcname %name-%version-%release
# git://git.altlinux.org/people/ldv/packages/bison refs/heads/master
Source0: %srcname.tar
# git://git.altlinux.org/people/ldv/packages/bison refs/heads/po-current
Source1: po-%version-%release.tar
# git://git.altlinux.org/people/ldv/packages/bison refs/heads/runtime-po-current
Source2: runtime-po-%version-%release.tar

Requires: m4 >= 0:1.4
Requires: %name-runtime = %version-%release
Provides: byacc = %version-%release
Obsoletes: byacc

BuildRequires: flex, gcc-c++, gperf, help2man, makeinfo
BuildRequires: gnulib >= 0.1.4516.e639e5

%description
Bison is a general purpose parser generator which converts a grammar
description for an LALR(1) context-free grammar into a C program to
parse that grammar.  Bison can be used to develop a wide range of
language parsers, from ones used in simple desk calculators to complex
programming languages.  Bison is upwardly compatible with Yacc, so any
correctly written Yacc grammar should work with Bison without any
changes.  If you know Yacc, you shouldn't have any trouble using Bison.
You do need to be very proficient in C programming to be able to program
with Bison.  Many programs use Bison as part of their build process.
Bison is only needed on systems that are used for development.

%package runtime
Summary: Runtime support files used by Bison-generated parsers
Group: Development/C
BuildArch: noarch

%description runtime
This package contains files used at runtime by parsers that Bison
generates.  Packages whose binaries contain parsers generated by Bison
should depend on bison-runtime to ensure that these files are available.
See the Internationalization in the Bison manual section for more
information.

%prep
%setup -n %srcname -a1 -a2

# Build scripts expect to find the bison version in this file.
echo -n %version > .tarball-version

# Generate LINGUAS files.
ls po/*.po | sed 's|.*/||; s|\.po$||' > po/LINGUAS
ls runtime-po/*.po | sed 's|.*/||; s|\.po$||' > runtime-po/LINGUAS

# Install submodule files.
rm m4/m4.m4 data/m4sugar/{foreach,m4sugar}.m4 build-aux/move-if-change
ln -s %_aclocaldir/m4.m4 m4/
ln -s %_datadir/autoconf/m4sugar/{foreach,m4sugar}.m4 data/m4sugar/
ln -s %_datadir/gnulib/build-aux/move-if-change build-aux/

# Use bootstrap script from gnulib.
if grep -qs ^bootstrap_sync=true bootstrap.conf; then
	ln -snf %_datadir/gnulib/build-aux/bootstrap .
fi

%build
./bootstrap --no-git --skip-po --gnulib-srcdir=%_datadir/gnulib

# Use translations from gnulib.
if [ -f %_datadir/gnulib/build-aux/po/LINGUAS ]; then
	rm gnulib-po/LINGUAS
	cp -p %_datadir/gnulib/build-aux/po/{LINGUAS,*.po} gnulib-po/
fi

# Since bison is not a threaded executable,
# configure gnulib with --disable-threads.
# This is not just a harmless optimization that saves a few cycles
# but also a workaround that fixes GNU ld errors on ppc64le reported by
# eu-elflint --gnu-ld /usr/bin/bison
%configure --disable-silent-rules --disable-threads
touch src/scan-????.l
%make_build

%install
%makeinstall_std

%find_lang --output=%name.lang %name %name-gnulib
%find_lang %name-runtime

%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict

%check
%make_build -k check

%files -f %name.lang
%_bindir/*
%_libdir/lib*.a
%_datadir/bison/
%_datadir/aclocal/*
%_mandir/man?/*
%_infodir/*.info*
%doc %_docdir/%name/

%files -f %name-runtime.lang runtime

%changelog
* Thu Apr 08 2021 Dmitry V. Levin <ldv@altlinux.org> 3.7.6-alt1
- bison: v3.0.5 -> v3.7.6 (closes: #39846).
- gnulib BR: v0.1-2305-g95c96b6dd -> v0.1-4516-ge639e557f.
- Updated translations from translationproject.org.

* Wed Dec 26 2018 Dmitry V. Levin <ldv@altlinux.org> 3.0.5-alt1
- bison: v3.0.4-14-g8bf276d -> v3.0.5.
- gnulib: v0.1-585-g2fda85e -> v0.1-2305-g95c96b6dd.
- Updated translations from translationproject.org.

* Wed Dec 02 2015 Dmitry V. Levin <ldv@altlinux.org> 3.0.4.0.14.8bf2-alt2
- Added makeinfo to BuildRequires.

* Thu Sep 24 2015 Dmitry V. Levin <ldv@altlinux.org> 3.0.4.0.14.8bf2-alt1
- Update to bison v3.0.4-14-g8bf276d.
- Updated translations from translationproject.org.
- Built with gnulib v0.1-585-g2fda85e.

* Tue Apr 16 2013 Dmitry V. Levin <ldv@altlinux.org> 2.7.1-alt1
- Updated to bison 2.7.1.
- Updated translations from translationproject.org.
- Built with gnulib v0.0.7902-g92f3a4c.

* Sun Dec 16 2012 Dmitry V. Levin <ldv@altlinux.org> 2.7-alt1
- Updated to bison 2.7.
- Updated translations from translationproject.org.

* Mon Oct 29 2012 Dmitry V. Levin <ldv@altlinux.org> 2.6.4-alt2
- Built with gnulib v0.0-7677-g4027785.

* Mon Oct 29 2012 Dmitry V. Levin <ldv@altlinux.org> 2.6.4-alt1
- Updated to bison 2.6.4.
- Updated translations from translationproject.org.

* Fri Aug 31 2012 Dmitry V. Levin <ldv@altlinux.org> 2.6.2-alt1
- Updated to bison 2.6.2.
- Updated translations from translationproject.org.
- Built with system gnulib v0.0-7591-g898f143.

* Mon Feb 07 2011 Dmitry V. Levin <ldv@altlinux.org> 2.4.3-alt3
- Minor specfile cleanup.

* Fri Aug 20 2010 Dmitry V. Levin <ldv@altlinux.org> 2.4.3-alt2
- Made bison-runtime a noarch subpackage.

* Thu Aug 19 2010 Dmitry V. Levin <ldv@altlinux.org> 2.4.3-alt1
- Updated to 2.4.3.

* Wed Sep 09 2009 Dmitry V. Levin <ldv@altlinux.org> 2.4.1-alt2
- Moved "make check" to %%check section.

* Sun Jun 07 2009 Dmitry V. Levin <ldv@altlinux.org> 2.4.1-alt1
- Updated to 2.4.1.
- Removed obsolete %%install_info/%%uninstall_info calls.

* Sat Apr 14 2007 Dmitry V. Levin <ldv@altlinux.org> 2.3-alt2
- Reduced macro abuse in specfile.

* Mon Jun 12 2006 Dmitry V. Levin <ldv@altlinux.org> 2.3-alt1
- Updated to 2.3.

* Sat Oct 22 2005 Dmitry V. Levin <ldv@altlinux.org> 2.1-alt2
- New subpackage bison-runtime for i18n support files used by parsers.
- Additional specfile convention enforcement.

* Fri Oct 14 2005 Sergey N. Yatskevich <syatskevich@altlinux.ru> 2.1-alt1
- 2.1

* Wed Jan 12 2005 Stanislav Ievlev <inger@altlinux.org> 2.0-alt1
- 2.0

* Thu Jun 17 2004 Alexey Voinov <voins@altlinux.ru> 1.875-alt5
- fixed previous fix

* Thu Jun 10 2004 Alexey Voinov <voins@altlinux.ru> 1.875-alt4
- segfault fixed [ #3955 ]

* Thu Oct 16 2003 Dmitry V. Levin <ldv@altlinux.org> 1.875-alt3
- Replaced alt-no-unused patch with rh-unusedlabel patch.
- Updated package dependencies.
- Updated package description.

* Tue Apr 01 2003 Stanislav Ievlev <inger@altlinux.ru> 1.875-alt2
- unused declarations was in wrong places, remove it

* Wed Mar 26 2003 Stanislav Ievlev <inger@altlinux.ru> 1.875-alt1
- 1.875

* Wed Oct 30 2002 Dmitry V. Levin <ldv@altlinux.org> 1.35-alt2
- Rebuilt in new environment.

* Fri Mar 29 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.35-alt1
- 1.35

* Thu Mar 14 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.34-alt1
- 1.34

* Thu Feb 14 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.33-alt1
- 1.33

* Mon Feb 04 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.32-alt1
- 1.32

* Wed Jan 23 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.31-alt2
- Fixed handling of ".yacc" extensions.

* Fri Jan 18 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.31-alt1
- 1.31

* Tue Nov 27 2001 Dmitry V. Levin <ldv@alt-linux.org> 1.30-alt2
- Applied bison-1.30-rh-free.patch

* Mon Nov 05 2001 Dmitry V. Levin <ldv@alt-linux.org> 1.30-alt1
- 1.30

* Thu Oct 25 2001 Dmitry V. Levin <ldv@alt-linux.org> 1.29-alt1
- 1.29

* Tue Jan 16 2001 Dmitry V. Levin <ldv@fandra.org> 1.28-ipl8mdk
- Create tmpfiles in more secure way.

* Wed Nov 15 2000 Dmitry V. Levin <ldv@fandra.org> 1.28-ipl7mdk
- Fixed texinfo documentation.

* Wed Aug  2 2000 Dmitry V. Levin <ldv@fandra.org> 1.28-ipl6mdk
- RE adaptions.

* Wed Jan 12 2000 Pixel <pixel@mandrakesoft.com> 1.28-4mdk
- spec-helper
- group update

* Wed Jan 12 2000 Pixel <pixel@mandrakesoft.com>
- fix build as non-root

* Wed Jul 07 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- version 1.28 :

* Tue May 18 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Bziped info files.
- Handle RPM_OPT_FLAGS

* Tue May 11 1999 Bernhard Rosenkraenzer <bero@mandrakesoft.com>
- Mandrake adaptions

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 3)

* Mon Mar  8 1999 Jeff Johnson <jbj@redhat.com>
- configure with datadir=/usr/lib (#1386).

* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
- updated text in spec file.
- update to 1.27

* Thu Dec 17 1998 Cristian Gafton <gafton@redhat.com>
- build for glibc 2.1

* Fri Apr 24 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com>
- built for Manhattan
- added build root

* Wed Oct 15 1997 Donnie Barnes <djb@redhat.com>
- various spec file cleanups

* Mon Jun 02 1997 Erik Troan <ewt@redhat.com>
- built against glibc