debmaker/ressources/joplin-server/joplin-server
2022-02-24 00:02:53 +01:00

38 lines
1 KiB
Bash
Executable file

#!/bin/bash
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git python wget ca-certificates
wget -qO - https://deb.nodesource.com/setup_16.x | bash
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y yarn nodejs
}
prebuild(){
GIT_VERSION=$1
git clone --depth 1 -b ${GIT_VERSION} https://github.com/laurent22/joplin.git /tmp/joplin
cd /tmp/joplin
rm -fr packages/app*
rm -fr packages/generator-joplin
rm -fr packages/plugin-repo-cli
rm -fr packages/plugins
}
build() {
cd /tmp/joplin/
BUILD_SEQUENCIAL=1 yarn install
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
cp -fr /tmp/joplin/packages/* ${PATH_DEB}/usr/lib/joplin-server/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}