diff options
author | Andrei Pozolotin | 2016-11-01 13:56:41 -0500 |
---|---|---|
committer | Andrei Pozolotin | 2016-11-01 13:56:41 -0500 |
commit | 94f9c53257aa48526021b92f5c2809af5acc66ef (patch) | |
tree | 2641b6bfa3e1f5f7606916a4be3984cfb9fb7277 | |
download | aur-s3-bash.tar.gz |
A .SRCINFO
A .gitignore
A PKGBUILD
A s3-bash-aur.launch
A s3-bash-aur.launch.sh
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | s3-bash-aur.launch | 10 | ||||
-rwxr-xr-x | s3-bash-aur.launch.sh | 111 |
5 files changed, 165 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..07b5b57b4d62 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,14 @@ +pkgbase = s3-bash + pkgdesc = Access s3 from bash + pkgver = 1 + pkgrel = 1 + url = https://github.com/random-archer/s3-bash + arch = i686 + arch = x86_64 + license = Apache + makedepends = git + source = git+https://github.com/random-archer/s3-bash.git#branch=master + md5sums = SKIP + +pkgname = s3-bash + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..08eb2a15d553 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# eclipse meta data +.project + +# generated resources +/*/ +/*.xz +/*.log + +# build resources +gopath/ +bin/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cc2d9ab04225 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,19 @@ +pkgdesc="Access s3 from bash" +pkgname=s3-bash +pkgver=1 +pkgrel=1 +arch=('i686' 'x86_64') +url="https://github.com/random-archer/s3-bash" +#source=("git+${url}.git#tag=v$pkgver") +source=("git+${url}.git#branch=master") +md5sums=('SKIP') +license=('Apache') +makedepends=('git') + +package() { + cd "$pkgname" + install -D -m755 s3-common-functions "$pkgdir/usr/bin/s3-common-functions" + install -D -m755 s3-delete "$pkgdir/usr/bin/s3-delete" + install -D -m755 s3-get "$pkgdir/usr/bin/s3-get" + install -D -m755 s3-put "$pkgdir/usr/bin/s3-put" +} diff --git a/s3-bash-aur.launch b/s3-bash-aur.launch new file mode 100644 index 000000000000..cd44e6fd15f5 --- /dev/null +++ b/s3-bash-aur.launch @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/s3-bash-aur/s3-bash-aur.launch.sh}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/s3-bash-aur}"/> +</launchConfiguration> diff --git a/s3-bash-aur.launch.sh b/s3-bash-aur.launch.sh new file mode 100755 index 000000000000..1c1d17e62b9c --- /dev/null +++ b/s3-bash-aur.launch.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# build package automation + +readonly location=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd) +source $location/PKGBUILD + +is_root() { + [[ $(id -u) == 0 ]] +} + +has_makepkg() { + which makepkg >/dev/null 2>&1 +} + + +do_provision() { + if has_makepkg ; then + do_provision_proper + else + do_provision_simple + fi +} + +do_provision_proper() { + echo "// do_provision_proper" + local suno="" + if is_root ; then + chown -R nobody $location + suno="sudo -u nobody" + fi + $suno makepkg --force +} + +do_provision_simple() { + echo "// do_provision_simple" + local source="$url.git" + if [[ -e $pkgname ]] ; then + git -C $pkgname pull + else + git clone $source + fi +} + +do_version() { + #echo "version $pkgver -> $(pkgver)" + if has_makepkg; then + do_version_proper + else + do_version_simple + fi +} + +do_version_simple() { + echo "// do_version_simple" + + local pkgver=$(pkgver) + local file_list="PKGBUILD .SRCINFO" + + local file + for file in $file_list ; do + sed -r -i "s%^([ ]*pkgver[ ]*=[ ]*).*%\1$pkgver%" "$file" + sed -r -i "s%#tag=v[0-9]+%#tag=v$pkgver%" "$file" + done +} + +do_version_proper() { + echo "// do_version_proper" + + local suno="" + local user="nobody" + if is_root ; then + chown -R $user $location + suno="sudo -u $user" + fi + + $suno makepkg --printsrcinfo > .SRCINFO + +} + +do_commit() { + echo "// do_commit" + + git add --all :/ + git status + + local message=$(git status --short) + git commit --message "$message" + + git push + +} + +do_clean() { + echo "// clean" + rm -rf "$location/$pkgname" + rm -rf "$location/src" + rm -rf "$location/pkg" +} + +### + +#set -e + +do_provision + +do_version + +do_commit + +do_clean |