From cae4b73f19e2e56006690452beb01e4e263e33e6 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Mar 2023 03:09:04 +0100 Subject: [PATCH] Add packaging folder --- packaging/archlinux/dokytree-git/PKGBUILD | 41 +++++++++++++++++++++++ packaging/archlinux/dokytree/PKGBUILD | 41 +++++++++++++++++++++++ build.sh => packaging/windows/build.sh | 15 ++++++--- 3 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 packaging/archlinux/dokytree-git/PKGBUILD create mode 100644 packaging/archlinux/dokytree/PKGBUILD rename build.sh => packaging/windows/build.sh (69%) diff --git a/packaging/archlinux/dokytree-git/PKGBUILD b/packaging/archlinux/dokytree-git/PKGBUILD new file mode 100644 index 0000000..e938857 --- /dev/null +++ b/packaging/archlinux/dokytree-git/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: MatMoul + +_githubuser=matmoul +_githubrepo=dokytree +_gitcommit=56fa5970af2c659e730a850f923b6983a842f85c + +pkgname=dokytree-git +pkgver=0.0.0.r1.56fa597 +pkgrel=1 +pkgdesc='A versatil documentation system based on yaml files in directory tree with pugjs templates ' +arch=('any') +url="https://github.com/${_githubuser}/${_githubrepo}" +license=('GPL3') +depends=('nodejs') +optdepends=( + 'code: To edit doc' + 'chromium: To view and print as pdf doc' + 'wget: To export doc as static pages' + 'unzip: To build Windows ZIP' +) +makedepends=('git') +source=("git+https://github.com/${_githubuser}/${_githubrepo}.git#commit=${_gitcommit}") +sha256sums=('SKIP') + +prepare() { + cd "${_githubrepo}" + cat < dokytree +#!/bin/bash +node /usr/share/dokytree/app.js \${1} \${2} \${3} \${4} \${5} \${6} +EOF +} + +package() { + cd "${_githubrepo}" + install -D -m0644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE + install -d -m0755 ${pkgdir}/usr/share/dokytree + install -d -m0755 ${pkgdir}/usr/share/dokytree/samples + cp -R src/* ${pkgdir}/usr/share/dokytree + cp -R samples/* ${pkgdir}/usr/share/dokytree/samples + install -D -m0755 dokytree ${pkgdir}/usr/bin/dokytree +} diff --git a/packaging/archlinux/dokytree/PKGBUILD b/packaging/archlinux/dokytree/PKGBUILD new file mode 100644 index 0000000..6c3b8d2 --- /dev/null +++ b/packaging/archlinux/dokytree/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: MatMoul + +_githubuser=matmoul +_githubrepo=dokytree +_gitcommit=56fa5970af2c659e730a850f923b6983a842f85c + +pkgname=dokytree-git +pkgver=0.0.0 +pkgrel=1 +pkgdesc='A versatil documentation system based on yaml files in directory tree with pugjs templates ' +arch=('any') +url="https://github.com/${_githubuser}/${_githubrepo}" +license=('GPL3') +depends=('nodejs') +optdepends=( + 'code: To edit doc' + 'chromium: To view and print as pdf doc' + 'wget: To export doc as static pages' + 'unzip: To build Windows ZIP' +) +makedepends=('git') +source=("git+https://github.com/${_githubuser}/${_githubrepo}.git#commit=${_gitcommit}") +sha256sums=('SKIP') + +prepare() { + cd "${_githubrepo}" + cat < dokytree +#!/bin/bash +node /usr/share/dokytree/app.js \${1} \${2} \${3} \${4} \${5} \${6} +EOF +} + +package() { + cd "${_githubrepo}" + install -D -m0644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE + install -d -m0755 ${pkgdir}/usr/share/dokytree + install -d -m0755 ${pkgdir}/usr/share/dokytree/samples + cp -R src/* ${pkgdir}/usr/share/dokytree + cp -R samples/* ${pkgdir}/usr/share/dokytree/samples + install -D -m0755 dokytree ${pkgdir}/usr/bin/dokytree +} diff --git a/build.sh b/packaging/windows/build.sh similarity index 69% rename from build.sh rename to packaging/windows/build.sh index e61346e..8679991 100755 --- a/build.sh +++ b/packaging/windows/build.sh @@ -2,15 +2,20 @@ declare -r APPNAME=dokytree declare -r NODEVER=19.7.0 -declare TMPDIR="" +declare BASEDIR="" declare CURDIR="" +declare TMPDIR="" + +BASEDIR="$(pwd)"/$(dirname "${0}")/../.. +echo "${BASEDIR}" + +CURDIR+="$(pwd)" -CURDIR=$(pwd) TMPDIR=$(mktemp -d -u) mkdir -p "${TMPDIR}"/"${APPNAME}" -cp -R src/* "${TMPDIR}"/"${APPNAME}" -cp -R samples "${TMPDIR}"/"${APPNAME}" +cp -R "${BASEDIR}"/src/* "${TMPDIR}"/"${APPNAME}" +cp -R "${BASEDIR}"/samples "${TMPDIR}"/"${APPNAME}" cd "${TMPDIR}" || exit wget https://nodejs.org/dist/v${NODEVER}/node-v${NODEVER}-win-x64.zip @@ -18,6 +23,6 @@ unzip node-v${NODEVER}-win-x64.zip cp node-v${NODEVER}-win-x64/node.exe "${TMPDIR}"/"${APPNAME}" zip -r "${CURDIR}"/"${APPNAME}".zip "${APPNAME}" -cd "${CURDIR}" || cd || exit +cd "${CURDIR}" || cd || exit rm -rf "${TMPDIR}"