docs: document packaging and system-wide installation
Describe installing from the Arch and Debian packages, system-wide installs via PREFIX/DESTDIR, the packaging release flow, and add the new directories to the project layout.
This commit is contained in:
@@ -41,24 +41,67 @@ already seen so nothing is delivered twice.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
### Arch Linux
|
||||||
|
|
||||||
|
A `PKGBUILD` lives in [`packaging/archlinux`](packaging/archlinux). Build and
|
||||||
|
install the package with `makepkg`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://src.panahifar.ir/ahp/lazyntfy.git
|
||||||
|
cd lazyntfy/packaging/archlinux
|
||||||
|
makepkg -si
|
||||||
|
```
|
||||||
|
|
||||||
|
This installs `/usr/bin/lazyntfy`, the man page under `/usr/share/man`, the
|
||||||
|
license, and the README, and pulls in `ca-certificates` so TLS to your ntfy
|
||||||
|
server works.
|
||||||
|
|
||||||
|
### Debian and Ubuntu
|
||||||
|
|
||||||
|
A debhelper-free source package lives in [`debian`](debian). Build a `.deb` and
|
||||||
|
install it system-wide:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://src.panahifar.ir/ahp/lazyntfy.git
|
||||||
|
cd lazyntfy
|
||||||
|
make deb # writes dist/lazyntfy_<version>_<arch>.deb
|
||||||
|
sudo apt install ./dist/lazyntfy_*.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
`apt install ./file.deb` (or `dpkg -i` followed by `apt -f install`) resolves
|
||||||
|
the `ca-certificates` dependency. The packaging needs only the Go toolchain and
|
||||||
|
`dpkg-dev`; `make deb` passes `-d` so it also builds where `golang-go` is not
|
||||||
|
installed as a distribution package.
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://src.panahifar.ir/ahp/lazyntfy.git
|
git clone https://src.panahifar.ir/ahp/lazyntfy.git
|
||||||
cd lazyntfy
|
cd lazyntfy
|
||||||
make install # installs the binary and the man page under ~/.local
|
make install # into ~/.local, no root needed
|
||||||
```
|
```
|
||||||
|
|
||||||
`make install` honors `PREFIX` (default `~/.local`):
|
`make install` honors `PREFIX`, `BINDIR`, `MANDIR`, `DOCDIR`, and `DESTDIR`.
|
||||||
|
Picking a system prefix installs for every user:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make install PREFIX=/usr/local
|
sudo make install PREFIX=/usr/local # /usr/local/bin/lazyntfy, /usr/local/share/man/man1
|
||||||
|
sudo make install PREFIX=/usr # /usr/bin/lazyntfy, /usr/share/man/man1
|
||||||
|
```
|
||||||
|
|
||||||
|
Stage a filesystem tree into a temporary root instead of the live system (handy
|
||||||
|
for building your own package):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make install DESTDIR="$PWD/stage" PREFIX=/usr
|
||||||
```
|
```
|
||||||
|
|
||||||
### With `go install`
|
### With `go install`
|
||||||
|
|
||||||
|
From a checkout:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go install ./cmd/lazyntfy@latest # or: go install lazyntfy/cmd/lazyntfy
|
go install ./cmd/lazyntfy # binary in $(go env GOPATH)/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -131,6 +174,25 @@ messages are pruned on startup. Credentials are never written to the database
|
|||||||
the current run's authentication is always used. History is best effort: if the
|
the current run's authentication is always used. History is best effort: if the
|
||||||
file cannot be opened, the client still runs.
|
file cannot be opened, the client still runs.
|
||||||
|
|
||||||
|
## Packaging
|
||||||
|
|
||||||
|
Both package formats are defined in the repository. `make deb` builds a Debian
|
||||||
|
package from the working tree; the Arch `PKGBUILD` builds the `v$pkgver` release
|
||||||
|
archive from the Gitea instance.
|
||||||
|
|
||||||
|
| Format | Build | Definition |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Debian / Ubuntu | `make deb` → `dist/*.deb` | [`debian/`](debian) |
|
||||||
|
| Arch Linux | `make arch` → `makepkg` | [`packaging/archlinux/PKGBUILD`](packaging/archlinux/PKGBUILD) |
|
||||||
|
|
||||||
|
When cutting a release:
|
||||||
|
|
||||||
|
1. Bump the version in [`debian/changelog`](debian/changelog) and `pkgver` in
|
||||||
|
the `PKGBUILD`.
|
||||||
|
2. Tag the commit (`git tag -s vX.Y.Z`) and push it.
|
||||||
|
3. In `packaging/archlinux`, run `updpkgsums` to refresh the tarball checksum and
|
||||||
|
`makepkg --printsrcinfo > .SRCINFO`.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -162,6 +224,8 @@ go test ./internal/history/...
|
|||||||
| `internal/textutil` | width-aware text wrapping and clipping |
|
| `internal/textutil` | width-aware text wrapping and clipping |
|
||||||
| `internal/tui` | Bubble Tea interface |
|
| `internal/tui` | Bubble Tea interface |
|
||||||
| `man` | `lazyntfy(1)` man page |
|
| `man` | `lazyntfy(1)` man page |
|
||||||
|
| `debian` | Debian / Ubuntu package definition |
|
||||||
|
| `packaging/archlinux` | Arch Linux `PKGBUILD` |
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user