debmaker/ressources/rss-bridge/debmaker

43 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=rss-bridge
VERSION=2022-01-20
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-3
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=1
STEP="envinit prebuild makedeb"
envinit() {
apt install -y --no-install-recommends git fakeroot dpkg
}
prebuild(){
GIT_VERSION=$1
git clone --depth 1 -b ${GIT_VERSION} https://github.com/RSS-Bridge/rss-bridge.git /tmp/rss-bridge
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
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/rss-bridge/config.ini.php ${PATH_DEB}/usr/share/rss-bridge/config.ini.php
ln -s /etc/rss-bridge/whitelist.txt ${PATH_DEB}/usr/share/rss-bridge/whitelist.txt
mkdir -p ${PATH_DEB}/var/cache/rss-bridge/cache/
rm ${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
}