{"id":13509435,"url":"https://github.com/pacur/pacur","last_synced_at":"2025-03-30T13:32:10.737Z","repository":{"id":1087641,"uuid":"39353187","full_name":"pacur/pacur","owner":"pacur","description":"Automated deb, rpm and pkgbuild build system","archived":false,"fork":false,"pushed_at":"2025-02-23T00:40:56.000Z","size":742,"stargazers_count":232,"open_issues_count":1,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-23T01:27:14.894Z","etag":null,"topics":["build","build-automation","build-tools","packaging","pkgbuild"],"latest_commit_sha":null,"homepage":"https://medium.com/@zachhuff386/pacur-tutorial-9848b774c84a","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pacur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-19T23:45:03.000Z","updated_at":"2025-02-23T00:41:00.000Z","dependencies_parsed_at":"2023-10-14T22:05:31.530Z","dependency_job_id":"70dcd252-0342-4a0d-b68c-5c178147588b","html_url":"https://github.com/pacur/pacur","commit_stats":{"total_commits":707,"total_committers":9,"mean_commits":78.55555555555556,"dds":"0.021216407355021172","last_synced_commit":"36177261e7bd2f45e8af21b747ddd8d13ee7166c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacur%2Fpacur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacur%2Fpacur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacur%2Fpacur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacur%2Fpacur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pacur","download_url":"https://codeload.github.com/pacur/pacur/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246324020,"owners_count":20759063,"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":["build","build-automation","build-tools","packaging","pkgbuild"],"created_at":"2024-08-01T02:01:07.696Z","updated_at":"2025-03-30T13:32:10.725Z","avatar_url":"https://github.com/pacur.png","language":"Go","funding_links":[],"categories":["Go","others"],"sub_categories":[],"readme":"[![pacur](https://raw.githubusercontent.com/pacur/pacur-artwork/master/pacur.png)](http://pacur.org)\n\n# pacur: simple packaging\n\n![Arch Linux](https://img.shields.io/badge/podman-archlinux-1794d1.svg?style=flat \"Arch Linux\")\n\n\n![AlmaLinux 8](https://img.shields.io/badge/podman-almalinux--8-0f4266.svg?style=flat \"AlmaLinux 8\")\n![AlmaLinux 9](https://img.shields.io/badge/podman-almalinux--9-0f4266.svg?style=flat \"AlmaLinux 9\")\n\n\n![Amazon Linux 2](https://img.shields.io/badge/podman-amazonlinux--2-faaf34.svg?style=flat \"Amazon Linux 2\")\n![Amazon Linux 2023](https://img.shields.io/badge/podman-amazonlinux--2023-faaf34.svg?style=flat \"Amazon Linux 2023\")\n\n\n![Debian Buster](https://img.shields.io/badge/podman-debian--buster-d70a53.svg?style=flat \"Debian Buster\")\n![Debian Bullseye](https://img.shields.io/badge/podman-debian--bullseye-d70a53.svg?style=flat \"Debian Bullseye\")\n![Debian Bookworm](https://img.shields.io/badge/podman-debian--bookworm-d70a53.svg?style=flat \"Debian Bookworm\")\n\n\n![Oracle Linux 7](https://img.shields.io/badge/podman-oraclelinux--7-f82200.svg?style=flat \"Oracle Linux 7\")\n![Oracle Linux 8](https://img.shields.io/badge/podman-oraclelinux--8-f82200.svg?style=flat \"Oracle Linux 8\")\n![Oracle Linux 9](https://img.shields.io/badge/podman-oraclelinux--9-f82200.svg?style=flat \"Oracle Linux 9\")\n\n\n![RockyLinux 8](https://img.shields.io/badge/podman-rockylinux--8-10b981.svg?style=flat \"RockyLinux 8\")\n![RockyLinux 9](https://img.shields.io/badge/podman-rockylinux--9-10b981.svg?style=flat \"RockyLinux 9\")\n\n\n![Fedora 39](https://img.shields.io/badge/podman-fedora--39-294172.svg?style=flat \"Fedora 40\")\n![Fedora 40](https://img.shields.io/badge/podman-fedora--40-294172.svg?style=flat \"Fedora 40\")\n![Fedora 41](https://img.shields.io/badge/podman-fedora--41-294172.svg?style=flat \"Fedora 41\")\n\n\n![Ubuntu Bionic](https://img.shields.io/badge/podman-ubuntu--bionic-dd4814.svg?style=flat \"Ubuntu Bionic\")\n![Ubuntu Focal](https://img.shields.io/badge/podman-ubuntu--focal-dd4814.svg?style=flat \"Ubuntu Focal\")\n![Ubuntu Jammy](https://img.shields.io/badge/podman-ubuntu--jammy-dd4814.svg?style=flat \"Ubuntu Jammy\")\n![Ubuntu Noble](https://img.shields.io/badge/podman-ubuntu--noble-dd4814.svg?style=flat \"Ubuntu Noble\")\n![Ubuntu Oracular](https://img.shields.io/badge/podman-ubuntu--oracular-dd4814.svg?style=flat \"Ubuntu Oracular\")\n\nPacur allows building packages for multiple linux distributions with a\nconsistent package spec format. Currently `deb`, `rpm` and `pacman` packages\nare available for several linux distributions. Builds are done on podman\ncontainers without needing to setup any virtual machines or install any\nsoftware other than podman. All packages are built using a simple format that\nis similar to [PKGBUILD](https://wiki.archlinux.org/index.php/PKGBUILD) from\nArchLinux. Each distribution is different and will still require different\nbuild instructions, but a consistent build process and format can be used for\nall builds. podman only supports 64-bit containers, pacur can't be used to\nbuild 32-bit packages. Pacur will also create a `deb`, `rpm` and\n`pacman` signed repository that can be used on ArchLinux, CentOS, Fedora,\nDebian and Ubuntu to distribute the packages. A\n[tutorial](https://medium.com/@zachhuff386/pacur-tutorial-9848b774c84a)\non creating a project is available on medium.\n\n### initialize\n\nIt is recommended to build the podman images locally instead of pulling each\nimage from the podman Hub. Currently the podman Hub images are not\nmaintained. A script is located in the podman directory to assist with this.\nAlways run the `clean.sh` script to clear any existing pacur images. Building\nthe images can take several hours.\n\n```\ngo install github.com/pacur/pacur@latest\ncd \"$(ls -d ~/go/pkg/mod/github.com/pacur/pacur@*/podman/ | sort -V | tail -n 1)\"\nsh clean.sh\nsh build.sh\n```\n\n### format\n\n```\nkey=\"example string\"\nkey=`example \"quoted\" string`\nkey=(\"list with one element\")\nkey=(\n    \"list with\"\n    \"multiple elements\"\n)\nkey=\"example ${variable} string\"\nkey:ubuntu=\"this will apply only to ubuntu builds\"\n```\n\n### builtin variables\n\n| key         | value |\n|-------------| ----- |\n| `${srcdir}` | `Source` directory where all sources are downloaded and extracted |\n| `${pkgdir}` | `Package` directory for the root of the package |\n\n### spec\n\n| key          | type | value |\n|--------------| ---- | ----- |\n| `targets`    | `list` | List of build targets only used for projects. Prefix a `!` to ignore target. |\n| `pkgname`    | `string` | Package name |\n| `pkgver`     | `string` | Package version |\n| `pkgrel`     | `string` | Package release number |\n| `pkgdesc`    | `string` | Short package description |\n| `pkgdesclong` | `list` | List of lines for package description |\n| `maintainer` | `string` | Package maintainer |\n| `arch`       | `string` | Package architecture, can be `all` or `amd64` |\n| `license`    | `list` | List of licenses for packaged software |\n| `section`    | `string` | Section for package. Built in sections available:\u003cbr\u003e `admin`\u003cbr\u003e `localization`\u003cbr\u003e `mail`\u003cbr\u003e `comm`\u003cbr\u003e `math`\u003cbr\u003e `database`\u003cbr\u003e `misc`\u003cbr\u003e `debug`\u003cbr\u003e `net`\u003cbr\u003e `news`\u003cbr\u003e `devel`\u003cbr\u003e `doc`\u003cbr\u003e `editors`\u003cbr\u003e `electronics`\u003cbr\u003e `embedded`\u003cbr\u003e `fonts`\u003cbr\u003e `games`\u003cbr\u003e `science`\u003cbr\u003e `shells`\u003cbr\u003e `sound`\u003cbr\u003e `graphics`\u003cbr\u003e `text`\u003cbr\u003e `httpd`\u003cbr\u003e `vcs`\u003cbr\u003e `interpreters`\u003cbr\u003e `video`\u003cbr\u003e `web`\u003cbr\u003e `kernel`\u003cbr\u003e `x11`\u003cbr\u003e `libdevel`\u003cbr\u003e `libs` |\n| `priority`   | `string` | Package priority, only used for debian packages |\n| `url`        | `string` | Package url |\n| `rpmopts`    | `list` | List of lines to add to RPM spec |\n| `depends`    | `list` | List of package dependencies |\n| `optdepends` | `list` | List of package optional dependencies |\n| `makedepends` | `list` | List of package build dependencies |\n| `provides`   | `list` | List of packages provided |\n| `conflicts`  | `list` | List of packages conflicts |\n| `sources`    | `list` | List of packages sources. Sources can be url or paths that are relative to the PKGBUILD |\n| `hashsums`   | `list` | List of `md5`/`sha1`/`sha256`/`sha512` hex hashes for sources, hash type is determined by the length of the hash. Use `skip` to ignore hash check |\n| `backup`     | `list` | List of config files that shouldn't be overwritten on upgrades |\n| `build`      | `func` | Function to build the source, starts in srcdir |\n| `package`    | `func` | Function to package the source into the pkgdir, starts in srcdir |\n| `preinst`    | `func` | Function to run before installing |\n| `postinst`   | `func` | Function to run after installing |\n| `prerm`      | `func` | Function to run before removing |\n| `postrm`     | `func` | Function to run after removing |\n\n### build targets\n\n| target             | value                    |\n|--------------------|--------------------------|\n| `archlinux`        | All archlinux releases   |\n| `almalinux`        | All almalinux releases   |\n| `amazonlinux`      | All amazonlinux releases |\n| `debian`           | All debian releases      |\n| `fedora`           | All fedora releases      |\n| `oraclelinux`      | All oraclelinux releases |\n| `rockylinux`       | All rockylinux releases  |\n| `ubuntu`           | All ubuntu releases      |\n| `almalinux-8`      | AlmaLinux 8              |\n| `almalinux-9`      | AlmaLinux 9              |\n| `amazonlinux-2`    | Amazonlinux 2            |\n| `amazonlinux-2023` | Amazonlinux 2023         |\n| `debian-buster`    | Debian buster            |\n| `debian-bullseye`  | Debian bullseye          |\n| `debian-bookworm`  | Debian bookworm          |\n| `fedora-39`        | Fedora 39                |\n| `fedora-40`        | Fedora 40                |\n| `fedora-41`        | Fedora 41                |\n| `oraclelinux-7`    | Oraclelinux 7            |\n| `oraclelinux-8`    | Oraclelinux 8            |\n| `oraclelinux-9`    | Oraclelinux 9            |\n| `rockylinux-8`     | RockyLinux 8             |\n| `rockylinux-9`     | RockyLinux 9             |\n| `ubuntu-bionic`    | Ubuntu bionic            |\n| `ubuntu-focal`     | Ubuntu focal             |\n| `ubuntu-jammy`     | Ubuntu jammy             |\n| `ubuntu-noble`     | Ubuntu noble             |\n| `ubuntu-oracular`  | Ubuntu oracular          |\n\n### directives\n\n| directive          | value                    |\n|--------------------|--------------------------|\n| `apt`              | All deb packages         |\n| `pacman`           | All pkg packages         |\n| `yum`              | All rpm packages         |\n| `archlinux`        | All archlinux releases   |\n| `almalinux`        | All almalinux releases   |\n| `amazonlinux`      | All amazonlinux releases |\n| `debian`           | All debian releases      |\n| `fedora`           | All fedora releases      |\n| `oraclelinux`      | All oraclelinux releases |\n| `rockylinux`       | All rockylinux releases  |\n| `ubuntu`           | All ubuntu releases      |\n| `almalinux-8`      | AlmaLinux 8              |\n| `almalinux-9`      | AlmaLinux 9              |\n| `amazonlinux-2`    | Amazonlinux 2            |\n| `amazonlinux-2023` | Amazonlinux 2023         |\n| `debian-buster`    | Debian buster            |\n| `debian-bullseye`  | Debian bullseye          |\n| `debian-bookworm`  | Debian bookworm          |\n| `fedora-39`        | Fedora 39                |\n| `fedora-40`        | Fedora 40                |\n| `fedora-41`        | Fedora 41                |\n| `oraclelinux-7`    | Oraclelinux 7            |\n| `oraclelinux-8`    | Oraclelinux 8            |\n| `oraclelinux-9`    | Oraclelinux 9            |\n| `rockylinux-8`     | RockyLinux 8             |\n| `rockylinux-9`     | RockyLinux 9             |\n| `ubuntu-bionic`    | Ubuntu bionic            |\n| `ubuntu-focal`     | Ubuntu focal             |\n| `ubuntu-jammy`     | Ubuntu jammy             |\n| `ubuntu-noble`     | Ubuntu noble             |\n| `ubuntu-oracular`  | Ubuntu oracular          |\n\nDirectives are used to specify variables that only apply to a limited set of\nbuild targets. All variables can use directives including user defined\nvariables. To use directives include the directive after a\nvariable separated by a colon such as\n`pkgdesc:ubuntu=\"This description will only apply to Ubuntu packages\"`.\nThe directives above are sorted from lowest to the highest priority.\n\n### example\n\nFirst create a directory for the PKGBUILD file. This directory should only\ncontain the PKGBUILD file and any other files needed such as patches. Then\ncreate a PKGBUILD the package directory. After creating the PKGBUILD build\nthe package with podman.\n\n```\n$ mkdir httpserver\n$ cd httpserver\n$ nano PKGBUILD\n$ podman run --rm -t -v `pwd`:/pacur pacur/ubuntu-xenial\n```\n\n```\ntargets=(\n    \"archlinux\"\n    \"oraclelinux\"\n    \"debian\"\n    \"ubuntu\"\n)\npkgname=\"httpserver\"\npkgver=\"1.0\"\npkgrel=\"1\"\npkgdesc=\"Http file server written with Go\"\npkgdesc:oraclelinux=\"Http file server written with Go for Oracle Linux\"\npkgdesc:debian=\"Http file server written with Go for Debian\"\npkgdesc:fedora=\"Http file server written with Go for Fedora\"\npkgdesc:ubuntu=\"Http file server written with Go for Ubuntu\"\npkgdesclong=(\n    \"Quick http file server written with Go\"\n    \"using directory listing similar to apache\"\n)\nrpmopts=(\n    \"AutoReqProv: no\"\n)\nmaintainer=\"Example \u003cexample@pacur.org\u003e\"\narch=\"all\"\nlicense=(\"GPLv3\")\nsection=\"utils\"\npriority=\"optional\"\nurl=\"https://github.com/pacur/${pkgname}\"\nsources=(\n    \"${url}/archive/${pkgver}.tar.gz\"\n)\nhashsums=(\n    \"3548e1263a931b27970e190f04b74623\"\n)\n\nbuild() {\n    mkdir -p \"go/src\"\n    export GOPATH=\"${srcdir}/go\"\n    mv \"${pkgname}-${pkgver}\" \"go/src\"\n    cd \"go/src/${pkgname}-${pkgver}\"\n    go install\n    go build -a\n}\n\npackage() {\n    cd \"${srcdir}/go/src/${pkgname}-${pkgver}\"\n    mkdir -p \"${pkgdir}/usr/bin\"\n    cp ${pkgname}-${pkgver} ${pkgdir}/usr/bin/${pkgname}\n}\n```\n\n### project example\n\nA project can be created with the cli tools which can be installed using\n`go install`. The packages can be built and added to the repo. An example\nproject is available in the example directory. The container build script\nmust first be run to build the container images for all distributions.\nDirectories in the podman directory can be removed to exclude distributions\nthat are not needed.\n\n```\n$ go install github.com/pacur/pacur@latest\n$ cd \"$(ls -d ~/go/pkg/mod/github.com/pacur/pacur@*/podman/ | sort -V | tail -n 1)\"\n$ sh build.sh\n$ cd example\n$ pacur project init\n$ pacur project build\n$ pacur project repo\n$ go install github.com/pacur/httpserver@latest\n$ cd mirror\n$ httpserver --port 80\n```\n\nAfter the repo has been created and is hosted on a server the following\ncommands can be used to add the repo to the package manager for yum and apt.\nFor the debian repo the `bullseye` should be replaced with the debian/ubuntu\nrelease name. The `pacur` repo name and filenames can be change to suite the\nname of your software.\n\n```\n$ nano /etc/pacman.conf\n[pacur]\nServer = http://HTTP_SERVER_IP/arch\n\n$ pacman-key --keyserver hkp://pgp.mit.edu -r KEYID\n$ pacman-key --lsign-key KEYID\n$ pacman -Sy\n$ pacman -S httpserver\n```\n\n```\n$ nano /etc/yum.repos.d/pacur.repo\n[pacur]\nname=Pacur Repository\nbaseurl=http://HTTP_SERVER_IP/yum/oraclelinux/7/\ngpgcheck=1\nenabled=1\n\n$ gpg --keyserver hkp://pgp.mit.edu --recv-keys KEYID\n$ gpg --armor --export KEYID \u003e key.tmp; rpm --import key.tmp; rm -f key.tmp\n$ yum install httpserver\n```\n\n```\n$ nano /etc/apt/sources.list.d/pacur.list\ndeb http://HTTP_SERVER_IP/apt bullseye main\n\n$ apt-key adv --keyserver hkp://pgp.mit.edu --recv KEYID\n$ apt-get update\n$ apt-get install httpserver\n```\n\n### signing\n\nPackages in the repository can also be signed by adding a `sign.key` in the\nproject directory. The signing key cannot use a passphrase. To export a key\nfirst get the key id then export the key with the commands below.\n\n```\n$ gpg --list-secret-keys\n$ gpg -a --export-secret-keys KEYID \u003e sign.key\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacur%2Fpacur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacur%2Fpacur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacur%2Fpacur/lists"}