GithubHelp home page GithubHelp logo

aji-prod / tomato Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 260 KB

A contained AUR (ArchLinux User Respository) packages and local repository builder.

License: GNU General Public License v3.0

Makefile 4.78% Shell 81.95% Dockerfile 13.27%
tomato aur-packages pacman aur-helper arch-linux gplv3

tomato's Introduction

tomato

A contained AUR (ArchLinux User Respository) packages and local repository builder.

Overview

tomato builds a selection of AUR packages with pikaur in a Docker image, and publishes them through repose to a local pacman repository named tomato.

As such tomato is not a pacman wrapper, it is more an indirect AUR helper. It let the host system clean of build's dependencies, like base-devel.

The selection of AUR packages can be installed with a common pacman usage on the host.

usage: tomato [<options>] <operation> [...]

operations:
  tomato add      <package(s)>  # add a package to the maintained list;
  tomato del      <package(s)>  # remove a package from the maintained list;
  tomato refresh [<package(s)>] # update tomato repository;
  tomato sweep                  # rebuild tomato repository,
                                # will remove non building or non existing 
                                # packages;
  tomato list    [all|status|split]
                                # list maintained packages;
  tomato search   <package(s)>  # search an AUR package;
  tomato version [number]       # show version 0.8.3;
  tomato (usage|help)           # this help message.

  tomato -Syu                   # or any other short variant (-Syuu, -Suy,
                                # ...), will update the tomato repository,
                                # and the host system.

options:
  tomato --rebuild-image        # build or rebuild the tomato Docker image;
  tomato --default-mirrors      # use the default mirrors of the base Docker
                                # image, when building or rebuilding the
                                # tomato Docker image;
  tomato --remove-image         # remove the tomato Docker image;
  tomato --tomato-config <path> # path to custom tomato config;
  tomato --edit                 # prompt to edit PKGBUILDs or build files;
  tomato --remote-update        # update tomato from the remote pre-built
                                # package.

  Tomato v0.8.3

Installation

Install tomato

tomato provides a prebuilt package with no other dependencies than pacman and can be installed with a pacman install command:

curl -L https://github.com/aji-prod/tomato/releases/download/v0.8.3/tomato-0.8.3-1-any.pkg.tar.zst > tomato-0.8.3-1-any.pkg.tar.zst
pacman -U ./tomato-0.8.3-1-any.pkg.tar.zst

The AUR package can be installed with makepkg or any other AUR helper.

From sources

git clone --branch v0.8.3 --depth 1 https://github.com/aji-prod/tomato/ tomato  
cd tomato  
make pkg  
pacman -U pkg/tomato-0.8.3-1-any.pkg.tar.zst

To install the AUR packages maintained by tomato the local pacman repository must be active for the host. Add the following section to pacman.conf:

[tomato]
SigLevel = Optional TrustAll
Server = file:///var/pkg/tomato

Enable the docker service

As tomato runs inside a docker image it is recommended to activate the docker service first.

systemctl enable docker  
systemctl start docker

Enable tomato auto-update

As an AUR package, tomato can update itself[^](Update the tomato repository with the latest AUR packages versions), by first registering[^](Include an AUR package to the tomato repository) it:

tomato add tomato

Search for an AUR package to include in the tomato repository

tomato search packagedesc

Include an AUR package to the tomato repository

tomato add packagename

It can be then installed on the host with the pacman install command:

pacman -S packagename

Remove an AUR package from the tomato repository

tomato del packagename

If the package is installed on the host, it can be removed with the pacman uninstall command:

pacman -Rs packagename

Update the tomato repository with the latest AUR packages versions

tomato refresh

The host can be updated with pacman update command:

pacman -Syu

Update the tomato repository then the host in one shot

tomato provides a shortcut to update the host right after refreshing the tomato repository:

tomato -Syu

Which is an alias to:

pacman -Syu && tomato refresh && pacman -Syu

Note that any variation of the flag -Syu flag will refresh the tomato repository and be passed to the pacman command, such as:

tomato -Suuy

will be an alias to:

pacman -Suuy && tomato refresh && pacman -Suuy

Rebuild all the packages and remove leftover dependencies

Some package dependencies may resides over time within the tomato repository, like after a tomato del command.

To removed unused dependencies from the tomato repository:

tomato sweep

Note that every packages will be rebuilt, packages that can no longer be built will be marked as waiting for an update, and will no more be available from the tomato repository until fixed.

List tomato repository packages

To list the packages explicitly included to the tomato repository:

tomato list

To list all packages and versions available from the tomato repository:

tomato list all

To list all packages available from the tomato repository with theirs AUR status:

tomato list status

To list the split packages, or to list the packages explicitly included but not found from the tomato repository:

tomato list split

Configuration

tomato provides some defaults to tell how to bind the Docker volumes with the host, and can be overridden with a key=value configuration file using:

  • The tomato --tomato-config=tomato.conf flag,
  • Editing the /etc/tomato.conf file,
  • Or setting a local user configuration at ~/.config/tomato.conf.

The default settings are defined as:

TOMATO_NAME=tomato                        # The tomato's docker image
TOMATO_IMGDIR=/usr/share/tomato           # The tomato's docker files
TOMATO_PKGDIR=/var/pkg/tomato             # The tomato's repository directory
TOMATO_PACDIR=/etc/pacman.d/mirrorlist    # The host's mirrorlist
TOMATO_MAKEPKGCONF=                       # Let to use a specific makepkg.conf
TOMATO_PKGCACHEDIR=/var/cache/pacman/pkg  # The pacman's cache directory
TOMATO_EDITOR=extra/vim:/usr/bin/vim      # The tomato's editor
TOMATO_ULIMIT=nofile=1024:524288          # The docker's ulimit option

makepkg.conf

tomato provides a default makepkg.conf at /usr/share/tomato/makepkg.conf. All the packages built by tomato will be attributed to the Françoise 'Ed' Appledelhi <[email protected]> packager. The others options have the makepkg.conf defaults provided by ArchLinux.

To use another makepkg.conf override the TOMATO_MAKEPKGCONF= key.

$EDITOR and TOMATO_EDITOR=

tomato uses the environment variable $EDITOR as editor if no TOMATO_EDITOR= configuration was defined, or vim if neither is set.

To use another $EDITOR override the TOMATO_EDITOR= key.

TOMATO_ULIMIT

To prevent fakeroot to hang inside Docker a default ulimit, through the --ulimit option, is passed to the docker build and docker run commands.

To remove the --ulimit option, or to use another value, override the TOMATO_ULIMIT= key.

GPG Signatures

For now, neither the GPG signatures from the AUR packages nor to build a package are supported and ignored.

Systemd

tomato management can be helped with systemd and two systemd timers:

  • tomato-update-image.timer,
  • tomato-update-repository.timer.

tomato-update-image.timer

Calls tomato --rebuild-image[^](Docker Image) monthly to synchronize the tomato local Docker image against the official ArchLinux Docker image.

tomato-update-repository.timer

Calls tomato refresh[^](Update the tomato repository with the latest AUR packages versions) weekly to update the local tomato pacman repository.

tomato-update.conf

To pass arguments to the systemd timers you can edit the TOMATO_ARGS= key, located at /etc/conf.d/tomato-update.conf.
/etc/conf.d/tomato-update.conf needs first to be copied from /usr/share/tomato/tomato-update.conf.

Docker Image

tomato uses a local Docker image based against the official ArchLinux Docker image.

Before using the first time tomato, it is required to build the local Docker image with the --rebuild-image option, as tomato --rebuild-image [command].

The tomato's core resides in the script launched inside the Docker image, any tomato update will only be available after passing the --rebuild-image option. It is also recommended to pass this option each new month as the official ArchLinux Docker image is updated monthly.

Initializing the Docker Image

tomato --rebuild-image

The --rebuild-image option can be combined with any other flags or commands.

Using the Default Mirrors of the Docker Image

tomato --rebuild-image --default-mirrors

The --default-mirrors option avoids using the host's best first pacman mirror to use the default ArchLinux Docker image mirrors.

Pruning the Docker Image

tomato --remove-image

Will ask Docker do delete the Docker image, can be combined with any other flags and takes precedence over the --rebuild-image option.

Docker Volumes

tomato binds a few Docker volumes to share files between the host and the image.

Volume /var/pkg/tomato

The repository and the packages are stored in this volume, always mounted with read and write permissions.

host default: /etc/pkg/tomato

Volume /var/cache/pacman/pkg

To minimize the network access, the image shares the same pacman's cache with the host.

host default: /var/cache/pacman/pkg

Volume /home/tomato/mirrorlist

The mirrorlist used by the image is read from this volume, always mounted with a read only permission.

host default: /etc/pacman.d/mirrorlist.

Volume /home/tomato/makepkg.conf

A special volume which needs to points to a host file to be used, always mounted with a read only permission.

not mounted by default

Tomato's Name

The tomato name is a reference to a main character of the Cowboy Bebop series, Edward Wong Hau Pepelu Tivrusky IV.

Her best friend during her time [in an orphanage on Earth] was a boy named Tomato who was also passionate about computer science. She named her computer Tomato after him.^

Or you can try to repeat indefinitely and rapidly "automate AUR".

Licenses

As most of the used tools have a GPLv2, GPLv3 or a compatible license, tomato follows the same path.

DockerApache 2.0; pikaurGPLv3; reposeGPLv2; tomatoGPLv3.

tomato's People

Contributors

aji-prod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tomato's Issues

sudo asks for a password

tomato no more working, as the sudo command asks for a password (not known).

No modification was made in the docker image yet, this occurred after a system or pikaur update.

PKGBUILD editing

It would be nice if tomato would support editing PKGBUILD files.

Fail to auto update with --remote-update

When running the tomato --remote-update option, the execution fails with:

error: could not open file /tmp/tomato-8unzhnsj/tomato-0.8.1-2-any.pkg.tar.zst: Unrecognized archive format
error: '/tmp/tomato-8unzhnsj/tomato-0.8.1-2-any.pkg.tar.zst': cannot open package file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.