Package Details: gitwatch-git 0.1.r58.gf895a5d-1

Git Clone URL: https://aur.archlinux.org/gitwatch-git.git (read-only, click to copy)
Package Base: gitwatch-git
Description: A bash script to watch a file or folder and commit changes to a git repo
Upstream URL: https://github.com/gitwatch/gitwatch
Licenses: GPL3
Submitter: tjaart
Maintainer: alexdandrea
Last Packager: Musse
Votes: 5
Popularity: 0.000000
First Submitted: 2015-05-30 02:53 (UTC)
Last Updated: 2022-09-02 17:18 (UTC)

Dependencies (2)

Required by (0)

Sources (1)

Latest Comments

Musse commented on 2022-09-02 17:19 (UTC) (edited on 2022-09-02 17:20 (UTC) by Musse)

Systemd service file has now been added

omn commented on 2020-06-19 23:33 (UTC) (edited on 2020-06-20 01:09 (UTC) by omn)

Thanks for providing this pkgbuild. The systemd service file that is distributed in the git repository is currently not installed on the system by the build definition. Did you consider adding it?

The following should do it if added to the end of the package() definition.

mkdir -p $pkgdir/usr/lib/systemd/system/
cp gitwatch/gitwatch@.service $pkgdir/usr/lib/systemd/system/

Edit: actually the service file also needs to be patched because it points to /usr/local/bin/ while the package is installed to /usr/bin.

The following patch fixes the pkgbuild and adds the patch for the service file:

diff --git a/PKGBUILD b/PKGBUILD
index 7ae84a1..969fad8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,16 +6,24 @@ pkgdesc="A bash script to watch a file or folder and commit changes to a git rep
 arch=('any')
 url="https://github.com/gitwatch/gitwatch"
 license=('GPL3')
-source=(git+https://github.com/nevik/gitwatch.git)
+source=('git+https://github.com/nevik/gitwatch.git'
+        'fix-bin-path.patch')
 depends=('git' 'inotify-tools')
-
-md5sums=('SKIP')
+md5sums=('SKIP'
+         '4a859d8ef9587f1e67bed9c5f7259eda')

 # I tried to use the pkgver() function, but it returned -1
 pkgver=`cd gitwatch; printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"`

+prepare() {
+  cd ${srcdir}/gitwatch
+  patch --forward --input="${srcdir}/fix-bin-path.patch"
+}
+
 package() {
   pwd
   mkdir -p $pkgdir/usr/bin
+  mkdir -p $pkgdir/usr/lib/systemd/system/
   cp gitwatch/gitwatch.sh $pkgdir/usr/bin/gitwatch
+  cp gitwatch/gitwatch@.service $pkgdir/usr/lib/systemd/system/
 }
diff --git a/fix-bin-path.patch b/fix-bin-path.patch
new file mode 100644
index 0000000..855e00a
--- /dev/null
+++ b/fix-bin-path.patch
@@ -0,0 +1,13 @@
+diff --git gitwatch@.service gitwatch@.service
+index 339ae7c..6d22765 100644
+--- gitwatch@.service
++++ gitwatch@.service
+@@ -3,7 +3,7 @@ Description=Watch file or directory and git commit all changes. run with: system
+ 
+ [Service]
+ Environment="SCRIPT_ARGS=%I"
+-ExecStart=/usr/local/bin/gitwatch $SCRIPT_ARGS
++ExecStart=/usr/bin/gitwatch $SCRIPT_ARGS
+ ExecStop=/bin/true
+ 
+ [Install]