From 76ecad7439038ddf93de96c208aa6274e472d07d Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 12 Jan 2018 23:15:21 -0500 Subject: [PATCH] Use .in template for git@.service to ensure paths are substituted The paths don't change often, but if they do this is one less place which will need to be updated. It also makes it easier for anyone rebuilding the packages to change the defaults. --- git.spec | 10 +++++++--- git@.service | 8 -------- git@.service.in | 8 ++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 git@.service create mode 100644 git@.service.in diff --git a/git.spec b/git.spec index abe243c..95cc481 100644 --- a/git.spec +++ b/git.spec @@ -73,7 +73,7 @@ Source11: git.xinetd.in Source12: git.conf.httpd Source13: git-gui.desktop Source14: gitweb.conf.in -Source15: git@.service +Source15: git@.service.in Source16: git.socket # Script to print test failure output (used in %%check) @@ -487,8 +487,11 @@ rm -rf %{buildroot}%{_mandir} mkdir -p %{buildroot}%{_localstatedir}/lib/git %if %{use_systemd} -mkdir -p %{buildroot}%{_unitdir} -cp -a %{SOURCE15} %{SOURCE16} %{buildroot}%{_unitdir} +install -Dp -m 0644 %{SOURCE16} %{buildroot}%{_unitdir}/git.socket +perl -p \ + -e "s|\@GITEXECDIR\@|%{gitexecdir}|g;" \ + -e "s|\@BASE_PATH\@|%{_localstatedir}/lib/git|g;" \ + %{SOURCE15} > %{buildroot}%{_unitdir}/git@.service %else mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d perl -p \ @@ -768,6 +771,7 @@ rm -rf %{buildroot} %changelog * Fri Jan 12 2018 Todd Zullinger - Add %%{emacs_filesystem} to simplify emacs support +- Use .in template for git@.service to ensure paths are substituted * Thu Jan 11 2018 Todd Zullinger - Update BuildRequires for tests diff --git a/git@.service b/git@.service deleted file mode 100644 index 185ff25..0000000 --- a/git@.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Git Repositories Server Daemon -Documentation=man:git-daemon(1) - -[Service] -User=nobody -ExecStart=-/usr/libexec/git-core/git-daemon --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose -StandardInput=socket diff --git a/git@.service.in b/git@.service.in new file mode 100644 index 0000000..bb93b78 --- /dev/null +++ b/git@.service.in @@ -0,0 +1,8 @@ +[Unit] +Description=Git Repositories Server Daemon +Documentation=man:git-daemon(1) + +[Service] +User=nobody +ExecStart=-@GITEXECDIR@/git-daemon --base-path=@BASE_PATH@ --export-all --user-path=public_git --syslog --inetd --verbose +StandardInput=socket