From f001c5aa18145f7cd54724e6315f1d150b68bfe5 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 14:27:18 +0700 Subject: [PATCH] added PKGBUILD --- .gitea/workflows/actions.yaml | 22 +++++++++++++++++++++- Makefile | 5 +++-- PKGBUILD | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 PKGBUILD diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index a0e4a98..ba72228 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -49,4 +49,24 @@ jobs: meson setup build && \ ninja -C build - name: Testing to run binary builded with meson - run: ./build/tte --version \ No newline at end of file + run: ./build/tte --version + + Archlinux-package: + runs-on: archlinux-aarch64 + steps: + - name: Download PKGBUILD file + run: | + mkdir workspace && \ + cd workspace && \ + curl \ + https://gitea.home.com:3000/TolaMironcenko/tte/raw/branch/main/PKGBUILD \ + -o PKGBUILD && \ + sed "s/arch=('x86_64')/arch=('aarch64')/" -i PKGBUILD + - name: Build package + run: cd workspace && makepkg -f + - name: Push package + run: | + cd workspace && \ + curl --user TolaMironcenko:d57cf51c49b425b42148e5a56882f8330bde011c \ + --upload-file ./tte-git-1.0-1-aarch64.pkg.tar.xz \ + https://gitea.home.com:3000/api/packages/TolaMironcenko/arch/home \ No newline at end of file diff --git a/Makefile b/Makefile index eb47d81..fff26bd 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +DESTDIR=/ + tte: tte.c $(CC) tte.c -o tte -std=c99 @@ -5,8 +7,7 @@ debug: tte.c $(CC) tte.c -o tte -Wall -Wextra -pedantic -std=c99 -g install: tte - sudo cp tte /usr/bin/ - sudo chmod +x /usr/bin/ + sudo cp tte $(DESTDIR)/usr/bin/ uninstall: sudo rm -v /usr/bin/tte diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..48948d2 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,24 @@ +# Maintainer: Tola Mironcenko +pkgname=tte-git +_pkgname="${pkgname%-git}" +_reponame=tte +pkgver=0.1.1 +pkgrel=1 +pkgdesc="Password generator" +arch=('x86_64') +url="https://gitea.home.com:3000/TolaMironcenko/tte" +conflicts=("$_pkgname") +license=('GPL') +source=("git+$url.git") +cksums=('SKIP') + +build() { + cd $_reponame + make +} + +package() { + cd $_reponame + mkdir -p $pkgdir/usr/bin + make DESTDIR="$pkgdir" install +}