55 lines
1.8 KiB
Bash
Executable File
55 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
VERSION=1.2.7
|
|
RELEASE=1
|
|
|
|
APP=libretranslate
|
|
DEPOT=https://github.com/LibreTranslate/LibreTranslate.git
|
|
GIT_VERSION=v${VERSION}
|
|
DEB_VERSION=${VERSION}-${RELEASE}
|
|
DEBIAN_VERSION_CODENAME=sid
|
|
IMAGE_SIZE=6
|
|
|
|
STEP="envinit prebuild build makedeb"
|
|
STEP="envinit prebuild build"
|
|
|
|
envinit() {
|
|
apt install -y --no-install-recommends git python3-pip wget ca-certificates fakeroot pkg-config icu-devtools libicu-dev build-essential python3-dev
|
|
}
|
|
|
|
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 -fr /tmp/git/. /tmp/${APP}
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/${APP}
|
|
pip3 install -e .
|
|
}
|
|
|
|
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
|
|
|
|
}
|
|
|