1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
6 pkgdesc="Platform to write and share markdown"
8 url='https://github.com/hedgedoc/hedgedoc'
10 depends=('nodejs-lts-hydrogen')
11 makedepends=('nodejs-lts-hydrogen' 'sqlite' 'python' 'node-gyp' 'git' 'yarn' 'npm')
12 optdepends=('postgresql: postgresql database support'
13 'mariadb: mariadb database support'
14 'sqlite: sqlite database support')
15 backup=("etc/webapps/${pkgname}"/config.json)
16 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/hedgedoc/${pkgname}/archive/${pkgver}.tar.gz"
21 sha256sums=('a48b697228077711c869dc4cd7dc42ff20c3d8545c824079b3c9b6bcf1d77b2e'
22 '44806410925bb13fddfc08bfeac94320285f3847e18a49552816eb823bec888a'
23 'afe54a4a656aa5237962fe4efa3cd47dd90c8ce821aa259bfa978384c26ba53a'
24 'd51bb443c52f759260d61e055a201398cfe1e2296208f20e3d8601a6c01aa3a4')
27 cd "${pkgname}-${pkgver}"
28 sed -i 's/16.x/18.x/g' package.json
29 export NODE_OPTIONS=--openssl-legacy-provider
33 cd "${pkgname}-${pkgver}"
34 # Build steps from Dockerfile
35 yarn install --production=false
39 yarn install --production=true
43 cd "${pkgname}-${pkgver}"
45 # removing unneeded files and directories
46 find node_modules -type f \
48 -iname '*Makefile*' -o \
51 -iname '*Makefile*' -o \
52 -iname '*appveyor.yml' -o \
53 -iname '*.babelrc' -o \
55 -iname '*bower.json' -o \
60 -iname '*.markdown' -o \
63 -iname '*.npmignore' -o \
64 -iname '*.editorconfig' -o \
66 -iname '*.eslintignore' -o \
67 -iname '*.eslintrc*' -o \
68 -iname '*.fimbullinter.yaml' -o \
69 -iname '*.gitattributes' -o \
70 -iname '*.gitmodules' -o \
73 -iname '*.jshintrc' -o \
74 -iname '*.jscs.json' -o \
76 -iname '*logo.svg' -o \
79 -iname '*package-lock.json' -o \
80 -iname '*.travis.yml' -o \
81 -iname '*.prettierrc' -o \
84 -iname '*.Dockerfile*' -o \
85 -iname '*.tm_properties' -o \
86 -iname '*.wotanrc.yaml' -o \
87 -iname '*tsconfig.json' -o \
92 find node_modules -type d \
94 -iwholename '*.github' -o \
95 -iwholename '*.tscache' -o \
96 -iwholename '*/man' -o \
97 -iwholename '*/test' -o \
98 -iwholename '*/scripts' -o \
99 -iwholename '*/git-hooks' -o \
100 -iwholename '*/linux-arm64' -o \
101 -iwholename '*/linux-armvy' -o \
102 -iwholename '*/linux-armv7' -o \
103 -iwholename '*/win32-ia32' -o \
104 -iwholename '*/win32-x64' -o \
105 -iwholename '*/darwin-x64' \
109 install -m0755 -d "${pkgdir}/usr/share/webapps/${pkgname}"
111 # install application parts
112 cp -a bin public lib locales node_modules "${pkgdir}/usr/share/webapps/${pkgname}"
113 install -m0644 app.js -t "${pkgdir}/usr/share/webapps/${pkgname}"
114 install -m0644 package.json -t "${pkgdir}/usr/share/webapps/${pkgname}"
116 # Make public/uploads a symlink to the hedgedoc writable directory.
117 # An alternative would be to configure the uploadsPath in config.json.
118 rm "${pkgdir}/usr/share/webapps/${pkgname}/public/uploads/.gitkeep"
119 rm -d "${pkgdir}/usr/share/webapps/${pkgname}/public/uploads"
120 ln -s "/var/lib/${pkgname}/uploads" \
121 "${pkgdir}/usr/share/webapps/${pkgname}/public/uploads"
124 # Setup config files in /etc.
125 install -m0755 -d "${pkgdir}/etc/webapps/${pkgname}"
126 cp config.json.example "${pkgdir}/etc/webapps/${pkgname}/config.json"
128 ln -s "/etc/webapps/${pkgname}"/config.json "${pkgdir}/usr/share/webapps/${pkgname}/config.json"
130 # Configure hedgedoc user and some directories writable for that user.
131 install -Dm0644 ${srcdir}/sysusers.conf "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
132 install -Dm0644 ${srcdir}/tmpfiles.conf "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
134 # Install systemd service file.
135 install -Dm0644 -t "${pkgdir}/usr/lib/systemd/system/" "${srcdir}"/hedgedoc.service