make install

This commit is contained in:
secretspecter 2023-08-01 14:14:16 -06:00
parent 360623154d
commit 5a7db107ae
3 changed files with 59 additions and 15 deletions

View file

@ -9,9 +9,29 @@ clean:
-rm bin/geml-server -rm bin/geml-server
install: bin/geml-server install: bin/geml-server
cp bin/geml-server /usr/local/bin/geml-server id -u geml &>/dev/null || useradd geml --system
#cp geml.service /etc/systemd/system install \
--target-directory /usr/local/bin/ \
--mode 744 \
--owner geml \
--group geml \
bin/geml-server
install \
--target-directory /etc/systemd/system/ \
--mode 644 \
--owner geml \
--group geml \
geml.service
mkdir -p /etc/geml/
install \
--target-directory /etc/geml/ \
--owner geml \
--group geml \
--mode 644 \
geml.ini
uninstall: uninstall:
id -u geml &>/dev/null && userdel geml
rm /usr/local/bin/geml-server rm /usr/local/bin/geml-server
#rm /etc/systemd/system/geml.service rm /etc/systemd/system/geml.service
rm -rf /etc/geml/

View file

@ -34,6 +34,32 @@ openssl req -x509 \
## Usage ## Usage
### Standalone Executable
To get an executable `bin/geml-server` run `make`.
```sh
make && bin/geml-server -h
```
### Systemd
Install the build to `/usr/local/bin/geml-server` with
`sudo make install` which will also wire up systemd so you can `sudo systemctl
enable --now geml`
You'll need to `sudo systemctl restart geml` whenever you update
`/etc/geml/geml.ini`... you did do that didn't you?
### yeet it
To undo all that run these:
```sh
sudo make uninstall
make clean
```
### SBCL ### SBCL
Start sbcl with proper readline support: `rlwrap sbcl` Start sbcl with proper readline support: `rlwrap sbcl`
@ -42,15 +68,3 @@ Start sbcl with proper readline support: `rlwrap sbcl`
(ql:quickload "geml") (ql:quickload "geml")
(gemini.server:start-server "/etc/geml/geml.ini") (gemini.server:start-server "/etc/geml/geml.ini")
``` ```
### Standalone Executable
To get a `geml-server` binary run:
```sh
./build.sh && ./bin/geml-server -h
```
### Systemd
- [ ] geml.service

10
geml.service Normal file
View file

@ -0,0 +1,10 @@
[Unit]
Description=Gemini Server written in Common Lisp
After=network.target
[Service]
User=geml
ExecStart=/usr/local/bin/geml-server --config /etc/geml/geml.ini
[Install]
WantedBy=multi-user.target