- asan_build: build ASAN included

- debug_build: build more suitable for debugging, install pngcp

OBS-URL: https://build.opensuse.org/package/show/graphics/libpng16?expand=0&rev=113
This commit is contained in:
Petr Gajdos 2019-01-14 14:31:27 +00:00 committed by Git OBS Bridge
parent 7d96e07570
commit 2642e3f1d9
2 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 14 13:11:39 UTC 2019 - Petr Gajdos <pgajdos@suse.com>
- asan_build: build ASAN included
- debug_build: build more suitable for debugging, install pngcp
-------------------------------------------------------------------
Mon Dec 31 09:41:53 UTC 2018 - Petr Gajdos <pgajdos@suse.com>

View File

@ -16,7 +16,9 @@
#
#
%define debug_build 0
%define asan_build 0
%define major 1
%define minor 6
%define micro 36
@ -100,12 +102,22 @@ PNG files.
# PNG_SAFE_LIMITS_SUPPORTED: http://www.openwall.com/lists/oss-security/2015/01/10/1
export CFLAGS="%{optflags} -O3 -DPNG_SAFE_LIMITS_SUPPORTED -DPNG_SKIP_SETJMP_CHECK $(getconf LFS_CFLAGS)"
export LDFLAGS="-Wl,-z,relro,-z,now"
%if %{debug_build}
export CFLAGS="$CFLAGS -O0"
%endif
%configure \
--disable-static
%if %{asan_build}
sed -i -e 's/^\(CFLAGS.*\)$/\1 -fsanitize=address/' \
-e 's/\(^LIBS =.*\)/\1 -lasan/' Makefile
%endif
make %{?_smp_mflags}
%check
%if %{asan_build}
# ASAN needs /proc to be mounted
exit 0
%endif
make -j1 check
%install
@ -114,6 +126,9 @@ rm %{buildroot}/%{_libdir}/libpng*.la
mkdir -p %{buildroot}%{_sysconfdir}/rpm
cp -a %{SOURCE3} \
%{buildroot}%{_sysconfdir}/rpm/macros.libpng-tools
%if %{debug_build} ||%{asan_build}
install -m755 .libs/pngcp %{buildroot}/%{_bindir}
%endif
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
@ -140,6 +155,9 @@ cp -a %{SOURCE3} \
%files tools
%{_bindir}/png-fix-itxt
%{_bindir}/pngfix
%if %{debug_build} || %{asan_build}
%{_bindir}/pngcp
%endif
%{_sysconfdir}/rpm/macros.libpng-tools
%changelog