diff options
author | ScriptSmith | 2020-01-01 12:16:16 +1000 |
---|---|---|
committer | ScriptSmith | 2020-01-01 12:16:16 +1000 |
commit | 018b28203acb9dc2e060a8c666784a12b0b7d4f7 (patch) | |
tree | 916fbd4a0ceb2b6facaa425909fd41bcd5b6bb69 | |
download | aur-018b28203acb9dc2e060a8c666784a12b0b7d4f7.tar.gz |
Initial upload: instamancer 3.0.1-1
instamancer: add instamancer
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 49 | ||||
-rw-r--r-- | instamancer.install | 11 |
3 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..404f81b2266c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = instamancer + pkgdesc = Scrape Instagram's API with Puppeteer. + pkgver = 3.0.1 + pkgrel = 1 + url = https://github.com/scriptsmith/instamancer + install = instamancer.install + arch = x86_64 + license = MIT + makedepends = npm + makedepends = jq + depends = nodejs + depends = alsa-lib + depends = gtk3 + depends = libcups + depends = libxss + depends = libxtst + depends = nss + noextract = instamancer-3.0.1.tgz + source = https://registry.npmjs.org/instamancer/-/instamancer-3.0.1.tgz + sha256sums = f894d909b2a9d8f932129f3202852e169f36bc5d1d15eb7c38e422f65e3d7280 + +pkgname = instamancer + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b27021151a23 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,49 @@ +# Maintainer: Adam Smith <adam at adamsm dot com> + +pkgname=instamancer +pkgver=3.0.1 +pkgrel=1 +pkgdesc="Scrape Instagram's API with Puppeteer." +arch=('x86_64') +url="https://github.com/scriptsmith/instamancer" +license=('MIT') +# Includes dependencies from google-chrome package +depends=('nodejs' 'alsa-lib' 'gtk3' 'libcups' 'libxss' 'libxtst' 'nss') +makedepends=('npm' 'jq') +install='instamancer.install' +source=(https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz) +noextract=($pkgname-$pkgver.tgz) +sha256sums=('f894d909b2a9d8f932129f3202852e169f36bc5d1d15eb7c38e422f65e3d7280') + +# Taken from https://wiki.archlinux.org/index.php/Node.js_package_guidelines +package() { + npm install \ + --ignore-scripts \ + --user root --global \ + --prefix "$pkgdir/usr" \ + "$srcdir"/$pkgname-$pkgver.tgz + + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. + find "${pkgdir}"/usr -type d -exec chmod 755 {} + + + # Remove references to $pkgdir + find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' + + # Remove references to $srcdir + local tmppackage="$(mktemp)" + local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" + mv "$tmppackage" "$pkgjson" + chmod 644 "$pkgjson" + + # npm gives ownership of ALL FILES to build user + # https://bugs.archlinux.org/task/63396 + chown -R root:root "$pkgdir" + + # Install license since the package doesn't include it + install -Dm0644 "$pkgdir/usr/lib/node_modules/$pkgname/LICENSE" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + + diff --git a/instamancer.install b/instamancer.install new file mode 100644 index 000000000000..feda4d61f6d9 --- /dev/null +++ b/instamancer.install @@ -0,0 +1,11 @@ +post_install() { + cd /usr/lib/node_modules/instamancer/node_modules/puppeteer + node install.js +} + +post_upgrade() { + cd /usr/lib/node_modules/instamancer/node_modules/puppeteer + node install.js +} + + |