diff --git a/.gitignore b/.gitignore index 420cca7..5399a1f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /atch build/ release/ +*.deb +*.pkg.tar.* diff --git a/makefile b/makefile index eb43a61..509e21a 100644 --- a/makefile +++ b/makefile @@ -31,6 +31,14 @@ atch.1: atch.1.md man: atch.1 +PREFIX ?= /usr +MANDIR ?= $(PREFIX)/share/man + +.PHONY: install +install: atch + install -Dm755 $(BUILDDIR)/atch $(DESTDIR)$(PREFIX)/bin/atch + if [ -f atch.1 ]; then install -Dm644 atch.1 $(DESTDIR)$(MANDIR)/man1/atch.1; fi + clean: rm -f atch $(OBJ) *.1.md *.c~ diff --git a/pkg/arch/PKGBUILD b/pkg/arch/PKGBUILD new file mode 100644 index 0000000..f2867ba --- /dev/null +++ b/pkg/arch/PKGBUILD @@ -0,0 +1,22 @@ +pkgname=atch +pkgver=0.4 +pkgrel=1 +pkgdesc='Attach and detach terminal sessions — transparent, no terminal emulation' +arch=('x86_64' 'aarch64') +url='https://github.com/mobydeck/atch' +license=('GPL-2.0-only') +depends=('glibc') +makedepends=('gcc' 'pandoc') +source=("${url}/archive/${pkgver}.tar.gz") +sha256sums=('SKIP') + +build() { + cd "$pkgname-$pkgver" + make STATIC_FLAG= VERSION="$pkgver" + make man +} + +package() { + cd "$pkgname-$pkgver" + make install DESTDIR="$pkgdir" VERSION="$pkgver" +} diff --git a/pkg/deb/build-deb.sh b/pkg/deb/build-deb.sh new file mode 100755 index 0000000..cdbcf82 --- /dev/null +++ b/pkg/deb/build-deb.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +VERSION="${1:?usage: build-deb.sh VERSION}" +ARCH=$(dpkg --print-architecture) +PKGDIR="$(mktemp -d)" +trap 'rm -rf "$PKGDIR"' EXIT + +SRCDIR="$(cd "$(dirname "$0")/../.." && pwd)" + +make -C "$SRCDIR" clean +make -C "$SRCDIR" VERSION="$VERSION" STATIC_FLAG= +make -C "$SRCDIR" man +make -C "$SRCDIR" install DESTDIR="$PKGDIR" VERSION="$VERSION" + +mkdir -p "$PKGDIR/DEBIAN" +cat > "$PKGDIR/DEBIAN/control" < +Homepage: https://github.com/mobydeck/atch +Description: Attach and detach terminal sessions + Transparent terminal session manager with persistent + session history and multi-client attach support. +EOF + +dpkg-deb --build "$PKGDIR" "${SRCDIR}/atch_${VERSION}_${ARCH}.deb" +echo "Built: atch_${VERSION}_${ARCH}.deb" diff --git a/pkg/gentoo/app-misc/atch/atch-9999.ebuild b/pkg/gentoo/app-misc/atch/atch-9999.ebuild new file mode 100644 index 0000000..d537be7 --- /dev/null +++ b/pkg/gentoo/app-misc/atch/atch-9999.ebuild @@ -0,0 +1,32 @@ +# Copyright 2024-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Attach and detach terminal sessions — transparent, no terminal emulation" +HOMEPAGE="https://github.com/mobydeck/atch" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/mobydeck/atch.git" +else + SRC_URI="https://github.com/mobydeck/atch/archive/${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${P}" + KEYWORDS="~amd64 ~arm64" +fi + +LICENSE="GPL-2" +SLOT="0" + +DEPEND="sys-libs/glibc" +BDEPEND="app-text/pandoc" + +src_compile() { + emake STATIC_FLAG= VERSION="${PV}" + emake man +} + +src_install() { + emake install DESTDIR="${D}" VERSION="${PV}" + dodoc README.md +}