Skip to content

Commit 52330d3

Browse files
committed
packaging: introduce the csdiff-static subpackage
... with a statically linked csgrep-static executable needed for context embedding in legacy build environments. Closes: #196
1 parent 3d92a9f commit 52330d3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

make-srpm.sh

+25
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ cat > "$SPEC" << EOF
9090
%bcond_without python2
9191
%endif
9292
93+
# build csdiff-static on RHEL-10+ and Fedora
94+
%if 0%{?rhel} > 9 || 0%{?fedora}
95+
%bcond_without static
96+
%else
97+
%bcond_with static
98+
%endif
99+
93100
# python3 support is optional
94101
%bcond_without python3
95102
@@ -134,6 +141,18 @@ This package contains the csdiff tool for comparing code scan defect lists in
134141
order to find out added or fixed defects, and the csgrep utility for filtering
135142
defect lists using various filtering predicates.
136143
144+
%if %{with static}
145+
%package static
146+
Summary: Statically linked csgrep-static executable
147+
BuildRequires: boost-static
148+
BuildRequires: glibc-static
149+
BuildRequires: libstdc++-static
150+
151+
%description static
152+
This pacakge contains a statically linked csgrep-static executable needed
153+
for context embedding in legacy build environments.
154+
%endif
155+
137156
%if %{with python2}
138157
%package -n python2-%{name}
139158
Summary: Python interface to csdiff for Python 2
@@ -168,6 +187,7 @@ export BOOST_LIBRARYDIR=/usr/lib64/boost169
168187
169188
make version.cc
170189
%cmake3 \\
190+
-DCSGREP_STATIC=%{?with_static:ON} \\
171191
-DPYCSDIFF_PYTHON2=%{?with_python2:ON} \\
172192
-DPYCSDIFF_PYTHON3=%{?with_python3:ON}
173193
%cmake3_build
@@ -195,6 +215,11 @@ make version.cc
195215
%{_mandir}/man1/cssort.1*
196216
%{_mandir}/man1/cstrans-df-run.1*
197217
218+
%if %{with static}
219+
%files static
220+
%{_libexecdir}/csgrep-static
221+
%endif
222+
198223
%if %{with python2}
199224
%files -n python2-%{name}
200225
%license COPYING

0 commit comments

Comments
 (0)