blob: 82c2cd6868a916c8267238881ad1e48c6e70ac62 (
plain) (
tree)
|
|
#
# SWIG 4.xx Version 1.
#
# This configuration file configure's, make's and install's m4
#
# Warning: this package is only for bootstrapping within a build.
#
Name: swig-%{swig_version}-%{_host}-%{release}
Summary: SWIG v%{swig_version} for host %{_host}
Version: %{swig_version}
Release: %{release}
URL: http://www.swig.org/
#
# Source
#
%source set swig --rsb-file=swig-rel-%{swig_version}.tar.gz \
https://github.com/swig/swig/archive/rel-%{swig_version}.tar.gz
%source set pcre --rsb-file=pcre-%{pcre_version}.tar.bz2 \
https://sourceforge.net/projects/pcre/files/pcre/%{pcre_version}/pcre-%{pcre_version}.tar.bz2/download
#
# See if a special swig prefix is provided
#
%if %{defined swig_prefix}
%define _disable_collecting yes
%define _disable_packaging yes
%define _disable_reporting yes
%define _disable_installing yes
%endif
#
# Prepare the source code.
#
%prep
build_top=$(pwd)
source_dir_swig="swig-rel-%{swig_version}"
%source setup swig -q -n swig-rel-%{swig_version}
%source download pcre
%patch setup swig -p1
# SWIG does not ship from github with it's generated files. We
# need to generate them.
# Add the path to the internal autoconf tools
SWIG_XPATH=$PATH
%if %{defined _internal_autotools_path}
export PATH=%{_internal_autotools_path}/bin:$PATH
%endif
./autogen.sh
export PATH=$SWIG_XPATH
cd ${build_top}
%build
build_top=$(pwd)
%{build_directory}
mkdir -p ${build_dir}
cd ${build_dir}
%{host_build_flags}
# build PCRE using the SWIG script as it is a static link
%{__cp} %{_sourcedir}/pcre-%{pcre_version}.tar.bz2 pcre-%{pcre_version}.tar.bz2
../${source_dir_swig}/Tools/pcre-build.sh
%if %{defined swig_prefix}
prefix=%{swig_prefix}
%else
prefix=%{_prefix}
%endif
../${source_dir_swig}/configure \
--host=%{_host} \
--prefix=${prefix}
%{__make} %{?_smp_mflags}
cd ${build_top}
%install
build_top=$(pwd)
%{__rmdir} ${SB_BUILD_ROOT}
cd ${build_dir}
%if %{!defined swig_prefix}
%define destdir DESTDIR=${SB_BUILD_ROOT}
%else
%define destdir %{nil}
%endif
%{__make} %{destdir} install
cd ${build_top}
|