Compare commits

...

4 commits

Author SHA1 Message Date
leafee98 f9f41b33bd update makedeb, update .gitignore
All checks were successful
ci/woodpecker/push/build_bin Pipeline was successful
ci/woodpecker/push/build_other Pipeline was successful
2023-06-30 22:09:47 +08:00
leafee98 877f75aebe neovim-bin now install to /usr other than /usr/local 2023-06-30 22:07:33 +08:00
leafee98 8b40e3764b update dendrite 2023-06-30 22:06:04 +08:00
leafee98 c1b9fb3617 add package plik-bin 2023-06-30 22:02:31 +08:00
7 changed files with 57 additions and 141 deletions

11
.gitignore vendored
View file

@ -1,12 +1 @@
/**/*.tar
/**/*.gz
/**/*.xz
/**/*.zstd
/**/*.zip
/**/*.rar
/**/*.deb
/*/src
/*/pkg
/secrets.env

View file

@ -2,7 +2,7 @@
pkgname="dendrite"
pkgrel=1
pkgver="0.12.0"
pkgver="0.13.0"
pkgdesc="Dendrite is a second-generation Matrix homeserver written in Go!"
url="https://github.com/matrix-org/dendrite"
maintainer="Leafee98 <me@leafee98.com>"
@ -14,7 +14,7 @@ source=(
function build {
(
cd "${srcdir}/dendrite"
bash build.sh
go build -o bin/ ./cmd/...
)
}
@ -24,6 +24,5 @@ function package {
install -Dm755 -t "${pkgdir}/usr/local/lib/dendrite/" "$f";
done
# install -Dm755 --target-directory "${pkgdir}/usr/local/lib/dendrite/" ${srcdir}/dendrite/bin/*
# install -Dm644 "${srcdir}/dufs.service" "${pkgdir}/usr/lib/systemd/system/dufs.service"
install -Dm644 "${srcdir}/dendrite/dendrite-sample.yaml" "${pkgdir}/etc/dendrite/dendrite-sample.yaml"
}

View file

@ -1,122 +0,0 @@
#!/bin/bash
GIT_URL="https://github.com/matrix-org/dendrite.git"
SCRIPT_PATH=$(dirname $(realpath $0))
REPO_DIR="${SCRIPT_PATH}/repo"
PACK_DIR="${SCRIPT_PATH}/package"
BUILD_DIR="$REPO_DIR/bin"
ROOTFS="${SCRIPT_PATH}/rootfs"
TARGET_TAG=""
ACTION="initialze"
function err_occur {
echo "Error occurred in $ACTION"
}
trap err_occur ERR
set -o errexit
set -o errtrace
function usage()
{
echo "$0 usage:"
echo " -b the build release number"
echo " -t specify the tag to build, instead of the latest one"
}
BUILD_REL=""
while getopts ":b:t:" arg
do
case "$arg" in
b)
BUILD_REL="$OPTARG"
;;
t)
TARGET_TAG="$OPTARG"
;;
*)
usage
exit 1
;;
esac
done
function download()
{
ACTION="download"
echo "downloading/update sources..."
if [ ! -d "$REPO_DIR" ]
then
git clone "$GIT_URL" "$REPO_DIR"
else
git -C "$REPO_DIR" fetch --all
fi
}
function switch_tag()
{
ACTION="switch tag"
if [ -z "$TARGET_TAG" ]
then
TARGET_TAG=$(git -C "$REPO_DIR" tag --sort=-version:refname --list 'v*' | head -n 1)
fi
echo "switching to tag: $TARGET_TAG"
git -C "$REPO_DIR" switch --force-create build "$TARGET_TAG"
echo "cleaning workspace..."
git -C "$REPO_DIR" clean --force -xd
}
function build()
{
ACTION="build"
echo "building the program..."
cd "$REPO_DIR"
bash build.sh
}
function package()
{
ACTION="package"
echo "packaging the binaries..."
rm -rf "$ROOTFS"/*
install -D -t $ROOTFS/usr/local/lib/dendrite $BUILD_DIR/*
install -D -t $ROOTFS/etc/dendrite $REPO_DIR/dendrite-sample.yaml
export VERSION=$($BUILD_DIR/dendrite --version)
if [ -n "${BUILD_REL}" ]
then
VERSION=$VERSION-brel$BUILD_REL
fi
mkdir -p $ROOTFS/DEBIAN
sed "s/+++VERSION+++/${VERSION}/" > $ROOTFS/DEBIAN/control << EOF
Package: dendrite
Version: +++VERSION+++
Priority: optional
Architecture: all
Maintainer: leafee98 <me@leafee98.com>
Description: Dendrite is a second-generation Matrix homeserver written in Go!
Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an efficient, reliable and scalable alternative to Synapse.
EOF
mkdir -p "$PACK_DIR"
dpkg-deb --build --root-owner-group $ROOTFS $PACK_DIR/dendrite-$VERSION.deb
}
download
switch_tag
build
package

@ -1 +1 @@
Subproject commit adc58ff421d9ac73e36940d9df455d9bfadbd344
Subproject commit 342d77c9879c0ab0e001f43f94a0937c0aaff5bb

View file

@ -14,7 +14,7 @@ source=(
function package {
mkdir -p "${pkgdir}/usr/local"
mv "${srcdir}/nvim-linux64/bin" "${pkgdir}/usr/local/bin"
mv "${srcdir}/nvim-linux64/lib" "${pkgdir}/usr/local/lib"
mv "${srcdir}/nvim-linux64/share" "${pkgdir}/usr/local/share"
mv "${srcdir}/nvim-linux64/bin" "${pkgdir}/usr/bin"
mv "${srcdir}/nvim-linux64/lib" "${pkgdir}/usr/lib"
mv "${srcdir}/nvim-linux64/share" "${pkgdir}/usr/share"
}

34
plik-bin/DEBBUILD Normal file
View file

@ -0,0 +1,34 @@
#/usr/bin/env bash
pkgname="plik-bin"
pkgrel=2
pkgver="1.3.7"
pkgdesc="Plik is a temporary file upload system (Wetransfer like) in Go."
_arch="amd64"
url="https://github.com/root-gg/plik/"
maintainer="Leafee98 <me@leafee98.com>"
_pkgname_base="plik-${pkgver}-linux-${_arch}"
_pkgname="${_pkgname_base}.tar.gz"
source=(
"${_pkgname}::https://github.com/root-gg/plik/releases/download/1.3.7/${_pkgname}"
"plikd.service::materials/plikd.service"
)
function package {
install -Dm755 ${srcdir}/${_pkgname_base}/server/plikd ${pkgdir}/usr/bin/plikd
install -Dm644 ${srcdir}/${_pkgname_base}/server/plikd.cfg ${pkgdir}/etc/plik/plikd-sample.cfg
mkdir -p ${pkgdir}/usr/lib/plik
cp -r ${srcdir}/${_pkgname_base}/{changelog,clients,webapp} ${pkgdir}/usr/lib/plik
install -Dm755 ${srcdir}/plikd.service ${pkgdir}/usr/lib/systemd/system/plikd.service
}
function debian_postinst {
cat << EOF
#!/usr/bin/env bash
useradd --system plik
systemctl daemon-reload
EOF
}

View file

@ -0,0 +1,16 @@
[Unit]
Description=Plik is a temporary file upload system (Wetransfer like) in Go.
After=network.target apache2.service
[Service]
User=plik
# Start program here, plik needs webapp, clients and changelog to
# host changelog and provide download of clients
WorkingDirectory=/usr/lib/plik/
ExecStart=/usr/bin/plikd --config /etc/plik/plikd.cfg
Restart=on-failure
[Install]
WantedBy=multi-user.target