OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/libbobcat?expand=0&rev=15
163 lines
4.8 KiB
RPMSpec
163 lines
4.8 KiB
RPMSpec
#
|
|
# spec file for package libbobcat
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%global _name bobcat
|
|
%global _lib_name lib%{_name}
|
|
%global _lib_version 6
|
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
%if "%{flavor}" == "light"
|
|
%global psuffix -light
|
|
%else
|
|
%global psuffix %{nil}
|
|
%endif
|
|
|
|
Name: %{_lib_name}%{?psuffix}
|
|
Version: 6.09.00
|
|
Release: 0
|
|
Summary: Shared library implementing C++ classes that are frequently used
|
|
License: GPL-3.0-only
|
|
Group: Development/Tools/Building
|
|
URL: https://gitlab.com/fbb-git/bobcat
|
|
Source0: https://gitlab.com/fbb-git/bobcat/-/archive/%{version}/bobcat-%{version}.tar.gz
|
|
Source1: initialbobcatlib
|
|
%if "%{name}" == "%{_lib_name}"
|
|
BuildRequires: icmake >= 12.03.00
|
|
%endif
|
|
BuildRequires: gcc-c++
|
|
|
|
%package devel-static
|
|
Summary: Bobcat static library
|
|
Group: Development/Libraries/C and C++
|
|
%if "%{name}" == "%{_lib_name}-light"
|
|
Conflicts: %{_lib_name}-devel
|
|
Conflicts: %{_lib_name}-devel-static
|
|
%endif
|
|
|
|
%if "%{name}" == "%{_lib_name}"
|
|
Requires: %{_lib_name}-devel = %{version}
|
|
|
|
%description
|
|
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. It is a
|
|
shared library implementing C++ classes that are frequently used in software
|
|
developed by Frank Brokken. All of Frank's C++ programs hosted at GitLab
|
|
depend on `bobcat'.
|
|
|
|
%package -n %{_lib_name}%{_lib_version}
|
|
Summary: Shared library implementing C++ classes that are frequently used
|
|
Group: Development/Tools/Building
|
|
Provides: %{_lib_name} = %{version}
|
|
Obsoletes: %{_lib_name} < %{version}
|
|
|
|
%description -n %{_lib_name}%{_lib_version}
|
|
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. It is a
|
|
shared library implementing C++ classes that are frequently used in software
|
|
developed by Frank Brokken. All of Frank's C++ programs hosted at GitLab
|
|
depend on `bobcat'.
|
|
|
|
%package devel
|
|
Summary: Headers and documentation for the Bobcat library
|
|
Group: Development/Libraries/C and C++
|
|
Requires: %{_lib_name}%{_lib_version} = %{version}
|
|
|
|
%description devel
|
|
Headers and documentation of classes defined in the Bobcat library.
|
|
|
|
%endif
|
|
|
|
%description devel-static
|
|
Bobcat static library
|
|
|
|
%prep
|
|
%autosetup -p1 -n %{_name}-%{version}
|
|
|
|
%if "%{name}" == "%{_lib_name}"
|
|
|
|
%build
|
|
# Incase we have to use specific version of gcc:
|
|
export ICMAKE_CPPSTD="--std=c++2b"
|
|
export CXXFLAGS="%{optflags} ${ICMAKE_CPPSTD} -Werror -fdiagnostics-color=never -ffat-lto-objects"
|
|
export CXX="g++"
|
|
sed -i 's/^#define CXX/\/\/ #define CXX/g' %{_name}/INSTALL.im
|
|
sed -i 's/^#define CXXFLAGS/\/\/ #define CXXFLAGS/g' %{_name}/INSTALL.im
|
|
sed -i 's/^#define DOC/\/\/ #define DOC/g' %{_name}/INSTALL.im
|
|
sed -i 's/^#define HDR/\/\/ #define HDR/g' %{_name}/INSTALL.im
|
|
sed -i 's/^#define LIB/\/\/ #define LIB/g' %{_name}/INSTALL.im
|
|
{
|
|
echo "/* created during rpmbuild */"
|
|
echo "#define CXX \"${CXX}\""
|
|
echo "#define CXXFLAGS \"${CXXFLAGS}\""
|
|
echo "#define DOC \"%{_docdir}/%{_lib_name}%{_lib_version}-devel\""
|
|
echo "#define HDR \"%{_includedir}/%{_name}\""
|
|
echo "#define LIB \"%{_libdir}\""
|
|
} >> %{_name}/INSTALL.im
|
|
pushd %{_name}
|
|
./build dep
|
|
./build light
|
|
popd
|
|
|
|
%install
|
|
pushd %{_name}
|
|
./build install hl %{buildroot}
|
|
popd
|
|
|
|
%post -n %{_lib_name}%{_lib_version} -p /sbin/ldconfig
|
|
%postun -n%{_lib_name}%{_lib_version} -p /sbin/ldconfig
|
|
|
|
%files -n %{_lib_name}%{_lib_version}
|
|
%doc README
|
|
%{_libdir}/%{_lib_name}.so.%{_lib_version}
|
|
%attr(755, -, -) %{_libdir}/%{_lib_name}.so.%{version}
|
|
|
|
%files devel
|
|
%{_libdir}/%{_lib_name}.so
|
|
%{_includedir}/%{_name}/
|
|
|
|
%files devel-static
|
|
|
|
%else
|
|
cp -a %{SOURCE1} ./bobcat/
|
|
|
|
%description
|
|
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. This is the light library
|
|
would be use to build icmake without required it.
|
|
|
|
%build
|
|
export CXXFLAGS="%{optflags} --std=c++2b -Werror -fdiagnostics-color=never -ffat-lto-objects"
|
|
export CXX="g++"
|
|
|
|
pushd %{_name}
|
|
bash ./$(basename %{SOURCE1})
|
|
popd
|
|
|
|
%install
|
|
pushd %{_name}
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
install -m 644 tmp/%{_lib_name}.a %{buildroot}%{_libdir}/
|
|
mkdir -p %{buildroot}%{_includedir}/%{_name}
|
|
install -m 644 tmp/%{_name}/* %{buildroot}%{_includedir}/%{_name}/
|
|
popd
|
|
|
|
%files devel-static
|
|
%{_includedir}/%{_name}/
|
|
%endif
|
|
|
|
%{_libdir}/%{_lib_name}.a
|
|
|
|
%changelog
|