diff options
-rw-r--r-- | app-shells/atuin/atuin-17.1.0-r1.ebuild (renamed from app-shells/atuin/atuin-17.1.0.ebuild) | 26 | ||||
-rw-r--r-- | app-shells/atuin/files/atuin.service | 10 |
2 files changed, 34 insertions, 2 deletions
diff --git a/app-shells/atuin/atuin-17.1.0.ebuild b/app-shells/atuin/atuin-17.1.0-r1.ebuild index b4c1180a83f9..73e7165fe160 100644 --- a/app-shells/atuin/atuin-17.1.0.ebuild +++ b/app-shells/atuin/atuin-17.1.0-r1.ebuild @@ -423,7 +423,7 @@ CRATES=" zeroize_derive@1.4.2 " -inherit cargo shell-completion +inherit cargo shell-completion systemd readme.gentoo-r1 DESCRIPTION="Shell history manager supporting encrypted synchronisation" HOMEPAGE="https://atuin.sh https://github.com/atuinsh/atuin" @@ -444,6 +444,7 @@ REQUIRED_USE=" sync? ( client ) test? ( client server sync ) " +RDEPEND="server? ( acct-user/atuin )" BDEPEND=">=virtual/rust-1.71.0" QA_FLAGS_IGNORED="usr/bin/${PN}" @@ -484,13 +485,20 @@ src_compile() { -o completions \ || die done + + mkdir shell-init || die + for shell in bash fish zsh; do + "${ATUIN_BIN}" init ${shell} > shell-init/${shell} || die + done } src_install() { exeinto "/usr/bin" doexe "${ATUIN_BIN}" - if ! use server; then + if use server; then + systemd_dounit "${FILESDIR}/atuin.service" + else rm -r "docs/docs/self-hosting" || die fi @@ -499,4 +507,18 @@ src_install() { newbashcomp "completions/${PN}.bash" "${PN}" dozshcomp "completions/_${PN}" dofishcomp "completions/${PN}.fish" + + insinto "/usr/share/${PN}" + doins -r shell-init + + local DOC_CONTENTS="Gentoo installs atuin's shell-init code under + /usr/share/atuin/shell-init/. + Therefore, instead of using, e.g., 'eval \"\$(atuin init zsh)\"' in + your .zshrc you can simply put \"source /usr/share/atuin/shell-init/zsh\" + there, which avoids the cost of forking a process." + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog } diff --git a/app-shells/atuin/files/atuin.service b/app-shells/atuin/files/atuin.service new file mode 100644 index 000000000000..6408e142b1a5 --- /dev/null +++ b/app-shells/atuin/files/atuin.service @@ -0,0 +1,10 @@ +[Unit] +Description=Atuin (shell history manager) server +After=network.target + +[Service] +ExecStart=/usr/bin/atuin server start +User=atuin + +[Install] +WantedBy=default.target |