s3lph
37ef05964c
Some checks failed
/ ansible-semaphore (push) Has been cancelled
/ daliserver (push) Has been cancelled
/ forgejo (push) Has been cancelled
/ forgejo-runner (push) Has been cancelled
/ http-mqtt-bridge (push) Has been cancelled
/ keycloak-26 (push) Has been cancelled
/ linux-diversion-ath-regd-optional (push) Has been cancelled
/ lottieconverter (push) Successful in 50s
/ matterbridge (push) Has been cancelled
/ matrix-element-web (push) Has been cancelled
/ matrix-hydrogen (push) Has been cancelled
/ matrix.to (push) Has been cancelled
/ maubot (push) Has been cancelled
/ maubot-plugin-spaceapi (push) Has been cancelled
/ maubot-plugin-ultimaker (push) Has been cancelled
/ mautrix-signal (push) Has been cancelled
/ mautrix-telegram (push) Has been cancelled
/ mediawiki-extension-auth-remoteuser (push) Has been cancelled
/ mediawiki-extension-nativesvghandler (push) Has been cancelled
/ mediawiki-extension-openidconnect (push) Has been cancelled
/ mediawiki-extension-pluggableauth (push) Has been cancelled
/ mqtt2prometheus (push) Has been cancelled
/ prometheus-ipmi-exporter (push) Has been cancelled
/ prometheus-dnsbl-exporter (push) Has been cancelled
/ prometheus2influxdb (push) Has been cancelled
/ python3-mautrix (push) Has been cancelled
/ python3-telethon (push) Has been cancelled
/ repo.s3lph.me-apt-source (push) Has been cancelled
/ republik-feeder (push) Has been cancelled
/ ydotool (push) Failing after 11s
84 lines
3.2 KiB
Bash
Executable file
84 lines
3.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -exo pipefail
|
|
|
|
ROOT=$(pwd)
|
|
|
|
function fetch() {
|
|
git clone https://github.com/s3lph/ydotool "${SRCDIR}/ydotool"
|
|
git checkout feat-getpwnam
|
|
}
|
|
|
|
function prepare() {
|
|
apt install -y build-essential cmake pkg-config scdoc
|
|
cd "${SRCDIR}/ydotool"
|
|
export VERSION="$(git describe --tags | cut -d- -f1-2 | sed -re "s/-/~/g" -e "s/^v//g")-1"
|
|
export ISODATE="$(git log -1 --format="%aI")"
|
|
mkdir build
|
|
cd build
|
|
cmake ..
|
|
make
|
|
strip ydotool
|
|
strip ydotoold
|
|
}
|
|
|
|
function prepare_ydotool() {
|
|
mkdir -p \
|
|
"${PKGDIR_YDOTOOL}/DEBIAN" \
|
|
"${PKGDIR_YDOTOOL}/usr/bin" \
|
|
"${PKGDIR_YDOTOOL}/usr/share/man/man1" \
|
|
"${PKGDIR_YDOTOOL}/usr/share/doc/ydotool"
|
|
cp "${SRCDIR}/ydotool/build/ydotool" "${PKGDIR_YDOTOOL}/usr/bin/ydotool"
|
|
cp "${SRCDIR}/ydotool/build/manpage/ydotool.1" "${PKGDIR_YDOTOOL}/usr/share/man/man1/ydotool.1"
|
|
gzip -9n "${PKGDIR_YDOTOOL}/usr/share/man/man1/ydotool.1"
|
|
cp "${SRCDIR}/ydotool/LICENSE" "${PKGDIR_YDOTOOL}/usr/share/doc/ydotool/copyright"
|
|
cp "${ROOT}/ydotool.debian.control" "${PKGDIR_YDOTOOL}/DEBIAN/control"
|
|
sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR_YDOTOOL}/DEBIAN/control"
|
|
sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR_YDOTOOL}/DEBIAN/control"
|
|
find "${PKGDIR_YDOTOOL}" -exec touch -m -d "${ISODATE}" {} \;
|
|
}
|
|
|
|
function prepare_ydotoold() {
|
|
mkdir -p \
|
|
"${PKGDIR_YDOTOOLD}/DEBIAN" \
|
|
"${PKGDIR_YDOTOOLD}/etc/default" \
|
|
"${PKGDIR_YDOTOOLD}/usr/bin" \
|
|
"${PKGDIR_YDOTOOLD}/lib/systemd/system" \
|
|
"${PKGDIR_YDOTOOLD}/usr/share/man/man8" \
|
|
"${PKGDIR_YDOTOOLD}/usr/share/doc/ydotoold"
|
|
cp "${SRCDIR}/ydotool/build/ydotoold" "${PKGDIR_YDOTOOLD}/usr/bin/ydotoold"
|
|
cp "${SRCDIR}/ydotool/build/manpage/ydotoold.8" "${PKGDIR_YDOTOOLD}/usr/share/man/man8/ydotoold.8"
|
|
gzip -9n "${PKGDIR_YDOTOOLD}/usr/share/man/man8/ydotoold.8"
|
|
cp "${SRCDIR}/ydotool/LICENSE" "${PKGDIR_YDOTOOLD}/usr/share/doc/ydotoold/copyright"
|
|
cp "${ROOT}/ydotoold.debian.control" "${PKGDIR_YDOTOOLD}/DEBIAN/control"
|
|
cp "${ROOT}/debian.conffiles" "${PKGDIR_YDOTOOLD}/DEBIAN/conffiles"
|
|
cp "${ROOT}/debian.default" "${PKGDIR_YDOTOOLD}/etc/default/ydotoold"
|
|
cp "${ROOT}/debian.postinst" "${PKGDIR_YDOTOOLD}/DEBIAN/postinst"
|
|
cp "${ROOT}/debian.prerm" "${PKGDIR_YDOTOOLD}/DEBIAN/prerm"
|
|
cp "${ROOT}/debian.postrm" "${PKGDIR_YDOTOOLD}/DEBIAN/postrm"
|
|
cp "${ROOT}/ydotoold.service" "${PKGDIR_YDOTOOLD}/lib/systemd/system/ydotoold.service"
|
|
sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR_YDOTOOLD}/DEBIAN/control"
|
|
sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR_YDOTOOLD}/DEBIAN/control"
|
|
find "${PKGDIR_YDOTOOLD}" -exec touch -m -d "${ISODATE}" {} \;
|
|
}
|
|
|
|
function package() {
|
|
cd "${BUILDDIR}"
|
|
dpkg-deb --build "${PKGDIR_YDOTOOL}" "${BUILDDIR}"
|
|
dpkg-deb --build "${PKGDIR_YDOTOOLD}" "${BUILDDIR}"
|
|
}
|
|
|
|
function build() {
|
|
export BUILDDIR=${ROOT}/build
|
|
export SRCDIR=${BUILDDIR}/srcdir
|
|
export PKGDIR_YDOTOOL=${BUILDDIR}/pkgdir-ydotool
|
|
export PKGDIR_YDOTOOLD=${BUILDDIR}/pkgdir-ydotoold
|
|
mkdir -p ${SRCDIR} ${PKGDIR_YDOTOOL} ${PKGDIR_YDOTOOLD}
|
|
fetch
|
|
prepare
|
|
prepare_ydotool
|
|
prepare_ydotoold
|
|
package
|
|
}
|
|
|
|
build
|