diff --git a/0099-copy-dir.sh.patch b/0099-copy-dir.sh.patch new file mode 100644 index 0000000000000000000000000000000000000000..56d4ed0787bb28c18c581d3159d5a458d9540f9c --- /dev/null +++ b/0099-copy-dir.sh.patch @@ -0,0 +1,38 @@ +From 8d777d20ac3d82434c3f1cbd9cdee94c4de8f966 Mon Sep 17 00:00:00 2001 +From: fu_changjie +Date: Fri, 11 Dec 2020 10:28:08 +0800 +Subject: [PATCH] copy-dir.sh + +--- + copy-dir.sh | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + create mode 100755 copy-dir.sh + +diff --git a/copy-dir.sh b/copy-dir.sh +new file mode 100755 +index 0000000..b5520d5 +--- /dev/null ++++ b/copy-dir.sh +@@ -0,0 +1,19 @@ ++dirname=$(basename `pwd`) ++time=$(date +%s) ++ ++cd .. ++ ++if [[ -f 'asan' || -d 'asan' ]]; then ++ mv asan asan-${time} ++fi ++ ++if [[ -f 'debug' || -d 'debug' ]]; then ++ mv debug debug-${time} ++fi ++ ++cp -a ${dirname} asan ++cp -a ${dirname} debug ++ ++mv asan debug ${dirname} ++ ++cd - +-- +2.27.0 + diff --git a/openresty-zlib.spec b/openresty-zlib.spec new file mode 100644 index 0000000000000000000000000000000000000000..2e7329eba8358d6e20b77bd4ce698ba387fa47e6 --- /dev/null +++ b/openresty-zlib.spec @@ -0,0 +1,131 @@ +Name: openresty-zlib +Version: 1.2.11 +Release: 3%{?dist} +Summary: The zlib compression library for OpenResty + +Group: System Environment/Libraries + +# /contrib/dotzlib/ have Boost license +License: zlib and Boost +URL: http://www.zlib.net/ +Source0: http://www.zlib.net/zlib-%{version}.tar.xz +Patch99: 0099-copy-dir.sh.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: libtool + +AutoReqProv: no + +%define zlib_prefix /usr/local/openresty/zlib +%define zlib_prefix_asan /usr/local/openresty-asan/zlib + +%description +The zlib compression library for use by Openresty ONLY + + +%package devel + +Summary: Development files for OpenResty's zlib library +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + + +%description devel +Provides C header and static library for OpenResty's zlib library. + + +%package asan +Release: 13%{?dist} +Summary: Clang AddressSanitizer version for the zlib compression library for OpenResty +Group: System Environment/Libraries +BuildRequires: libtool, clang + +AutoReqProv: no +%description asan +The zlib compression library for use by Openresty ONLY. This is the clang AddressSanitizer build. + + +%package asan-devel +Release: 13%{?dist} +Summary: Development files for OpenResty's zlib library +Group: Development/Libraries +Requires: openresty-zlib-asan = %{version}-%{release} + +%description asan-devel +Provides C header and static library for OpenResty's clang AddressSanitizer version of zlib library. + +%prep +%setup -q -n zlib-%{version} + +%patch99 -p1 + +%build +bash ./copy-dir.sh +./configure --prefix=%{zlib_prefix} +make %{?_smp_mflags} CFLAGS='-O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3' \ + SFLAGS='-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3' + +cd asan +export ASAN_OPTIONS=detect_leaks=0 + +CC="clang -fsanitize=address" ./configure --prefix=%{zlib_prefix_asan} + +make %{?_smp_mflags} CC="clang -fsanitize=address" \ + CFLAGS='-O1 -fno-omit-frame-pointer -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3' \ + SFLAGS='-O1 -fno-omit-frame-pointer -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -g3' \ + LDSHARED='clang -fsanitize=address -shared -Wl,-soname,libz.so.1,--version-script,zlib.map' +cd - + +%install +make install DESTDIR=%{buildroot} +rm -rf %{buildroot}/%{zlib_prefix}/share +rm -f %{buildroot}/%{zlib_prefix}/lib/*.la +rm -rf %{buildroot}/%{zlib_prefix}/lib/pkgconfig + +cd asan +make install DESTDIR=%{buildroot} +rm -rf %{buildroot}/%{zlib_prefix_asan}/share +rm -f %{buildroot}/%{zlib_prefix_asan}/lib/*.la +rm -rf %{buildroot}/%{zlib_prefix_asan}/lib/pkgconfig +cd - + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) + +%attr(0755,root,root) %{zlib_prefix}/lib/libz.so* + + +%files devel +%defattr(-,root,root,-) + +%{zlib_prefix}/lib/*.a +%{zlib_prefix}/include/zlib.h +%{zlib_prefix}/include/zconf.h + +%files asan +%defattr(-,root,root,-) + +%attr(0755,root,root) %{zlib_prefix_asan}/lib/libz.so* + + +%files asan-devel +%defattr(-,root,root,-) + +%{zlib_prefix_asan}/lib/*.a +%{zlib_prefix_asan}/include/zlib.h +%{zlib_prefix_asan}/include/zconf.h + +%changelog +* Fri Jul 14 2017 Yichun Zhang 1.2.11-3 +- bugfix: we did not enable debuginfo in the shared library files. +* Sat May 20 2017 Yichun Zhang 1.2.11-2 +- added debuginfo. +* Sun Mar 19 2017 Yichun Zhang (agentzh) +- upgraded zlib to 1.2.11. +* Wed Aug 23 2016 zxcvbn4038 +- initial build for zlib 1.2.8. diff --git a/openresty-zlib.yaml b/openresty-zlib.yaml new file mode 100644 index 0000000000000000000000000000000000000000..00bbaf050db91e87f0ad529e5c29027a1bf150ae --- /dev/null +++ b/openresty-zlib.yaml @@ -0,0 +1,4 @@ +version_control: NA +src_repo: NA +tag_prefix: NA +seperator: NA diff --git a/zlib-1.2.11.tar.xz b/zlib-1.2.11.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..305b7a058f2b18b5ff15b0c5258ab7d489c21973 Binary files /dev/null and b/zlib-1.2.11.tar.xz differ