/arpm

A bunch of scripts to build packages for Arch Linux.

Primary LanguagePython

What?

A bunch of scripts to build packages for Arch Linux. Plus a server and CLI tool for sharing and deploying packages.

Why?

When you are running more than one server under Arch Linux you may need a shared repository with some custom packages. And this is it!

Features

  • Repeatable build in a clean container environment;
  • Build from a directory, from a tarball, fetching an URL (from AUR for instance);
  • The remote server keeps the packages database steady and solid;
  • A CLI tool which allows to run these actions on a remote server:
    • List all branches;
    • Create new branch;
    • List packages in a branch;
    • Download a package;
    • Upload packages with replacing the old ones;
    • Remove packages (branch removal is not implemented for the safety reasons);
    • Update the server (for debug and development purposes);

WARNING! The server does not support any authorization!

Requirements

For build packages:

  • /etc/makepkg.conf (copies into container);
  • /etc/pacman.conf (copies into container);
  • podman
  • sudo
  • aria2c or wget or curl

For the deploy server and CLI tool:

  • python-aiohttp
  • python-pyzstd
  • python-requests
  • python-systemd

Server setup

  1. Create an unprivileged user, arpm for instance.

  2. Create a config ~/.config/arpm.conf:

     [server]
     host=0.0.0.0
     port=32475
    

    Where host and port - address and port to listen on;

  3. Create a systemd unit:

    [Unit]
    Description=ArchLinux repository and packages server
    
    [Service]
    Type=notify
    User=arpm
    Group=arpm
    ExecStart=/usr/bin/arpm server -n /srv/archlinux/x86_64
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    

    Where /srv/archlinux/x86_64 - is the packages root directory.

  4. Run the server:

    systemctl enable --now arpm

CLI tool usage

  1. Create a config ~/.config/arpm.conf:

    [server]
    host=example.com
    port=32475
    

    Where example.com is the address of the server.

  2. Build a package:

    ./build.sh 'https://aur.archlinux.org/cgit/aur.git/snapshot/google-chrome.tar.gz'

  3. Create a new branch on server, custom for instance:

    ./arpm.py branch mk custom

  4. Upload package to the server:

    ./arpm.py pkg custom put out/*.pkg.tar.zstd

  5. Append the URL with a new branch to the /etc/pacman.conf:

    [custom]
    Server = http://example.com/archlinux/$arch/$repo
    

License

GPL.