1 Star 0 Fork 3

brucezhang/swig

forked from OpenCloudOS Stream/swig 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
swig.spec 6.26 KB
一键复制 编辑 原始数据 按行查看 历史
brucezhang 提交于 2024-09-04 11:16 +08:00 . fix spec
%bcond_with build_ccache_swig
%global guile 0
%ifarch aarch64 ppc64le
%global javalang 0
%else
%global javalang 1
%endif
Summary: Connects C/C++/Objective C to some high-level programming languages
Name: swig
Version: 4.1.1
Release: 6%{?dist}
License: GPLv3+ and BSD
URL: http://swig.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz
Source1: description.h2m
%if %{with build_ccache_swig}
Source2: description-ccache.h2m
Source3: ccache-swig.sh
Source4: ccache-swig.csh
%endif
BuildRequires: gcc-c++ make
BuildRequires: coreutils findutils sed help2man
BuildRequires: perl-interpreter, pcre2-devel
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: autoconf, automake, gawk, dos2unix bison
BuildRequires: perl-devel perl(base) perl(Config) perl(Devel::Peek)
BuildRequires: perl(ExtUtils::MakeMaker) perl(fields) perl(Math::BigInt)
BuildRequires: perl(strict) perl(Test::More) perl(vars) perl(warnings)
BuildRequires: boost-devel tcl-devel lua-devel ruby-devel
%if %{javalang}
BuildRequires: java, java-devel
%endif
%if %{guile}
BuildRequires: guile-devel
%endif
%description
SWIG is a software development tool that connects programs written in C
and C++ with a variety of high-level programming languages. SWIG is used
with different types of target languages including common scripting languages
such as Javascript, Perl, PHP, Python, Tcl and Ruby. The list of supported
languages also includes non-scripting languages such as C#, D, Go language,
Java including Android, Lua, OCaml, Octave, Scilab and R. Also several interpreted
and compiled Scheme implementations (Guile, MzScheme/Racket) are supported. SWIG
is most commonly used to create high-level interpreted or compiled programming
environments, user interfaces, and as a tool for testing and prototyping C/C++
software. SWIG is typically used to parse C/C++ interfaces and generate the
'glue code' required for the above target languages to call into the C/C++ code.
SWIG can also export its parse tree in the form of XML. SWIG is free software and
the code that SWIG generates is compatible with both commercial and non-commercial projects.
%if %{with build_ccache_swig}
%package -n ccache-swig
Summary: Fast compiler cache
License: GPLv2+
Requires: swig
%description -n ccache-swig
ccache-swig is a compiler cache. It speeds up re-compilation of C/C++/SWIG
code by caching previous compiles and detecting when the same compile is
being done again. ccache-swig is ccache plus support for SWIG.
%endif
%package gdb
Summary: Commands for easier debugging of SWIG
License: BSD
Requires: swig
%description gdb
This package contains file with commands for easier debugging of SWIG
in gdb.
%prep
%autosetup -p1
%build
./autogen.sh
%configure \
--without-ocaml \
--with-python3=python3 \
--with-2to3=2to3 \
--without-php \
%if ! %{javalang}
--without-java \
%endif
%if ! %{guile}
--without-guile \
%endif
--without-r \
%if %{without build_ccache_swig}
--disable-ccache \
%endif
--without-go
%{make_build}
%install
%{make_install}
echo "Options:" >help_swig
%{buildroot}%{_bindir}/swig --help >>help_swig
sed -i -e 's/^\(\s\+-[^-]\+\)- \(.*\)$/\1 \2/' help_swig
sed -i -e 's/^\(\s\+-\w\+-[^-]*\)- \(.*\)$/\1 \2/' help_swig
cat >h2m_helper_swig <<'EOF'
#!/bin/bash
[ "$1" == "--version" ] && echo "" || cat help_swig
EOF
chmod a+x h2m_helper_swig
help2man -N --section 1 ./h2m_helper_swig --include %{SOURCE1} -o %{name}.1
%if %{with build_ccache_swig}
%{buildroot}%{_bindir}/ccache-swig -h >>help_ccache
sed -i -e '/compiler cache/ d' help_ccache
sed -i -e '/Copyright/ d' help_ccache
sed -i -e 's/^Usage:/[synopsis]/' help_ccache
sed -i -e 's/^Options:/[options]/' help_ccache
sed -i -e 's/^\s\+/ /' help_ccache
sed -i -e 's/^\(-[^- ] <\w\+>\s\+\) \(\w.\+\)$/ \1 \2/' help_ccache
sed -i -e 's/^\(-[^- ]\s\+\) \(\w.\+\)$/ \1 \2/' help_ccache
cat >h2m_helper_ccache <<'EOF'
#!/bin/bash
[ "$1" == "--version" ] && echo ""
[ "$1" == "--help" ] && echo "" || echo ""
EOF
chmod a+x h2m_helper_ccache
cat %{SOURCE2} >>help_ccache
sed -i -e 's#@DOCDIR@#%{_docdir}#' help_ccache
help2man -N --section 1 ./h2m_helper_ccache --include help_ccache -o ccache-swig.1
%endif
mkdir -p %{buildroot}%{_mandir}/man1/
install -p -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/
%if %{with build_ccache_swig}
install -p -m 0644 ccache-swig.1 %{buildroot}%{_mandir}/man1/
%endif
rm -f %{buildroot}%{_datadir}/%name/%{version}/octave/std_carray.i
%if %{with build_ccache_swig}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d/
install -dm 755 %{buildroot}%{_sysconfdir}/profile.d
install -pm 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d
%endif
mkdir -p %{buildroot}%{_datadir}/%{name}/gdb
install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb
%check
# skip ruby test-suite import_fragments
sed -i "/import_fragments/d" Examples/test-suite/common.mk
make check PY3=1
%files
%license LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
%doc ANNOUNCE CHANGES CHANGES.current
%doc COPYRIGHT README TODO
%doc Doc Examples
%{_bindir}/%{name}
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/gdb
%{_mandir}/man1/swig.1*
%if %{with build_ccache_swig}
%files -n ccache-swig
%{_bindir}/ccache-swig
%config(noreplace) %{_sysconfdir}/profile.d/ccache-swig.*sh
%{_mandir}/man1/ccache-swig.1*
%endif
%files gdb
%{_datadir}/%{name}/gdb
%changelog
* Tue Sep 3 2024 Ze Zhang <bbrucezhang@tencent.com> - 4.1.1-6
- [Type] other
- [DESC] Disable guile and skip test-suite import_fragments
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.1.1-5
- Rebuilt for loongarch release
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.1.1-4
- Rebuilt for OpenCloudOS Stream 23.09
* Thu Aug 03 2023 cunshunxia <cunshunxia@tencent.com> - 4.1.1-3
- Rebuilt for tcl 8.6.13
* Tue Aug 01 2023 rockerzhu <rockerzhu@tencent.com> - 4.1.1-2
- Rebuilt for boost 1.82.0
* Thu May 4 2023 cunshunxia <cunshunxia@tencent.com> - 4.1.1-1
- upgrade to 4.1.1.
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.0.2-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.0.2-2
- Rebuilt for OpenCloudOS Stream 23
* Wed Feb 15 2023 cunshunxia <cunshunxia@tencent.com> - 4.0.2-1
- initial build
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bbrucezhang/swig.git
git@gitee.com:bbrucezhang/swig.git
bbrucezhang
swig
swig
master

搜索帮助