Date: Wednesday, September 21, 2016 @ 08:14:39
  Author: tensor5
Revision: 190092

archrelease: copy trunk to community-any

Added:
  caprine/repos/community-any/
  caprine/repos/community-any/PKGBUILD
    (from rev 190091, caprine/trunk/PKGBUILD)
  caprine/repos/community-any/caprine.desktop
    (from rev 190091, caprine/trunk/caprine.desktop)
  caprine/repos/community-any/caprine.js
    (from rev 190091, caprine/trunk/caprine.js)

-----------------+
 PKGBUILD        |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 caprine.desktop |    9 ++++++++
 caprine.js      |   29 ++++++++++++++++++++++++++
 3 files changed, 97 insertions(+)

Copied: caprine/repos/community-any/PKGBUILD (from rev 190091, 
caprine/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD                              (rev 0)
+++ community-any/PKGBUILD      2016-09-21 08:14:39 UTC (rev 190092)
@@ -0,0 +1,59 @@
+# $Id$
+# Maintainer: Nicola Squartini <tens...@gmail.com>
+
+pkgname=caprine
+pkgver=1.5.0
+pkgrel=1
+pkgdesc='Unofficial Facebook Messenger app'
+arch=('any')
+url='https://github.com/sindresorhus/caprine'
+license=('MIT')
+depends=('electron')
+makedepends=('npm')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
+        'caprine.desktop'
+        'caprine.js')
+sha256sums=('84f06f119ef0bc76d21200a08d62335351b55dd856edd1392e2a6e33b7761e3e'
+            'ddb693c06b0d4adf41c799fd4d97c2d9c106669034f69f7af53a63cc45911a97'
+            '76bc862279afe9250554b8b6cdafde529648285e72b6a88d75403ef6b29c571c')
+
+build() {
+    cd ${pkgname}-${pkgver}
+
+    npm install --production
+}
+
+package() {
+    cd ${pkgname}-${pkgver}
+
+    appdir=/usr/lib/${pkgname}
+
+    install -d "${pkgdir}"${appdir}
+    cp -r * "${pkgdir}"${appdir}
+
+    hicolordir=/usr/share/icons/hicolor
+    install -dm755 "${pkgdir}"${hicolordir}/{1024x1024,scalable}/apps
+    ln -s $(realpath -m --relative-to=${hicolordir}/1024x1024/apps 
${appdir}/static/Icon.png) \
+        "${pkgdir}"${hicolordir}/1024x1024/apps/${pkgname}.png
+    ln -s $(realpath -m --relative-to=${hicolordir}/scalable/apps 
${appdir}/media/Icon.svg) \
+        "${pkgdir}"${hicolordir}/scalable/apps/${pkgname}.svg
+
+    install -Dm755 "${srcdir}"/${pkgname}.js "${pkgdir}"/usr/bin/${pkgname}
+    install -Dm644 "${srcdir}"/${pkgname}.desktop \
+            "${pkgdir}"/usr/share/applications/${pkgname}.desktop
+
+    install -dm755 "${pkgdir}"/usr/share/licenses/${pkgname}
+    ln -s $(realpath -m --relative-to=/usr/share/licenses/${pkgname} 
${appdir}/license) \
+        "${pkgdir}"/usr/share/licenses/${pkgname}
+
+    # Clean up
+    find "${pkgdir}"${appdir} \
+        -name "package.json" \
+            -exec sed -e "s|${srcdir}/${pkgname}-${pkgver}|${appdir}|" \
+                -i {} \; \
+        -or -name ".*" -prune -exec rm -r '{}' \; \
+        -or -name "bin" -prune -exec rm -r '{}' \; \
+        -or -name "example" -prune -exec rm -r '{}' \; \
+        -or -name "examples" -prune -exec rm -r '{}' \; \
+        -or -name "test" -prune -exec rm -r '{}' \;
+}

Copied: caprine/repos/community-any/caprine.desktop (from rev 190091, 
caprine/trunk/caprine.desktop)
===================================================================
--- community-any/caprine.desktop                               (rev 0)
+++ community-any/caprine.desktop       2016-09-21 08:14:39 UTC (rev 190092)
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=Caprine
+GenericName=IM Client
+Comment=Unofficial Facebook Messenger app
+Icon=caprine
+Exec=caprine
+Categories=GTK;InstantMessaging;Network;
+StartupNotify=true

Copied: caprine/repos/community-any/caprine.js (from rev 190091, 
caprine/trunk/caprine.js)
===================================================================
--- community-any/caprine.js                            (rev 0)
+++ community-any/caprine.js    2016-09-21 08:14:39 UTC (rev 190092)
@@ -0,0 +1,29 @@
+#!/usr/bin/electron
+
+const name = 'caprine';
+
+const {app} = require('electron');
+const fs = require('fs');
+const path = require('path');
+
+// Change command name.
+const fd = fs.openSync('/proc/self/comm', fs.constants.O_WRONLY);
+fs.writeSync(fd, name);
+fs.closeSync(fd);
+
+// Remove first command line argument (/usr/bin/electron).
+process.argv.splice(0, 1);
+
+// Set application paths.
+const appPath = path.join(path.dirname(__dirname), 'lib', name);
+const packageJson = require(path.join(appPath, 'package.json'));
+const productName = packageJson.productName;
+app.setAppPath(appPath);
+app.setDesktopName(name + '.desktop');
+app.setName(productName);
+app.setPath('userCache', path.join(app.getPath('cache'), productName));
+app.setPath('userData', path.join(app.getPath('appData'), productName));
+app.setVersion(packageJson.version);
+
+// Run the application.
+require('module')._load(appPath, module, true);

Reply via email to