debmaker/ressources/joplin/joplin
thomas 55beb0e2e3 Another refactor
merge joplin and joplin-server
2022-02-28 23:26:47 +01:00

64 lines
2.2 KiB
Bash
Executable file

#!/bin/bash
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=joplin
GIT_VERSION=v2.7.14
DEB_VERSION_DESKTOP=2.7.14-4
DEB_VERSION_SERVER=2.7.4-4
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=12
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git python wget ca-certificates rsync fakeroot dpkg
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 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
rm -fr packages/app-mobile
}
build() {
cd /tmp/joplin/
BUILD_SEQUENCIAL=1 yarn install
cd packages/app-desktop
npm run dist
}
makedeb(){
PATH_DEB=/tmp/src/rootfs-server/
cp -fr /tmp/joplin/packages/lib ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/turndown-plugin-gfm ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/turndown ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/htmlpack ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/fork-uslug ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/fork-sax ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/renderer ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/fork-htmlparser2 ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/tools ${PATH_DEB}/usr/share/joplin-server/
cp -fr /tmp/joplin/packages/server ${PATH_DEB}/usr/share/joplin-server/
sed -i "s/%VERSION%/$DEB_VERSION_SERVER/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
PATH_DEB=/tmp/src/rootfs-desktop/
cp /tmp/joplin/packages/app-desktop/dist/Joplin-*.AppImage ${PATH_DEB}/usr/share/joplin/Joplin.AppImage
sed -i "s/%VERSION%/$DEB_VERSION_DESKTOP/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}