Actual initial commit

This commit is contained in:
speedie 2023-07-05 22:45:36 +02:00
parent 7c4585982e
commit 5ec5f0b5be
4 changed files with 84 additions and 0 deletions

39
Makefile Normal file
View file

@ -0,0 +1,39 @@
include options.mk
help:
@echo "${NAME} help"
@echo
@echo "make install Install ${NAME}."
@echo "make uninstall Uninstall ${NAME}."
@echo "make clean: Remove tarballs."
@echo "make dist Create distro package for ${NAME}."
@echo "make pkg_arch Create Arch package ${NAME}."
install: clean
cp ${NAME} ${PREFIX}${DESTDIR}/bin
chmod +x ${PREFIX}${DESTDIR}/bin/${NAME}
uninstall:
rm -rf ~/.config/${NAME}
rm -f ${PREFIX}${DESTDIR}/bin/${NAME}
clean:
rm -f *.tar* *zst* *${NAME}-${VER}.PKGBUILD
dist: clean
mkdir -p ${NAME}-${VER}
cp ${NAME} README.md LICENSE Makefile *.mk ${NAME}-${VER}
[ -f "PKGBUILD" ] && cp -f PKGBUILD ${NAME}-${VER} || :
tar -cf ${NAME}-${VER}.tar ${NAME}-${VER}
gzip ${NAME}-${VER}.tar
rm -rf ${NAME}-${VER}.tar ${NAME}-${VER}
gpg --detach-sign --yes --local-user $$(whoami) ${NAME}-${VER}.tar.gz || :
pkg_arch: dist
command -v makepkg > /dev/null || exit 1
[ -f PKGBUILD ] || exit 1
cp -f PKGBUILD PKGBUILD.orig
sed -i "s/VERSION/${VER}/g; s/MD5SUM/$$(md5sum *.tar.gz | cut -d ' ' -f 1)/g; s/NAME/${NAME}/g; s/DESC/${DESC}/g; s/URL/${URL}/g; s/LICENSE/${LICENSE}/g; s/DEPENDENCIES/${DEPENDENCIES}/g; s/GROUPS/${GROUPS}/g" PKGBUILD
makepkg -sfr --sign || exit 1
rm -rf src/ pkg/
cp PKGBUILD ${NAME}-${VER}.PKGBUILD; mv PKGBUILD.orig PKGBUILD

33
PKGBUILD Normal file
View file

@ -0,0 +1,33 @@
pkgname=NAME
pkgver=VERSION
pkgrel=1
epoch=
pkgdesc="DESC"
arch=(x86_64)
url="URL"
license=('LICENSE')
groups=(GROUPS)
depends=(
DEPENDENCIES
)
makedepends=()
checkdepends=()
optdepends=()
provides=(NAME)
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=""
source=("$pkgname-$pkgver.tar.gz")
noextract=()
md5sums=(MD5SUM)
validpgpkeys=()
package() {
cd "$pkgname-$pkgver"
install -Dm755 ${pkgname} "${pkgdir}"/usr/bin/${pkgname}
}

4
my-awesome-program Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# my-awesome-program
printf "%s:The makefile works perfectly.\n" "$0"

8
options.mk Normal file
View file

@ -0,0 +1,8 @@
NAME = my-awesome-program # Program name here. It will be added to the PKGBUILD automatically.
DESC = "My awesome description here" # Program description here. It will be added to the PKGBUILD automatically.
URL = "https://git.example.com/me/my-awesome-program" # URL to the program here. It will be added to the PKGBUILD automatically.
LICENSE = "GPL" # License of the program. It will be added to the PKGBUILD automatically.
VER = 0.1 # The version number here. It will be added to the PKGBUILD automatically.
DEPENDENCIES = "" # Dependencies for the program. It will be added to the PKGBUILD automatically.
GROUPS = "" # Groups the program is part of. It will be added to the PKGBUILD automatically.
PREFIX = "/usr" # Prefix