Metadata-Version: 2.1
Name: bin-package-manager
Version: 1.0.0
Summary: Bin package manager, a package manager based on Github release
Home-page: https://github.com/lxl66566/bpm
License: MIT
Keywords: binary,packaging,release
Author: lxl66566
Author-email: lxl66566@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: py7zr (>=0.20.8,<0.21.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: tqdm (>=4.66.2,<5.0.0)
Project-URL: Documentation, https://github.com/lxl66566/bpm
Project-URL: Repository, https://github.com/lxl66566/bpm
Description-Content-Type: text/markdown

# bin package manager

English | [简体中文](./docs/README.zh-CN.md)

Bin package manager (BPM) is a Github release-based package manager that allows users to install and manage binaries from any Github release.

BPM is currently only supported on Linux.

> [!CAUTION]
> Risk Warning: BPM may damage your computer. By using BPM to install software, you accept this risk and trust third-party Github release packagers.

## Why use it?

In non-rolling release Linux distributions, the version of softwares in official source are often too low to use some new features.

Rolling distributions, such as Archlinux, are also unable to install software from the AUR as root.

## Installation

### pipx

You can use pipx to install BPM.

```sh
pipx install bin-package-manager
```

### Source code

If you don't want to use pipx, you can also download and use the source code.

BPM depends on Python modules: `requests`, `tqdm`, `py7zr` (optional).

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
python3 -m bpm
# or use poetry to install dependencies and run: `poetry install && poetry run python -m bpm`
```

## Usage

- Install: `bpm i <package>`
- Run `bpm -h` for more help.

## How it works

BPM automatically determines the file structure in the asset and installs it to the appropriate location on the system. The current installation is like:

1. install binary
2. merge the `lib`, `include`, `share`, `man`, `bin` directories into the system
3. install completions

BPM automatically adds the `.old` suffix to existing files to avoid overwrite. The `.old` files will be restored in uninstalling.

## Develop

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
poetry install
poetry run python -m unittest bpm/**/*.py  # run tests
```

## TODO

- [ ] no pre release
- [ ] try install

# bin package manager

[English](../README.md) | 简体中文

bin package manager (BPM) 是一个基于 Github release 的包管理器，它允许用户安装并管理任意 Github release 上的二进制文件。

BPM 当前仅支持 Linux 系统。

> [!CAUTION]
> 风险提示：BPM 可能会破坏您的计算机。使用 BPM 安装软件即代表您已接受此风险，并信任第三方 Github release 的打包者。

## 为什么有这个项目？

非滚动 Linux 发行版中，官方源的软件版本常常过低，无法满足我的需求。

而滚动发行版，例如 Archlinux，也无法以 root 从 AUR 安装软件。

## 安装

### pipx

您可以使用 pipx 安装 BPM。

```sh
pipx install bin-package-manager
```

### 源码

如果您不希望使用 pipx，也可以下载并使用源码。

BPM 依赖 Python 模块：`requests`, `tqdm`，`py7zr`（可选的）。

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
python3 -m bpm
# 或者使用 poetry 安装依赖并运行: `poetry install && poetry run python -m bpm`
```

## 使用

- 安装：`bpm i <package>`
- 执行 `bpm -h` 查看更多帮助。

## 原理

BPM 自动判断 asset 中的文件结构，并安装到系统中的相应位置。目前的安装内容是：

1. 安装 binary
2. 合并 `lib`, `include`, `share`, `man`, `bin` 目录到系统
3. 安装 completions

BPM 会自动为已存在的文件添加 `.old` 后缀，以避免覆盖。卸载时，`.old` 文件将被恢复。

## 开发

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
poetry install  # 安装依赖
poetry run python -m unittest bpm/**/*.py  # 运行测试
```

## TODO

- [ ] no pre release
- [ ] try install

