thomas
6148b1fa75
upgrade version of adguardhome element-web mautrix-whatsapp use new debian packaging process for mautrix-whatsapp
68 lines
2.4 KiB
Bash
Executable file
68 lines
2.4 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
GIT_VERSION=v2.8.2
|
|
DEB_VERSION_DESKTOP=2.8.2-$(date +%Y%m%d%H%M)
|
|
DEB_VERSION_SERVER=2.7.4-$(date +%Y%m%d%H%M)
|
|
|
|
[ -e ./lib/function.sh ] && source ./lib/function.sh
|
|
|
|
APP=joplin
|
|
DEPOT=https://github.com/laurent22/joplin.git
|
|
DEBIAN_VERSION_CODENAME=bullseye
|
|
IMAGE_SIZE=12
|
|
|
|
STEP="envinit prebuild build makedeb"
|
|
|
|
envinit() {
|
|
apt-get update
|
|
if [ $(dpkg -l | grep -e 'ii build-essential ' | wc -l) -eq 1 ];
|
|
then
|
|
apt-get dist-upgrade -y
|
|
else
|
|
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
|
|
fi
|
|
}
|
|
|
|
prebuild(){
|
|
[ -e /tmp/git ] && rm -fr /tmp/git
|
|
[ -e /tmp/${APP} ] || mkdir /tmp/${APP}
|
|
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git
|
|
cp -r /tmp/git/. /tmp/${APP}
|
|
rm -fr /tmp/${APP}/packages/app-mobile
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/${APP}/
|
|
rm packages/app-desktop/dist/Joplin-*.AppImage
|
|
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
|
|
}
|