https://github.com/cedricduriau/packagerbuddy
JSON config based software packager.
https://github.com/cedricduriau/packagerbuddy
json packagerbuddy python software-packaging
Last synced: about 2 months ago
JSON representation
JSON config based software packager.
- Host: GitHub
- URL: https://github.com/cedricduriau/packagerbuddy
- Owner: cedricduriau
- License: gpl-3.0
- Created: 2018-11-25T10:07:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T11:08:55.000Z (over 2 years ago)
- Last Synced: 2024-10-06T20:36:27.669Z (over 1 year ago)
- Topics: json, packagerbuddy, python, software-packaging
- Language: Python
- Homepage:
- Size: 183 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PackagerBuddy
[](https://img.shields.io/badge/platform-linux--x64-lightgrey.svg)
[](https://img.shields.io/badge/platform-darwin--arm64-lightgrey.svg)
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://img.shields.io/badge/Python-3.8+-blue.svg)
[](https://img.shields.io/badge/coverage-90%25-brightgreen)
## Overview
PackagerBuddy is a JSON config based software packager written entirely in Python.
Use Cases
- I set up (virtual) machines often and want to have a quick way of setting up software.
- I run multiple versions of the same software package.
- I don't like how software auto-updates and installs a newer version
of itself.
## Install
If you wish to install the current master, use the following command:
```sh
# latest master
pip install git+git://github.com/cedricduriau/packagerbuddy.git
# specific version
pip install git+git://github.com/cedricduriau/packagerbuddy.git@{RELEASE}
```
## Usage
### Setup
The setup command will create all directories required to function. By default these are installed in the user home directory. To change the default location, see see [Configure](#Configure).
```sh
packagerbuddy setup
```
### Add software
The add command requires two arguments. The `software` argument used as alias to interact with, and the `url` argument which needs to be an url containing a version placeholder.
```sh
packagerbuddy add --software codium --url https://github.com/VSCodium/vscodium/releases/download/{version}/VSCodium-darwin-arm64-{version}.zip
```
### Remove software
The remove command requires a single argument, the `software` argument, which needs to match an already added software. To list the available software packages, see `avail` command below.
```sh
packagerbuddy remove --software codium
```
### List available software to install
The `avail` command prints all software names that are present in the config, supported by PackgerBuddy.
```sh
packagerbuddy avail
```
### Install software
The `install` command requires two arguments. The `software` argument which needs to match an alias in the software config and the `version` argument which needs to form an existing download url. If the requested software version has already been installed, the install will stop.
```sh
packagerbuddy install --software codium --version 1.85.2.2401
```
Installing consists of five steps:
1. Download the software from the url in the configs to the designated download directory.
2. Unpack the downloaded content.
3. Install/move the unpacked content to the designated install directory.
4. Run the post install script from the designated scripts directory.
### List installed software
The `list` command prints all installed software. PackagerBuddy knows the difference between ordinary directories and software it installed thanks to a package file which is written out at install time.
```sh
packagerbuddy list
```
### Uninstalling
The `uninstall` command, well, does exactly that. It checks if the given software is installed at all and if so, proceeds to remove the file system contents in the designated install location.
The `version` argument is optional. If it is passed, only given version will be removed. If it is not passed, **all** versions will be uninstalled of given software. Beware of this feature.
```sh
# uninstall all versions
packagerbuddy uninstall --software codium
# uninstall specific version
packagerbuddy uninstall --software codium --version 1.85.2.2401
```
## Configure
### Environment Variables
* `PB_CONFIG` : Path of the software config.
* default: custom file in the user home. (`~/.packagerbuddy/config/software.json`)
* `PB_DOWNLOAD` : Directory the software will be downloaded to.
* default: custom directory in the user home. (`~/.packagerbuddy/downloaded`)
* `PB_INSTALL`: Directory the software will be installed in.
* default: custom directory in the user home. (`~/.packagerbuddy/installed`)
* `PB_SCRIPTS`: Directory of the post install scripts.
* default: custom directory in the user home. (`~/.packagerbuddy/scripts`)
### Examples
If you want to try out the example shipping with the repository, run following commands from the root of this repo:
```sh
cp -R ./darwin-arm64/examples/* ~/.packagerbuddy/
```