File swig.spec of Package A_tw-swig (Revision 89785f5649ef89eb786a31079ec0f9c2)
Currently displaying revision 89785f5649ef89eb786a31079ec0f9c2 , Show latest
181
1
#
2
# spec file for package swig
3
#
4
# Copyright (c) 2023 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%bcond_with swig_ocaml
20
%if 0%{?fedora} + 0%{?rhel_version} + 0%{?centos_version} > 0
21
%define docpath %{_docdir}/%{name}-%{version}
22
BuildRequires: perl-Test-Simple
23
BuildRequires: perl-devel
24
%if 0%{?centos_version} < 800
25
BuildRequires: ruby
26
%endif
27
%endif
28
%if 0%{?suse_version} > 0
29
%define docpath %{_docdir}/%{name}
30
BuildRequires: ruby-devel
31
%endif
32
Name: swig
33
Version: 4.1.1
34
Release: 0
35
Summary: Simplified Wrapper and Interface Generator
36
License: BSD-3-Clause AND GPL-3.0-or-later
37
Group: Development/Languages/C and C++
38
URL: http://www.swig.org/
39
Source: https://github.com/swig/swig/archive/v%{version}/%{name}-v%{version}.tar.gz
40
Source1: %{name}.rpmlintrc
41
42
BuildRequires: autoconf
43
BuildRequires: automake
44
BuildRequires: bison
45
BuildRequires: fdupes
46
BuildRequires: gcc-c++
47
BuildRequires: libtool
48
BuildRequires: pcre2-devel
49
BuildRequires: perl
50
BuildRequires: pkgconfig
51
%if 0%{?centos_version} >= 800
52
BuildRequires: boost-devel
53
BuildRequires: python3-devel
54
BuildRequires: python3-tools
55
%else
56
%if 0%{?suse_version} >= 1500
57
BuildRequires: libboost_headers-devel
58
BuildRequires: python3-devel
59
BuildRequires: python3-tools
60
%else
61
BuildRequires: boost-devel
62
BuildRequires: python-devel > 2.6
63
%endif
64
%endif
65
%if %{with swig_ocaml}
66
BuildRequires: ncurses-devel
67
BuildRequires: ocaml >= 3.12.0
68
BuildRequires: ocaml-camlp4-devel
69
BuildRequires: ocaml-findlib
70
%endif
71
72
%description
73
SWIG is a compiler that attempts to make it easy to integrate C, C++,
74
or Objective-C code with scripting languages including Perl, Tcl, and
75
Python. In a nutshell, you give it a bunch of ANSI C/C++ declarations
76
and it generates an interface between C and your favorite scripting
77
language. However, this is only scratching the surface of what SWIG
78
can do--some of its more advanced features include automatic
79
documentation generation, module and library management, extensive
80
customization options, and more.
81
82
%package doc
83
Summary: SWIG Manual
84
License: BSD-3-Clause
85
Group: Documentation/Man
86
Requires: swig
87
BuildArch: noarch
88
89
%description doc
90
SWIG is a compiler that attempts to make it easy to integrate C, C++,
91
or Objective-C code with scripting languages including Perl, Tcl, and
92
Python. In a nutshell, you give it a bunch of ANSI C/C++ declarations
93
and it generates an interface between C and your favorite scripting
94
language. However, this is only scratching the surface of what SWIG
95
can do--some of its more advanced features include automatic
96
documentation generation, module and library management, extensive
97
customization options, and more.
98
99
This package contains the SWIG manual.
100
101
%package examples
102
Summary: SWIG example files
103
License: BSD-3-Clause
104
Group: Documentation/Howto
105
Requires: swig
106
107
%description examples
108
SWIG is a compiler that attempts to make it easy to integrate C, C++,
109
or Objective-C code with scripting languages including Perl, Tcl, and
110
Python. In a nutshell, you give it a bunch of ANSI C/C++ declarations
111
and it generates an interface between C and your favorite scripting
112
language. However, this is only scratching the surface of what SWIG
113
can do--some of its more advanced features include automatic
114
documentation generation, module and library management, extensive
115
customization options, and more.
116
117
This package contains SWIG examples, useful both for testing and
118
understandig SWIG usage.
119
120
%prep
121
%setup -q
122
123
%build
124
%ifarch s390 s390x
125
export CCSHARED="-fPIC"
126
%endif
127
./autogen.sh
128
%configure \
129
%if %{without swig_ocaml}
130
--without-ocaml \
131
%endif
132
--disable-ccache
133
make %{?_smp_mflags}
134
135
%check
136
%if 0%{?suse_version} >= 1500 || 0%{?centos_version} >= 800
137
export PY3=true
138
%endif
139
make %{?_smp_mflags} check EXTRA_CXXFLAGS="-fexcess-precision=fast"
140
141
%install
142
%make_install
143
144
install -d %{buildroot}%{docpath}
145
cp -a TODO ANNOUNCE CHANGES* LICENSE README Doc/{Devel,Manual} \
146
%{buildroot}%{docpath}
147
install -d %{buildroot}%{_datadir}/swig
148
cp -a Examples %{buildroot}%{_datadir}/swig/examples
149
rm -rf %{buildroot}%{_datadir}/swig/examples/test-suite
150
151
# rm files that are not needed for running or rebuilding the examples
152
find %{buildroot}%{_datadir}/swig \
153
-name '*.dsp' -o -name '*.vcproj' -o -name '*.sln' -o \
154
-name '*.o' -o -name '*_wrap.c' | xargs rm
155
156
# fix perms
157
chmod -x %{buildroot}%{docpath}/Manual/*
158
find %{buildroot}%{_datadir}/swig -name '*.h' -perm /111 | \
159
xargs --no-run-if-empty chmod -x
160
ln -s %{_datadir}/swig/examples %{buildroot}%{docpath}/Examples
161
162
%fdupes %{buildroot}
163
164
%files
165
%defattr(644,root,root,755)
166
%dir %{docpath}
167
%{docpath}/[A-Z][A-Z]*
168
%{_datadir}/swig
169
%exclude %{_datadir}/swig/examples
170
%attr(755,root,root) %{_bindir}/swig
171
172
%files doc
173
%{docpath}/Devel
174
%{docpath}/Manual
175
176
%files examples
177
%{docpath}/Examples
178
%{_datadir}/swig/examples
179
180
%changelog
181