diff options
author | Andy Weidenbaum | 2015-06-09 11:41:58 -0700 |
---|---|---|
committer | Andy Weidenbaum | 2015-06-09 11:41:58 -0700 |
commit | 98d7522296028c1308daefcb07f4abe503f8f02f (patch) | |
tree | fea7a797ce7eff54188a944946a412420f69d546 | |
download | aur-98d7522296028c1308daefcb07f4abe503f8f02f.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 57 | ||||
-rw-r--r-- | counterwallet.install | 41 |
3 files changed, 121 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d1e072ea86cd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = counterwallet-git + pkgdesc = Counterparty web wallet + pkgver = 20150420 + pkgrel = 1 + url = https://github.com/CounterpartyXCP/counterwallet + install = counterwallet.install + arch = any + groups = counterparty + license = CDDL + makedepends = git + makedepends = nodejs-bower + makedepends = nodejs-grunt-cli + makedepends = npm + optdepends = counterblockd-git: extended API services + optdepends = openresty: web app server + provides = counterwallet + conflicts = counterwallet + options = !strip + source = git+https://github.com/CounterpartyXCP/counterwallet + sha256sums = SKIP + +pkgname = counterwallet-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a77507d4bb23 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: Andy Weidenbaum <archbaum@gmail.com> + +pkgname=counterwallet-git +pkgver=20150420 +pkgrel=1 +pkgdesc="Counterparty web wallet" +arch=('any') +makedepends=('git' 'nodejs-bower' 'nodejs-grunt-cli' 'npm') +optdepends=('counterblockd-git: extended API services' + 'openresty: web app server') +groups=('counterparty') +url="https://github.com/CounterpartyXCP/counterwallet" +license=('CDDL') +source=(git+https://github.com/CounterpartyXCP/counterwallet) +sha256sums=('SKIP') +provides=('counterwallet') +conflicts=('counterwallet') +options=('!strip') +install=counterwallet.install + +pkgver() { + cd ${pkgname%-git} + git log -1 --format="%cd" --date=short | sed "s|-||g" +} + +prepare() { + cd ${pkgname%-git} + + msg 'Configuring counterwallet.conf.json for no Transifex lookups...' + cp -dpr --no-preserve=ownership counterwallet.conf.json.example counterwallet.conf.json + sed -i 's@"AVAIL.*@"AVAILABLE_LANGUAGES": ["en"],@' counterwallet.conf.json +} + +build() { + cd ${pkgname%-git} + + msg 'Fetching Web assets...' + cd src && bower install --allow-root --config.interactive=false && cd .. + + msg 'Fetching NPM dependencies...' + npm install + + msg 'Building the static site...' + grunt build +} + +package() { + cd ${pkgname%-git} + + msg 'Installing...' + install -dm 755 "$pkgdir/srv/http/counterwallet" + tar -c . | tar -x -C "$pkgdir/srv/http/counterwallet" + + msg 'Cleaning up pkgdir...' + find "$pkgdir" -type d -name .git -exec rm -r '{}' + + find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' + +} diff --git a/counterwallet.install b/counterwallet.install new file mode 100644 index 000000000000..d6a53c79a71b --- /dev/null +++ b/counterwallet.install @@ -0,0 +1,41 @@ +post_install() { + _mkuser + chown -R counterwallet:counterwallet /etc/counterwallet /srv/http/counterwallet + printf "%b\n" "$counterwallet" +} + +post_upgrade() { + post_install +} + +post_remove() { + _rmuser + rm -rf /etc/counterwallet /srv/http/counterwallet +} + +_mkuser() { + getent passwd counterwallet &>/dev/null || { + echo -n "Creating counterwallet user... " + grep -E "^counterwallet:" /etc/group >/dev/null || groupadd counterwallet + useradd -m -d /etc/counterwallet -g counterwallet -s /usr/bin/nologin counterwallet + echo "done" + } +} + +_rmuser() { + echo -n "Removing counterwallet user... " + userdel -rf counterwallet 2>/dev/null + echo "done" +} + +read -d '' counterwallet <<'EOF' +Counterwallet +============= + +Create a counterwallet.conf / counterwallet.testnet.conf file in the +counterblock config directory: + + $ cat > ~/.config/counterblock/counterwallet.conf <<'EOF' + [Default] + support-email=<your support email> +EOF |