diff --git a/libpng16.changes b/libpng16.changes index 660fd75..66c5455 100644 --- a/libpng16.changes +++ b/libpng16.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 14 13:11:39 UTC 2019 - Petr Gajdos + +- asan_build: build ASAN included +- debug_build: build more suitable for debugging, install pngcp + ------------------------------------------------------------------- Mon Dec 31 09:41:53 UTC 2018 - Petr Gajdos diff --git a/libpng16.spec b/libpng16.spec index 81bb922..e54c111 100644 --- a/libpng16.spec +++ b/libpng16.spec @@ -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