summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authors7hoang2022-01-20 04:11:48 -0500
committers7hoang2022-01-20 04:11:48 -0500
commit523007217cab41b4913f21a9125ad05582862d2c (patch)
treefef5954e7ca9633de5a5e1c22f65b25bbca25a02
parent31dfbd8ef0410e7a0dc1bcfded9dd9f56ba30ed4 (diff)
parent24629c355407c9f92823581c53c633aca31389e9 (diff)
downloadaur-523007217cab41b4913f21a9125ad05582862d2c.tar.gz
Merge branch 'manpage'
-rw-r--r--PKGBUILD17
-rw-r--r--anki-sync-server.groff93
-rw-r--r--anki-sync-server.install72
3 files changed, 109 insertions, 73 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e34f96af482b..4b49c02058f6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: s7hoang <s7hoang at gmail dot com>
# Contributors: Janne Heß <jannehess at gmail dot com>
pkgname=anki-sync-server-git
-pkgver=r379.44ab07f
+pkgver=r425.ef41934
pkgrel=1
pkgdesc="A sync server for anki using a forked version from github.com/ankicommunity (orig:dsnopek)"
arch=('any')
@@ -56,12 +56,21 @@ prepare() {
# set user and directory information for systemd service file
# the user is going to be named the same thing as the package name (minus '-git')
- sed "8s/changeme/${pkgname%-git}/" plugins/systemd/anki-sync-server.service -i
- sed "9s/changeme/${pkgname%-git}/" plugins/systemd/anki-sync-server.service -i
- sed "10s|changeme|/opt/${pkgname%-git}|" plugins/systemd/anki-sync-server.service -i
+ sed "s/\(User=\)changeme/\1${pkgname%-git}/" plugins/systemd/anki-sync-server.service -i
+ sed "s/\(Group=\)changeme/\1${pkgname%-git}/" plugins/systemd/anki-sync-server.service -i
+ sed "s|\(WorkingDirectory=\)changeme|\1/opt/${pkgname%-git}|" plugins/systemd/anki-sync-server.service -i
+
+ # build manpage
+ local _man_="${_plugins_}/man/man1"
+ cd "${srcdir}"
+ mkdir -p "${_man_}"
+ cat "../anki-sync-server.groff" | gzip > "${_man_}/anki-sync-server.1.gz"
}
package() {
mkdir -p "${pkgdir}${_install_dir_}"
cp -R "${srcdir}/${_anki_dir_}/." "${pkgdir}${_install_dir_}"
+
+ mkdir -p "${pkgdir}/usr/share/man/man1"
+ ln -s -T "${_install_dir_}/plugins/man/man1/anki-sync-server.1.gz" "${pkgdir}/usr/share/man/man1/anki-sync-server.1.gz"
}
diff --git a/anki-sync-server.groff b/anki-sync-server.groff
new file mode 100644
index 000000000000..ff053426ba5f
--- /dev/null
+++ b/anki-sync-server.groff
@@ -0,0 +1,93 @@
+.ds server anki-sync-server
+.ds server-dir /opt/anki-sync-server
+
+.TH \*[server] 1 "" "" "Post Installation Guide"
+
+.SH Adding a user
+.PP
+You'll need to go to:
+
+.EX
+ \*[server-dir]
+.EE
+
+and run:
+
+.EX
+ sudo -u \*[server] ./ankisyncctl.py adduser <username>
+.EE
+
+to add a new user to the \*[server] database.
+
+.SH Plugin Installation
+.PP
+To have your anki client interface with the server, you'll need to copy the plugin
+from \fI\*[server-dir]/plugins\fR to the relevant directory.
+
+.ds anki-2.1.28 ~/.local/share/Anki2/addons21
+.ds anki-2.1 ~/.local/share/Anki2/addons21
+.ds anki-2 ~/Anki/addons
+.ds anki-plugins \*[server-dir]/plugins
+
+\fIAnki 2.1.28 (and up):\fR \*[anki-2.1.28]
+.EX
+ ln -s \\
+ \*[anki-plugins]/anki2.1.28/\*[server] \\
+ \*[anki-2.1.28]/\*[server]
+.EE
+
+\fIAnki 2.1:\fR \*[anki-2.1]
+.EX
+ ln -s \\
+ \*[anki-plugins]/anki2.1/\*[server] \\
+ \*[anki-2.1]/\*[server]
+.EE
+
+\fIAnki 2.0:\fR \*[anki-2]
+.EX
+ ln -s \\
+ \*[anki-plugins]/anki2.0/\*[server].py \\
+ \*[anki-2]/\*[server].py
+.EE
+
+or your OS equivalent.
+
+.SH Running The Server
+.PP
+The server should be set to auto start via \fIsystemctl\fR and should be already running.
+See:
+
+.EX
+ systemctl status \*[server]
+ systemctl status nginx
+.EE
+
+for details.
+
+Otherwise, to run the server go to:
+
+.EX
+ \*[server-dir]/
+.EE
+
+then run:
+
+.EX
+ sudo -u \*[server] python -m ankisyncd
+.EE
+
+.B NOTE: if you run it as another user you may have to install the python dependencies again:
+
+.EX
+ pip install -r \*[server-dir]/requirements.txt [--user]
+.EE
+
+.B Be aware you may have trouble with permissions on your auth.db and
+.B other files if you run as different users!
+
+.SH NGINX
+.PP
+\fI/etc/nginx/nginx.conf\fR may have been modified. If the installation modifed
+the \fInginx.conf\fR file, a backup has been saved to
+\fI/etc/nginx/nginx.conf.pacsave\fR. It would be a good idea to to see if
+anything has gone awry.
diff --git a/anki-sync-server.install b/anki-sync-server.install
index 2446fd8c4399..e22e8318491d 100644
--- a/anki-sync-server.install
+++ b/anki-sync-server.install
@@ -20,75 +20,9 @@ post_install() {
systemctl start anki-sync-server
# post installation instructions
- cat << EOF
-=======================================================================
-------------------
-Post Installation:
-------------------
-You'll need to go to:
-
- /opt/anki-sync-server
-
-and run:
-
- sudo -u anki-sync-server ./ankisyncctl.py adduser <username>
-
-to add a new user to the anki database.
-
---------------------
-Plugin Installation:
---------------------
-To have anki interface with the server, you'll need to copy the plugin
-from /opt/anki-sync-server/plugins to the relevant directory.
-
-Anki 2.1.28 (and up): ~/.local/share/Anki/addons21
- ln -s /opt/anki-sync-server/plugins/anki2.1.28/anki-sync-server \\
- ~/.local/share/Anki2/addons21/
-
-Anki 2.1: ~/.local/share/Anki2/addons21/
- ln -s /opt/anki-sync-server/plugins/anki2.1/anki-sync-server \\
- ~/.local/share/Anki2/addons21/
-
-Anki 2.0: ~/Anki/addons
- ln -s /opt/anki-sync-server/plugins/anki2.0/anki-sync-server.py \\
- ~/Anki/addons
-
-or your OS equivalent.
-
----------------
-Run The Server:
----------------
-The server should be set to auto start via systemctl and should be already running.
-See:
-
- systemctl status anki-sync-server
- systemctl status nginx
-
-for details.
-
-Otherwise, to run the server go to:
-
- /opt/anki-sync-server/
-
-then run:
-
- sudo -u anki-sync-server python -m ankisyncd
-
-if you run it as another user you may have to install the dependencies again:
-
- pip install -r /opt/anki-sync-server/requirements.txt [--user]
-
-=== (be aware you may have trouble with permissions on your auth.db if you run as different users!) ===
-
------
-NGINX
------
-/etc/nginx/nginx.conf has been modified and a backup has been saved to /etc/nginx/nginx.conf.pacsave. It would be a good idea to diff to see if anything has gone awry.
-
-nginx.service is set to autostart.
-
-=======================================================================
-EOF
+ echo "==============================================="
+ echo "Check the manpage for post-install instructions"
+ echo "==============================================="
}
post_remove(){