2023-01-19 06:30:17 +08:00
|
|
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
2020-05-19 23:56:52 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2021-07-09 06:12:30 +08:00
|
|
|
|
2020-05-19 23:56:52 +08:00
|
|
|
|
|
|
|
class HttpPost(MakefilePackage):
|
|
|
|
"""Http_post does a POST operation to an HTTP URL and dumps the results
|
|
|
|
to stdout. It does not do gopher, ftp, file, news, or any other type of
|
|
|
|
URL, only HTTP. It can be configured to do HTTPS POSTs as well."""
|
|
|
|
|
2021-02-04 01:03:28 +08:00
|
|
|
homepage = "https://www.acme.com/software/http_post/"
|
2022-07-31 06:19:18 +08:00
|
|
|
url = "https://www.acme.com/software/http_post/http_post_18May2018.tar.gz"
|
2020-05-19 23:56:52 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
version(
|
|
|
|
"2018-05-18", sha256="6607faa91aea410efb9b86ae0b1b64541b55318831cf6bb3fdee5d68f8adab31"
|
|
|
|
)
|
2020-05-19 23:56:52 +08:00
|
|
|
|
|
|
|
def url_for_version(self, version):
|
2022-07-31 06:19:18 +08:00
|
|
|
ver = datetime.datetime.strptime(str(version), "%Y-%m-%d").date()
|
|
|
|
verstr = datetime.datetime.strftime(ver, "%d%b%Y")
|
2021-02-04 01:03:28 +08:00
|
|
|
return "https://www.acme.com/software/http_post/http_post_{0}.tar.gz".format(verstr)
|
2020-05-19 23:56:52 +08:00
|
|
|
|
|
|
|
def edit(self, spec, prefix):
|
|
|
|
makefile = FileFilter("Makefile")
|
2022-07-31 06:19:18 +08:00
|
|
|
makefile.filter("BINDIR =\t/usr/local/bin", "BINDIR = {0}/bin".format(self.prefix))
|
|
|
|
makefile.filter("MANDIR =\t/usr/local/man/man1", "MANDIR={0}/man/man1".format(self.prefix))
|
2020-05-19 23:56:52 +08:00
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
mkdirp(prefix.bin)
|
|
|
|
mkdirp(prefix.man.man1)
|
2022-07-31 06:19:18 +08:00
|
|
|
make("install")
|