56 lines
1.3 KiB
Text
56 lines
1.3 KiB
Text
|
#!/bin/bash
|
||
|
|
||
|
VERSION=1.15.1
|
||
|
APP=linkding
|
||
|
DEPOT=https://github.com/sissbruecker/linkding
|
||
|
GIT_VERSION=last
|
||
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
||
|
DEBIAN_VERSION_CODENAME=bookworm
|
||
|
IMAGE_SIZE=6
|
||
|
PACKAGE_DEPENDENCY="nodejs python-is-python3 python3-pip"
|
||
|
|
||
|
main(){
|
||
|
base_package_upgrade
|
||
|
envinit
|
||
|
get_git_source
|
||
|
build
|
||
|
makedeb
|
||
|
}
|
||
|
|
||
|
envinit() {
|
||
|
configure_depot_nodejs
|
||
|
install_package_dependency
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
cd /tmp/${APP}/
|
||
|
pip3 install -r requirements.txt
|
||
|
npm install
|
||
|
npm run build
|
||
|
python manage.py compilescss
|
||
|
python manage.py collectstatic --ignore=*.scss
|
||
|
}
|
||
|
|
||
|
makedeb(){
|
||
|
PATH_DEB=/tmp/src/rootfs
|
||
|
|
||
|
cd /tmp/${APP}/
|
||
|
|
||
|
mkdir -p ${PATH_DEB}/usr/share/linkding/
|
||
|
cp -pfr bookmarks siteroot assets static node_modules manage.py requirements.prod.txt requirements.txt ${PATH_DEB}/usr/share/linkding/
|
||
|
|
||
|
mkdir -p ${PATH_DEB}/etc/default
|
||
|
cp -p .env.sample ${PATH_DEB}/etc/default/linkding
|
||
|
|
||
|
mkdir -p ${PATH_DEB}/var/lib/linkding/data
|
||
|
ln -s /var/lib/linkding/data ${PATH_DEB}/usr/share/linkding/data
|
||
|
|
||
|
cp version.txt ${PATH_DEB}/var/lib/linkding/
|
||
|
|
||
|
mkdir -p ${PATH_DEB}/usr/lib/systemd/system/
|
||
|
cp -p /tmp/src//linkding.service ${PATH_DEB}/usr/lib/systemd/system/
|
||
|
|
||
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
||
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
||
|
}
|