2021-03-24 02:11:17 +02:00
|
|
|
pkgname=brainlet-git
|
|
|
|
_name=brainlet
|
|
|
|
_repository=brainlet
|
2021-03-27 15:47:37 +02:00
|
|
|
pkgver=102
|
2021-03-24 02:11:17 +02:00
|
|
|
pkgrel=1
|
|
|
|
epoch=1
|
|
|
|
pkgdesc="A fast and open-source chat server"
|
|
|
|
arch=('any')
|
|
|
|
url="https://git.hippoz.xyz/hippoz/brainlet"
|
|
|
|
license=('GPL')
|
|
|
|
depends=('nodejs')
|
|
|
|
makedepends=('git' 'npm')
|
|
|
|
provides=('brainlet')
|
|
|
|
conflicts=('brainlet')
|
|
|
|
backup=('etc/brainlet/server.conf' 'etc/brainlet/secret.conf')
|
|
|
|
source=("${_repository}::git+https://git.hippoz.xyz/hippoz/${_repository}.git"
|
|
|
|
"${_name}.patch")
|
|
|
|
sha256sums=('SKIP'
|
|
|
|
'c8aad6d8a36c41d3fa1ae6185b3d218fbbaad3c603c326c696138727d5f9ebde')
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
cd "${srcdir}/${_repository}"
|
|
|
|
git rev-list --count HEAD
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "${srcdir}/${_repository}"
|
|
|
|
patch -p1 -i "${srcdir}/${_name}.patch"
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd "${srcdir}/${_repository}/${_name}"
|
|
|
|
|
|
|
|
mkdir -p "${pkgdir}/usr/bin"
|
|
|
|
mkdir -p "${pkgdir}/etc/brainlet"
|
|
|
|
|
|
|
|
npm install -g --prefix "${pkgdir}/usr" --cache "${srcdir}/npm-cache"
|
|
|
|
rm "${pkgdir}/usr/lib/node_modules/${_name}"
|
|
|
|
cp -r "${srcdir}/${_repository}/${_name}" "${pkgdir}/usr/lib/node_modules/${_name}"
|
2021-03-27 15:47:37 +02:00
|
|
|
pushd "${pkgdir}/usr/lib/node_modules/${_name}/"
|
|
|
|
npm install
|
|
|
|
popd
|
2021-03-24 02:11:17 +02:00
|
|
|
|
|
|
|
chmod -R 755 "${pkgdir}"
|
|
|
|
|
|
|
|
ln -s "../lib/node_modules/${_name}/index.js" "${pkgdir}/usr/bin/brainlet"
|
|
|
|
ln -s "../../usr/lib/node_modules/${_name}/config.js" "${pkgdir}/etc/brainlet/server.conf"
|
|
|
|
ln -s "../../usr/lib/node_modules/${_name}/secret.js" "${pkgdir}/etc/brainlet/secret.conf"
|
|
|
|
|
|
|
|
install -Dm644 "../LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
|
|
}
|