forked from pool/c-ares
Accepting request 833524 from home:badshah400:branches:devel:libraries:c_c++
- Implement multibuild specfile to split out tests into its own flavor; this way we can build and run tests, which require static lib, as well as avoid packaging the latter without issues with the installed cmake file.. OBS-URL: https://build.opensuse.org/request/show/833524 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/c-ares?expand=0&rev=20
This commit is contained in:
parent
a4815457d3
commit
dc6b2f9fb6
3
_multibuild
Normal file
3
_multibuild
Normal file
@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>tests</package>
|
||||
</multibuild>
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 10 01:31:11 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
- Implement multibuild specfile to split out tests into its own
|
||||
flavor; this way we can build and run tests, which require
|
||||
static lib, as well as avoid packaging the latter without issues
|
||||
with the installed cmake file..
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 8 20:35:17 UTC 2020 - Matthias Eliasson <elimat@opensuse.org>
|
||||
|
||||
|
41
c-ares.spec
41
c-ares.spec
@ -16,17 +16,30 @@
|
||||
#
|
||||
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
|
||||
%if "%{flavor}" == "tests"
|
||||
%bcond_without tests
|
||||
%define psuffix -tests
|
||||
%endif
|
||||
|
||||
%if "%{flavor}" == ""
|
||||
%bcond_with tests
|
||||
%endif
|
||||
|
||||
%define pname c-ares
|
||||
|
||||
%define sonum 2
|
||||
%define libname libcares%{sonum}
|
||||
Name: c-ares
|
||||
Name: %{pname}%{?psuffix}
|
||||
Version: 1.16.1
|
||||
Release: 0
|
||||
Summary: Library for asynchronous name resolves
|
||||
License: MIT
|
||||
URL: https://c-ares.haxx.se/
|
||||
Source0: http://c-ares.haxx.se/download/%{name}-%{version}.tar.gz
|
||||
Source1: http://c-ares.haxx.se/download/%{name}-%{version}.tar.gz.asc
|
||||
Source3: %{name}.keyring
|
||||
Source0: http://c-ares.haxx.se/download/%{pname}-%{version}.tar.gz
|
||||
Source1: http://c-ares.haxx.se/download/%{pname}-%{version}.tar.gz.asc
|
||||
Source3: %{pname}.keyring
|
||||
Source4: baselibs.conf
|
||||
Patch0: 0001-Use-RPM-compiler-options.patch
|
||||
Patch1: disable-live-tests.patch
|
||||
@ -80,7 +93,7 @@ This package provides the development libraries and headers needed
|
||||
to build packages that depend on c-ares.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{version}
|
||||
%autosetup -p1 -n %{pname}-%{version}
|
||||
|
||||
# Remove bogus cflags checking
|
||||
sed -i -e '/XC_CHECK_BUILD_FLAGS/d' configure.ac
|
||||
@ -88,29 +101,34 @@ sed -i -e '/XC_CHECK_USER_FLAGS/d' m4/xc-cc-check.m4
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DCARES_STATIC:BOOL=OFF \
|
||||
-DCARES_SHARED:BOOL=ON \
|
||||
-DCARES_INSTALL:BOOL=ON \
|
||||
-DCARES_BUILD_TESTS:BOOL=ON \
|
||||
-DCARES_BUILD_TOOLS:BOOL=ON
|
||||
%make_build
|
||||
-DCARES_STATIC:BOOL=%{?with_tests:ON}%{!?with_tests:OFF} \
|
||||
-DCARES_SHARED:BOOL=%{?with_tests:OFF}%{!?with_tests:ON} \
|
||||
-DCARES_INSTALL:BOOL=%{?with_tests:OFF}%{!?with_tests:ON} \
|
||||
-DCARES_BUILD_TESTS:BOOL=%{?with_tests:ON}%{!?with_tests:OFF} \
|
||||
-DCARES_BUILD_TOOLS:BOOL=%{?with_tests:OFF}%{!?with_tests:ON}
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
%if "%{flavor}" == ""
|
||||
%cmake_install
|
||||
install -m 644 -Dt %{buildroot}%{_mandir}/man1/ *.1
|
||||
install -m 644 -Dt %{buildroot}%{_mandir}/man3/ *.3
|
||||
# Tests require static lib so lets remove it so it does not get in package
|
||||
find %{buildroot} -type f \( -name "*.la" -o -name "*.a" \) -delete -print
|
||||
%endif
|
||||
|
||||
%if "%{flavor}" == "tests"
|
||||
%check
|
||||
pushd build
|
||||
%make_build -C test
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib
|
||||
./bin/arestest
|
||||
%endif
|
||||
|
||||
%post -n %{libname} -p /sbin/ldconfig
|
||||
%postun -n %{libname} -p /sbin/ldconfig
|
||||
|
||||
%if "%{flavor}" == ""
|
||||
%files utils
|
||||
%license LICENSE.md
|
||||
%{_bindir}/acountry
|
||||
@ -131,5 +149,6 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib
|
||||
%{_mandir}/man3/ares_*.3%{?ext_man}
|
||||
%{_libdir}/pkgconfig/libcares.pc
|
||||
%{_libdir}/cmake/c-ares/
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user