Created
October 9, 2015 09:02
-
-
Save mugifly/ecf7585b543cdabeb23d to your computer and use it in GitHub Desktop.
PKGBUILD file for odenwlan-node (It also an example of PKGBUILD file for Electron based app.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /usr/lib/odenwlan-node/ | |
npm start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Masanori Ohgita <mp_aur[at]ohgita[dot]info> | |
pkgname=odenwlan-node | |
pkgver=1.3.0 | |
pkgrel=1 | |
pkgdesc="An automatic login tool for Wi-Fi of OECU" | |
url="https://github.com/odentools/odenwlan-node/" | |
arch=('i686' 'x86_64') | |
license=('MIT') | |
depends=('nodejs>=4.1.1' 'npm>=3.3.4') | |
makedepens=('git') | |
source=( | |
"https://github.com/odentools/odenwlan-node/tarball/v${pkgver}" | |
'odenwlan-node.sh' | |
) | |
sha256sums=( | |
'dc52ababe39187ddb8c00017f6fde6d58c2d980511a2b5fc23d8e558915881d0' | |
'5a66134694f2b4127e8d2731e6c2bc9defb964b4ab7431949506209e27c8c37a' | |
) | |
_github_username=odentools | |
package() { | |
# Copy a startup script to package directory | |
mkdir -p "${pkgdir}/usr/lib/${pkgname}/" | |
install -Dm755 odenwlan-node.sh "${pkgdir}/usr/bin/odenwlan-node" | |
# Get a path of fetched source directory | |
_git_rev=`ls ${srcdir}/|grep --regexp="[^-]*$" --only-matching --max-count=1` | |
_git_srcdir="${srcdir}/${_github_username}-${pkgname}-${_git_rev}" | |
# Change to fetched source directory | |
cd "${_git_srcdir}" | |
# Install dependency modules | |
npm install --production | |
# Copy the app files & dependency modules to package directory | |
mkdir -p "${pkgdir}/usr/lib/${pkgname}/" | |
cp -r ./* "${pkgdir}/usr/lib/${pkgname}/" | |
# Copy a license file to package directory | |
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | |
# Remove references to $srcdir of node_modules directory | |
grep -l "${srcdir}" -r "${pkgdir}" | xargs sed -i "s#${_git_srcdir}#/usr/lib/${pkgname}#g" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment