{"id":17968125,"url":"https://github.com/seletskiy/go-makepkg","last_synced_at":"2025-03-25T08:31:51.972Z","repository":{"id":24727667,"uuid":"28139845","full_name":"seletskiy/go-makepkg","owner":"seletskiy","description":"Generate PKGBUILD for Golang programs and run makepkg","archived":false,"fork":false,"pushed_at":"2021-01-17T16:06:20.000Z","size":33,"stargazers_count":63,"open_issues_count":1,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-25T03:35:54.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seletskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-17T14:07:56.000Z","updated_at":"2024-08-12T19:15:37.000Z","dependencies_parsed_at":"2022-08-22T22:20:46.864Z","dependency_job_id":null,"html_url":"https://github.com/seletskiy/go-makepkg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fgo-makepkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fgo-makepkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fgo-makepkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fgo-makepkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seletskiy","download_url":"https://codeload.github.com/seletskiy/go-makepkg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245426440,"owners_count":20613358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T14:20:15.940Z","updated_at":"2025-03-25T08:31:51.960Z","avatar_url":"https://github.com/seletskiy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-makepkg\n\nTool for fast packaging Golang programs under the archlinux.\n\nIt will automatically generate appropriate PKGBUILD and systemd.service files.\n\n## How to use\n\n0. `go get github.com/seletskiy/go-makepkg`;\n1. `mkdir some-directory`;\n2. `cd some-directory`;\n3. `mkdir -p etc/mycoolprog/`;\n4. Copy any other required files for you program, like config files:  \n   `cp \u003csomepath\u003e/example.conf etc/mycoolprog/main.conf`;\n5. Omit `-s` flag if you do not want service file:  \n   `go-makepkg -sB \"my description\" git://url-to-prog/repo.git **/*`;\n6. Package is ready for install and located at `build/\u003cblah\u003e.tar.xz`;\n\n## Typical invocation\n\n```\ngo-makepkg -gsB \"my cool package\" git://github.com/seletskiy/go-makepkg *\n```\n\nWill generate .gitignore, PKGBUILD and .service file for specified repo (e.g.\ngo-makepkg) and include all files under current directory to the package.\n\nIf you do not want to build package automatically, omit `-B` flag.\n\nSee `go-makepkg -h` for more info.\n\n`go-makepkg` by itself can be packaged using itself:  \n`go-makepkg -B \"go-makepkg tool\" git://github.com/seletskiy/go-makepkg.git`\n\n### Pass package version into golang code\n\nAs you know, you can change global variables of your Golang program in the\ncompile time by using `go build` options, like in the following example you can\nchange variable `packageVersion` using `ldflags`.\n\n```go\npackage main\n\nimport \"fmt\"\n\nvar blahme = \"autogenerated\"\n\nfunc main() {\n    fmt.Println(blahme)\n}\n```\n\nValue of the `blahme` can be changed:\n```\ngo build -ldflags=\"-X main.blahme=testvalue\" -o test .\n```\n\nRun `./test` and you will see `testvalue` instead of hardcoded `autogenerated`\nstring.\n\nIt's very useful opportunity, for escaping the hell of versioning your\nsoftware and shift this work to the PKGBUILD.\n\n`go-makepkg` can do it for you, all you need is to specify a variable name\nwhich holds version number using `-p \u003cvar\u003e` flag:\n\n```\ngo-makepkg -p version \"go-makepkg tool\" git://github.com/seletskiy/go-makepkg.git\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fgo-makepkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseletskiy%2Fgo-makepkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fgo-makepkg/lists"}