diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 09792d0..ad41706 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -20,6 +20,57 @@ dockers: - "tardisx/linkwallet" build_flag_templates: - "--platform=linux/amd64" +nfpms: + - + id: default + package_name: linkwallet + file_name_template: "{{ .ConventionalFileName }}" + builds: + replacements: + darwin: darwin + linux: linux + windows: windows + 386: 386 + amd64: amd64_v1 + vendor: + maintainer: Justin Hawkins + description: |- + A self-hosted bookmark database with full-text page content search. + formats: + # - apk + - deb + # - rpm + dependencies: + recommends: + suggests: + conflicts: + replaces: + epoch: + prerelease: + version_metadata: + release: + section: default + priority: extra + meta: false + scripts: + preinstall: "etc/preinstall.sh" + postinstall: "etc/postinstall.sh" + preremove: "etc/preremove.sh" + postremove: "etc/postremove.sh" + contents: + - src: etc/linkwallet.service + dst: /lib/systemd/system/linkwallet.service + file_info: + mode: 0664 + #mtime: 2008-01-02T15:04:05Z + owner: root + group: root + - dst: /var/lib/linkwallet + type: dir + file_info: + mode: 0700 + owner: linkwallet + group: linkwallet archives: - replacements: darwin: Darwin diff --git a/etc/linkwallet.service b/etc/linkwallet.service new file mode 100644 index 0000000..6ec68bc --- /dev/null +++ b/etc/linkwallet.service @@ -0,0 +1,10 @@ +[Unit] +Description=linkwallet + +[Service] +ExecStart=/usr/bin/linkwallet -db-path /var/lib/linkwallet/linkwallet.db +User=linkwallet +Group=linkwallet + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/etc/postinstall.sh b/etc/postinstall.sh new file mode 100644 index 0000000..159776e --- /dev/null +++ b/etc/postinstall.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +systemctl daemon-reload +systemctl enable linkwallet +systemctl start linkwallet \ No newline at end of file diff --git a/etc/postremove.sh b/etc/postremove.sh new file mode 100644 index 0000000..9945a8e --- /dev/null +++ b/etc/postremove.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +userdel linkwallet +systemctl daemon-reload diff --git a/etc/preinstall.sh b/etc/preinstall.sh new file mode 100644 index 0000000..a9d1cb7 --- /dev/null +++ b/etc/preinstall.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +useradd linkwallet diff --git a/etc/preremove.sh b/etc/preremove.sh new file mode 100644 index 0000000..d220aef --- /dev/null +++ b/etc/preremove.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +systemctl disable linkwallet +systemctl stop linkwallet \ No newline at end of file