debmaker/ressources/rss-bridge/debmaker

45 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
VERSION=2022-06-14
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=rss-bridge
DEPOT=https://github.com/RSS-Bridge/rss-bridge.git
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=1
STEP="envinit prebuild makedeb"
envinit() {
apt-get update
apt-get dist-upgrade -y
apt install -y --no-install-recommends git fakeroot dpkg git
}
prebuild(){
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/${APP}
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp -fr /tmp/rss-bridge ${PATH_DEB}/usr/share/
cp ${PATH_DEB}/usr/share/rss-bridge/config.default.ini.php ${PATH_DEB}/etc/rss-bridge/config.ini.php
cp ${PATH_DEB}/usr/share/rss-bridge/whitelist.default.txt ${PATH_DEB}/etc/rss-bridge/whitelist.txt
ln -s /etc/${APP}/config.ini.php ${PATH_DEB}/usr/share/rss-bridge/config.ini.php
ln -s /etc/${APP}/whitelist.txt ${PATH_DEB}/usr/share/rss-bridge/whitelist.txt
mkdir -p ${PATH_DEB}/var/cache/rss-bridge/cache/
rm -r ${PATH_DEB}/usr/share/rss-bridge/cache
ln -s /var/cache/rss-bridge/cache/ ${PATH_DEB}/usr/share/rss-bridge/cache
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}