]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
zlib-ng: Replace zlib with zlib-ng
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Feb 2025 13:39:45 +0000 (13:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Feb 2025 13:39:45 +0000 (13:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
zlib-ng/zlib-ng.nm [new file with mode: 0644]
zlib/zlib.nm [deleted file]

diff --git a/zlib-ng/zlib-ng.nm b/zlib-ng/zlib-ng.nm
new file mode 100644 (file)
index 0000000..c487a3c
--- /dev/null
@@ -0,0 +1,112 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = zlib-ng
+version    = 2.2.4
+release    = 1
+
+groups     = System/Libraries
+url        = https://github.com/zlib-ng/zlib-ng
+license    = zlib
+summary    = zlib replacement with optimizations for "next generation" systems
+
+description
+       zlib-ng is a replacement for zlib which incorporates improvements
+       from various sources.
+end
+
+source_dl  = %{github_url}
+
+# This package is compatible with zlib in version 1.3.1
+zlib_version = 1.3.1
+
+build
+       requires
+               cmake
+       end
+
+       build
+               mkdir -pv build build-compat
+
+               # Build the regular version
+               pushd build
+               %{cmake} .. \
+                       -DWITH_GTEST=OFF
+               %{make_build}
+               popd
+
+               # Build the drop-in replacement
+               pushd build-compat
+               %{cmake} .. \
+                       -DWITH_GTEST=OFF \
+                       -DZLIB_COMPAT=ON \
+                       -DWITH_NEW_STRATEGIES=OFF
+               %{make_build}
+               popd
+       end
+
+       test
+               pushd build
+               make test
+               popd
+
+               pushd build-compat
+               make test
+               popd
+       end
+
+       install
+               pushd build
+               %{make_install}
+               popd
+
+               pushd build-compat
+               %{make_install}
+               popd
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-compat
+               summary = Compatibility library of zlib-ng
+
+               provides = zlib = %{zlib_version}
+               obsoletes = zlib <= %{zlib_version}
+               conflicts = zlib
+
+               files
+                       %{libdir}/libz.so.*
+               end
+       end
+
+       package %{name}-devel
+               template DEVEL
+
+               files += %{libdir}/cmake/zlib-ng
+       end
+
+       package %{name}-compat-devel
+               summary = Development headers to the legacy version of zlib
+
+               requires = %{name}-compat = %{thisver}
+               provides = zlib-devel = %{zlib_version}
+               obsoletes = zlib-devel <= %{zlib_version}
+               conflicts = zlib-devel
+
+               files
+                       %{includedir}
+                       !%{includedir}/*-ng*
+                       %{libdir}/cmake/ZLIB
+                       %{libdir}/libz.so
+                       %{libdir}/pkgconfig/zlib.pc
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/zlib/zlib.nm b/zlib/zlib.nm
deleted file mode 100644 (file)
index a7a7b6e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-# IPFire.org    - An Open Source Firewall Solution                            #
-# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
-###############################################################################
-
-name       = zlib
-version    = 1.3.1
-release    = 1
-
-groups     = System/Libraries
-url        = https://zlib.net/
-license    = zlib
-summary    = The zlib compression and decompression library.
-
-description
-       Zlib is a general-purpose, patent-free, lossless data compression
-       library which is used by many different programs.
-end
-
-source_dl  = https://zlib.net/
-
-# Enable PIC build.
-CFLAGS    += -fPIC -DPIC
-
-build
-       configure_options = \
-               --prefix=%{prefix} \
-               --libdir=%{libdir}
-
-       test
-               make check
-       end
-
-       install_cmds
-               mkdir -pv %{BUILDROOT}%{includedir} %{BUILDROOT}%{libdir}
-               cp -pfv zconf.h zlib.h %{BUILDROOT}%{includedir}
-       end
-end
-
-packages
-       package %{name}
-
-       package %{name}-devel
-               template DEVEL
-       end
-
-       package %{name}-debuginfo
-               template DEBUGINFO
-       end
-end