Add AdvMakefile and .gitm.toml

This commit is contained in:
Elara 2021-05-22 17:25:36 -07:00
parent 98dcb1532e
commit 47eeacf1a5
5 changed files with 50 additions and 3 deletions

4
.gitm.toml Normal file
View File

@ -0,0 +1,4 @@
[repos]
origin = "ssh://git@192.168.100.62:2222/Arsen6331/pak.git"
gitlab = "git@gitlab.com:moussaelianarsen/pak.git"
github = "git@github.com:Arsen6331/pak.git"

39
AdvMakefile Normal file
View File

@ -0,0 +1,39 @@
defaultName = "pak"
defaultTarget = "build"
availableManagers = [
"apk",
"apt",
"aptitude",
"brew",
"dnf",
"yum",
"npm",
"pacman",
"yay",
"pip",
"snap",
"zypper"
]
def pak_build():
if lookPath("go") == -1:
log("Go must be installed to compile pak", level="fatal")
execute("go build")
def pak_install():
mappings = {"PKGMANAGER": userChoice("Choose package manager", availableManagers)}
expandFile("pak.toml", mappings)
execute("""
install -Dm755 pak $DESTDIR/usr/bin/pak
install -Dm644 pak.toml $DESTDIR/etc/pak.toml
""")
def pak_install_noninteractive():
expandFile("pak.toml", {"PKGMANAGER": getEnv("PAK_CFG_MGR")})
execute("""
install -Dm755 pak $DESTDIR/usr/bin/pak
install -Dm644 pak.toml $DESTDIR/etc/pak.toml
""")

View File

@ -6,8 +6,8 @@ all: main.go
install: PAK_CFG_MGR ?= apt
install: pak.toml pak
install -Dm755 pak $(DESTDIR)/usr/bin/pak
sed 's/activeManager = ""/activeManager = "$(PAK_CFG_MGR)"/' pak.toml > pak-new.toml
install -Dm644 pak-new.toml $(DESTDIR)/etc/pak.toml
sed -i 's/activeManager = "\$PKGMANAGER"/activeManager = "$(PAK_CFG_MGR)"/' pak.toml
install -Dm644 pak.toml $(DESTDIR)/etc/pak.toml
installbinonly: pak
install -Dm755 pak $(DESTDIR)/usr/bin/pak

4
go.sum
View File

@ -1,3 +1,5 @@
gitea.arsenm.dev/Arsen6331/go-tuntox v0.0.0-20210122202525-119d5f454187 h1:5zN850TL+/3lHdUEGbQ29C4KPFwDLodWSaKjLFiWeJk=
gitea.arsenm.dev/Arsen6331/go-tuntox v0.0.0-20210122202525-119d5f454187/go.mod h1:88Isb/DdiGw2c82x+cjOOmqyka6Om0DbMRlshjEBG1s=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -12,6 +14,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

View File

@ -1,4 +1,4 @@
activeManager = ""
activeManager = "$PKGMANAGER"
rootCommand = "sudo"
[managers]