summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dyakov2018-11-17 05:26:35 +0600
committerDenis Dyakov2018-11-17 05:26:35 +0600
commit0519e1b66a1d6334637dc1bec5b07ac699a26f04 (patch)
tree7f86238519f80e1865aa1975e4670ab126074eba
downloadaur-0519e1b66a1d6334637dc1bec5b07ac699a26f04.tar.gz
Initial commit
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore17
-rw-r--r--PKGBUILD66
-rw-r--r--gorsync-git.install71
4 files changed, 174 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..3788ca8a345
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = gorsync-git
+ pkgdesc = GTK+ frontend for RSYNC console utility.
+ pkgver = 0.3
+ pkgrel = 1
+ url = https://github.com/d2r2/go-rsync
+ install = gorsync-git.install
+ arch = x86_64
+ arch = i686
+ license = GPL3
+ makedepends = git
+ makedepends = go
+ depends = rsync
+ depends = glib2
+ depends = gtk3
+ provides = gorsync
+ source = go-rsync::git+https://github.com/d2r2/go-rsync.git
+ md5sums = SKIP
+
+pkgname = gorsync-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..1a6df5f16a2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,17 @@
+### https://raw.github.com/github/gitignore/fa441f903154d8159ef71db23d4816d802450fef/ArchLinuxPackages.gitignore
+
+*.tar
+*.tar.*
+*.jar
+*.exe
+*.msi
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+
+pkg/
+src/
+go-rsync/
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3dc5dc3a523
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Denis Dyakov <denis.dyakov@gmail.com>
+
+pkgname=gorsync-git
+_pkgname=go-rsync
+pkgver=0.3
+epoch=
+pkgrel=1
+pkgdesc="GTK+ frontend for RSYNC console utility."
+arch=('x86_64' 'i686')
+url="https://github.com/d2r2/go-rsync"
+license=('GPL3')
+makedepends=('git' 'go')
+depends=('rsync' 'glib2' 'gtk3')
+provides=('gorsync')
+install="${pkgname}.install"
+source=("${_pkgname}"::'git+https://github.com/d2r2/go-rsync.git')
+md5sums=('SKIP')
+
+# Get the tag of the commit to use
+# Separated out to allow for `makepkg -e` not running prepare()
+_get_tag() {
+ _tag=$(git tag --list | grep '^v' | grep -v alpha | tail -n1)
+ echo "Selected git tag: $_tag" >&2 # To STDERR as called from pkgver()
+}
+
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+ _get_tag
+ git reset --hard "${_tag}"
+}
+
+pkgver() {
+ cd "${srcdir}/${_pkgname}"
+ [[ -z ${_tag-} ]] && _get_tag
+ # Example: v2.1.0-beta-3 -> 2.1.0.beta.r3
+ # Version specification: https://github.com/robert7/nixnote2/issues/28
+ # echo "$_tag" | sed -E 's/^v//;s/-?([0-9]+)$/.r\1/;s/-/./'
+ echo "${_tag}" | sed 's/^v//;s/-/./g'
+}
+
+
+#pkgver() {
+# cd "${srcdir}/${_pkgname}"
+# git describe --tags --long | sed 's/^v//;s/-/./g'
+#}
+
+build() {
+ rm -rf "${srcdir}/.go/src"
+ mkdir -p "${srcdir}/.go/src"
+ # export GOPATH="${srcdir}/.go"
+ mv "${srcdir}/${_pkgname}" "${srcdir}/.go/src/"
+ cd "${srcdir}/.go/src/${_pkgname}/"
+ # download and build main package and all dependencies
+ GOPATH="${srcdir}/.go" go get -u -v all && ./gorsync_build.sh
+}
+
+package() {
+ _binname="gorsync"
+ # echo "Working dir $(pwd)"
+ cd "${srcdir}/.go/src/${_pkgname}"
+ install -Dm755 "${_binname}" "${pkgdir}/usr/bin/${_binname}"
+ install -Dm644 "builds/gorsync.desktop" "$pkgdir/usr/share/applications/gorsync.desktop"
+ install -Dm644 "ui/gtkui/gsettings/org.d2r2.gorsync.gschema.xml" "$pkgdir/gsettings/org.d2r2.gorsync.gschema.xml"
+ # install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"
+}
+
diff --git a/gorsync-git.install b/gorsync-git.install
new file mode 100644
index 00000000000..92a840bd1ae
--- /dev/null
+++ b/gorsync-git.install
@@ -0,0 +1,71 @@
+post_install() {
+ :
+#!/usr/bin/env sh
+
+#if [ -z "$1" ]; then
+ export PREFIX=/usr
+#else
+# export PREFIX=$1
+#fi
+
+if [ "$PREFIX" = "/usr" ] && [ "$(id -u)" != "0" ]; then
+ # Make sure only root can run our script
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
+# Check availability of required commands
+# COMMANDS="install glib-compile-schemas glib-compile-resources msgfmt desktop-file-validate gtk-update-icon-cache"
+COMMANDS="install glib-compile-schemas glib-compile-resources msgfmt desktop-file-validate gtk-update-icon-cache"
+# if [ "$PREFIX" = '/usr' ] || [ "$PREFIX" = "/usr/local" ]; then
+# COMMANDS="$COMMANDS xdg-desktop-menu"
+# fi
+# PACKAGES="coreutils glib2 glib2 gettext desktop-file-utils gtk-update-icon-cache xdg-utils"
+PACKAGES="coreutils glib2 glib2 gettext desktop-file-utils gtk-update-icon-cache xdg-utils"
+i=0
+for COMMAND in $COMMANDS; do
+ type $COMMAND >/dev/null 2>&1 || {
+ j=0
+ for PACKAGE in $PACKAGES; do
+ if [ $i = $j ]; then
+ break
+ fi
+ j=$(( $j + 1 ))
+ done
+ echo "Your system is missing command $COMMAND, please install $PACKAGE"
+ exit 1
+ }
+ i=$(( $i + 1 ))
+done
+
+echo "Installing gsettings schema to prefix ${PREFIX}"
+
+# Copy and compile schema
+echo "Copying and compiling schema..."
+install -d ${PREFIX}/share/glib-2.0/schemas
+install -m 644 gsettings/org.d2r2.gorsync.gschema.xml ${PREFIX}/share/glib-2.0/schemas/
+glib-compile-schemas ${PREFIX}/share/glib-2.0/schemas/
+
+
+}
+pre_remove() {
+ :
+#!/usr/bin/env sh
+
+#if [ -z "$1" ]; then
+ export PREFIX=/usr
+ # Make sure only root can run our script
+ if [ "$(id -u)" != "0" ]; then
+ echo "This script must be run as root" 1>&2
+ exit 1
+ fi
+#else
+# export PREFIX=$1
+#fi
+
+echo "Uninstalling gsettings schema from prefix ${PREFIX}"
+
+rm ${PREFIX}/share/glib-2.0/schemas/org.d2r2.gorsync.gschema.xml
+glib-compile-schemas ${PREFIX}/share/glib-2.0/schemas/
+
+}