The URL generator allows you to generate a package from a static URL.
Its input object looks like this:
{
"name": "prjname",
"url-generator":
{
"url": "https://example.com",
"hash-locks": [ "hash1", "hash2" ],
"version": "1.0.0.0",
"transforms":
[
[ "https.*tag/v", "" ],
],
"headers":
{
"User-Agent": "My user agent"
}
}
}The fields do the following:
url- The URL to download the source code. It can be templated with the following variables:{version}- The contents of theversionfield if it was defined in the schema, otherwise an empty string{pkgname}- The name of the package
hash-locks- Optional: A list of hashes used to verify the integrity of a locked artifact. It supports all default checksum algorithms(SHA1, SHA2, SHA3 and BLAKE2 families + MD5)version- A version lock for the artifact in case there is no way to retrieve a version from its URL automatically. Must not exist together with thetransformsfield.transforms- An array of pairs(2-member JSON arrays) that do regex find and replace on the URL string after templating. This is so that users can extract the version out of a URL likehttps://example.com/package-1.0.0.0.tar.xz. The first element of a pair is the find pattern, while the second is the replace string. Must not exist together with thetransformsfield.headers- An optional JSON object of HTTP header pairs. By default it is set up with a browser user agent:User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15
- Home
- User guide
- Installation
- How to package
- Setting
up your metadata
- Ebuilds
- PKGBUILDs
- RPMs
- DEBs
- Dependencies
- URL generator
- GitHub generator
- Setting
up your metadata
- How to test
- How to deploy
- Creating a custom generator
- Artifact generators
- Distribution generators
- Repository generators
- Testing generators
- Deployment generators