Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
Signed-off-by: leleliu008 <[email protected]>
  • Loading branch information
leleliu008 committed Dec 7, 2023
1 parent 9355f95 commit 382ae84
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ cmake --install build.d

If you want to change the request url, you can set this environment variable. It is very useful for chinese users.

## uppm formula
## uppm formula scheme

a uppm formula is a [YAML](https://yaml.org/spec/1.2.2/) format file which is used to config a uppm package's meta-information including one sentence description, package version, installation instructions, etc.
Expand All @@ -596,13 +596,55 @@ a uppm formula'a filename prefix would be treated as the package name.
a uppm formula'a filename prefix must match regular expression pattern `^[A-Za-z0-9+-._@]{1,50}$`

a uppm formula's file content must follow [the uppm formula scheme](https://github.com/leleliu008/uppm-formula-repository-linux-x86_64)
a uppm formula's file content only has one level mapping and shall has following KEY:
|KEY|required?|overview|
|-|-|-|
|`summary`|required|Describe this package in one sentence.|
|`webpage`|required|the home webpage url of this package.|
|`license`|optional|a space-separated list of [SPDX license short identifiers](https://spdx.github.io/spdx-spec/v2.3/SPDX-license-list/#a1-licenses-with-short-identifiers)|
|`version`|optional|the version of this package.<br>If this mapping is not present, it will be calculated from `bin-url`|
|`bin-url`|required|the prebuild binary file download url of this package.|
|`bin-sha`|required|the `sha256sum` of the prebuild binary file.|
|`dep-pkg`|optional|a space-separated list of package names. these packages will be used when installing or runtime.|
|`unpackd`|optional|relative to `$PKG_INSTALL_DIR`. the directory where shall be unpacked to. default is empty, which means that the artifact will be unpacked to `$PKG_INSTALL_DIR`|
|`install`|optional|POSIX shell code to be run when installing.<br>If this mapping is not present, and if `bin-url` mapping's value ends with one of `.zip` `.tar.xz` `.tar.gz` `.tar.lz` `.tar.bz2` `.tgz` `.txz` `.tlz` `.tbz2`, `uppm` will uncompress it to `$PKG_INSTALL_DIR` for you. otherwise, just copy it to `$PKG_INSTALL_DIR`|

**shell variables that can be used in install block :**

|variable|overview|
|-|-|
|`NATIVE_OS_ARCH`|current machine os arch.|
|`NATIVE_OS_KIND`|current machine os kind.|
|`NATIVE_OS_TYPE`|current machine os type.|
|`NATIVE_OS_NAME`|current machine os name.|
|`NATIVE_OS_VERS`|current machine os version.|
|`NATIVE_OS_NCPU`|current machine os has how many cpu cores.|
|||
|`UPPM_VERSION`|the version of `uppm`.|
|`UPPM_VERSION_MAJOR`|the major part of `$UPPM_VERSION`.|
|`UPPM_VERSION_MINOR`|the minor part of `$UPPM_VERSION`.|
|`UPPM_VERSION_PATCH`|the patch part of `$UPPM_VERSION`.|
|`UPPM_HOME`|the home directory of `uppm`.|
|`UPPM`|the executbale path of `uppm`.|
|||
|`PKG_SUMMARY`|the value of `summary`|
|`PKG_VERSION`|the value of `version`|
|`PKG_LICENSE`|the value of `license`|
|`PKG_WEBPAGE`|the value of `webpage`|
|`PKG_BIN_URL`|the value of `bin-url`|
|`PKG_BIN_SHA`|the value of `bin-sha`|
|`PKG_BIN_FILEPATH`|the local file path of `bin-url`|
|`PKG_BIN_FILENAME`|the local file name of `bin-url`|
|`PKG_BIN_FILETYPE`|the file type of `bin-url`|
|`PKG_DEP_PKG`|the value of `dep-pkg`|
|`PKG_INSTALL_DIR`|the directory where the current package will be installed to.|

## uppm formula repository

a uppm formula repository is a git repository.

a uppm formula repository's root dir should have a `formula` named sub dir, this repository's formulas all should be located in this dir.
a uppm formula repository's root directory should have a `formula` named sub directory, this repository's formulas all should be located in this directory.

a uppm formula repository's local path is `~/.uppm/repos.d/${UPPMFormulaRepoName}`
Expand Down

0 comments on commit 382ae84

Please sign in to comment.