%define do_for_guile_vers() %{expand: %%define guile_ver 22 %%define guile_dotver 2.2 %1 %%undefine guile_ver %%undefine guile_dotver %%define guile_ver 30 %%define guile_dotver 3.0 %1 } Name: guile-ncurses Version: 3.1 Release: 2%{?dist} Summary: Guile language bindings for the ncurses library License: LGPL-3.0-or-later URL: https://www.gnu.org/software/guile-ncurses/ Source0: https://ftp.gnu.org/gnu/guile-ncurses/guile-ncurses-%{version}.tar.gz Patch0: guile-ncurses-opaque.diff BuildRequires: /usr/bin/autoreconf /usr/bin/aclocal BuildRequires: libtool BuildRequires: /usr/bin/gcc BuildRequires: ncurses-devel BuildRequires: libunistring-devel %global _description %{expand: GNU Guile-Ncurses is a library for the Guile Scheme interpreter that provides functions for creating text user interfaces. The text user interface functionality is built on the ncurses libraries: curses, form, panel, and menu.} %description %{_description} %{do_for_guile_vers: %package -n guile%{guile_ver}-ncurses Summary: Guile language bindings for the ncurses library BuildRequires: guile%{guile_ver}-devel Requires: guile%{guile_ver} Recommends: guile-ncurses-doc %description -n guile%{guile_ver}-ncurses %{_description} %package -n guile%{guile_ver}-ncurses-devel Summary: Extra development tools for guile-ncurses Requires: guile%{guile_ver}-ncurses Requires: /usr/bin/xterm %description -n guile%{guile_ver}-ncurses-devel Extra development tools for gulie-ncurses. } %package doc Summary: Documentation for guile-ncurses BuildRequires: texinfo %description doc %{_description} %prep %setup -qc %patch -d guile-ncurses-%{version} -p1 0 mv guile-ncurses-%{version} guile22 cp -a guile22 guile30 %build %{do_for_guile_vers: pushd guile%{guile_ver} %configure \ GUILE_EFFECTIVE_VERSION=%{guile_dotver} \ GUILE=/usr/bin/guile%{guile_dotver} \ GUILD=/usr/bin/guild%{guile_dotver} \ GUILE_CONFIG=/usr/bin/guile-config%{guile_dotver} %make_build popd } %install rm -rf $RPM_BUILD_ROOT %{do_for_guile_vers: pushd guile%{guile_ver} %make_install mv $RPM_BUILD_ROOT%{_bindir}/guile-ncurses-shell $RPM_BUILD_ROOT%{_bindir}/guile-ncurses-shell%{guile_dotver} popd } find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{do_for_guile_vers: %files -n guile%{guile_ver}-ncurses %%%%license guile%{guile_ver}/COPYING guile%{guile_ver}/COPYING.LESSER %doc guile%{guile_ver}/README guile%{guile_ver}/NEWS %doc guile%{guile_ver}/ChangeLog %doc guile%{guile_ver}/AUTHORS guile%{guile_ver}/TODO %{_libdir}/guile/%{guile_dotver}/extensions/libguile-ncurses.so* %{_libdir}/guile/%{guile_dotver}/site-ccache/ncurses %{_datadir}/guile/site/%{guile_dotver}/ncurses %files -n guile%{guile_ver}-ncurses-devel %{_bindir}/guile-ncurses-shell%{guile_dotver} } %files doc %{_datadir}/info/guile-ncurses.info*.gz