debmaker/ressources/gitea/debmaker

52 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-03-04 21:47:14 +01:00
#!/bin/bash
2022-03-14 23:57:03 +01:00
VERSION=1.16.4
RELEASE=1
2022-03-04 21:47:14 +01:00
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=gitea
DEPOT=https://github.com/go-gitea/gitea.git
GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-${RELEASE}
DEBIAN_VERSION_CODENAME=bullseye
2022-03-15 00:09:15 +01:00
IMAGE_SIZE=5
2022-03-04 21:47:14 +01:00
STEP="envinit prebuild build makedeb"
envinit() {
if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ];
then
apt-get update
apt-get dist-upgrade -y
else
2022-03-15 00:09:15 +01:00
apt install -y --no-install-recommends git wget ca-certificates dpkg fakeroot build-essential
2022-03-04 21:47:14 +01:00
wget -qO - https://deb.nodesource.com/setup_16.x | bash
apt-get update
apt-get install -y nodejs
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz
fi
}
prebuild(){
[ -e /tmp/git ] && rm -fr /tmp/git
2022-03-04 23:16:27 +01:00
[ -e /tmp/${APP} ] || mkdir /tmp/${APP}
2022-03-04 21:47:14 +01:00
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git
cp -r /tmp/git/. /tmp/${APP}
}
build() {
cd /tmp/${APP}/
PATH=$PATH:/usr/local/go/bin
2022-03-04 22:59:45 +01:00
TAGS="bindata sqlite sqlite_unlock_notify" make build
2022-03-04 21:47:14 +01:00
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp /tmp/${APP}/gitea ${PATH_DEB}/usr/bin/
cp /tmp/${APP}/custom/conf/app.example.ini ${PATH_DEB}/etc/gitea/app.ini
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}