From a52df46e2cfc81f15c2ecfa4536500e0e8cec1f2 Mon Sep 17 00:00:00 2001 From: darmac Date: Wed, 18 Dec 2019 02:50:10 +0800 Subject: [PATCH] add new package : haproxy (#14160) * add new package : haproxy * add url_for_version() and refine haproxy build code --- .../repos/builtin/packages/haproxy/package.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 var/spack/repos/builtin/packages/haproxy/package.py diff --git a/var/spack/repos/builtin/packages/haproxy/package.py b/var/spack/repos/builtin/packages/haproxy/package.py new file mode 100644 index 0000000000..89088e814e --- /dev/null +++ b/var/spack/repos/builtin/packages/haproxy/package.py @@ -0,0 +1,29 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Haproxy(MakefilePackage): + """ + HAProxy is a single-threaded, event-driven, non-blocking engine + combining a very fast I/O layer with a priority-based scheduler. + """ + + homepage = "https://www.haproxy.org" + url = "https://www.haproxy.org/download/2.1/src/haproxy-2.1.0.tar.gz" + + version('2.1.1', sha256='57e75c1a380fc6f6aa7033f71384370899443c7f4e8a4ba289b5d4350bc76d1a') + version('2.1.0', sha256='f268efb360a0e925137b4b8ed431f2f8f3b68327efb2c418b266e535d8e335a0') + + def url_for_version(self, version): + url = "https://www.haproxy.org/download/{0}/src/haproxy-{1}.tar.gz" + return url.format(version.up_to(2), version) + + def build(self, spec, prefix): + make('TARGET=generic', 'PREFIX=' + prefix) + + def install(self, spec, prefix): + install_tree('.', prefix)