• Stars
    star
    378
  • Rank 113,272 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 15 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool for managing rpm based git projects.

ABOUT

Tito is a tool for managing RPM based projects using git for their source code repository.

Tito offers the following features:

  • Tag new releases with incremented RPM version or release.
  • Auto-generate spec file changelog based on git history since last tag.
  • Create reliable tar.gz files with consistent checksums from any tag.
  • Build source and binary rpms off any tag.
  • Build source and binary "test" rpms off most recently committed code.
  • Build multiple source rpms with appropriate disttags for submission to the Koji build system
  • Build rpms via the "mock" tool.
  • On a per-branch basis in git:
    • Maintain concurrent version streams.
    • Vary the way packages are built/tagged.
  • Report on any diffs or commits messages missing since last tag.
  • Define release targets to publish your packages to yum repositories, or the Fedora build system.
  • Define custom builder/releaser implementations for your own project needs.
  • Build packages off an "upstream" git repository, where modifications in the "downstream" git repository will be applied as a patch in the source rpm.
  • Manage all of the above for a git repository with many disjoint packages within it.

STATUS

Copr build: badge

RELATED PROJECTS

INSTALL

From Fedora:

dnf install tito

From CentOS / RHEL:

# Enable EPEL https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F
yum install tito

From PyPI:

pip install tito

Pre-release versions for Fedora (built from git master branch):

dnf copr enable @rpm-software-management/tito
dnf install tito

From git's master branch:

  • First install Tito's dependencies for your architecture, i.e. x86_64:

    sudo dnf install --setopt=install_weak_deps=False \
        $(dnf repoquery --arch x86_64,noarch --requires tito --resolve -q)
    

    NOTE: This will install Tito's dependencies from Tito's latest release for your system. If the master branch requires a new dependency, it will need to be installed manually.

  • Then install Tito via so-called User install (i.e. isolated to the current user):

    pip install --user https://github.com/rpm-software-management/tito/archive/master.tar.gz
    

To make an rpm of tito to install elsewhere

sudo yum install python-devel asciidoc
tito build --rpm
# see what's in the package
rpm -ql -p /tmp/tito/noarch/tito-*.noarch.rpm

GETTING STARTED

From your git repository:

tito init

This will create a top-level metadata directory called ".tito/" and commit it to git. This directory will store tito's configuration and package metadata on a per branch basis. It will be filtered out when creating .tar.gz files.

TAGGING PACKAGES

Before doing most everything you'll need to tag your package(s).

Before doing this you'll need to ensure that your package spec files are at the top of the relative source tree for that package.

For the most common case, a single project git repository has the spec file and root of the project at the top level of the git repository:

docs/
mypackage.spec
README
.tito/
src/
test/

For a multi-project git repository, packages can be defined in various sub-directories, provided they do not nest (i.e. walking up the tree, two spec files will never be encountered):

.tito/
package1/
    docs/
    mypackage.spec
    README
    src/
    test/
subdir/
    package2/
        anotherpkg.spec
        docs/
        README
        src/
        test/

The packages can be organized in any hierarchy you like and even be moved around and re-tagged, we only need to have the spec file in the top level directory for that package.

Tagging packages is normally done with:

tito tag

This will:

  • bump the version or release in the spec file (use --keep-version to use whatever is defined in the spec file)
  • auto-generate a changelog from first line of each commit since last tag (use --no-auto-changelog if you do not want this)
  • open an editor allowing you a chance to edit that changelog
  • insert the changelog into your spec
  • commit these changes, and generate a git tag

By default if you omit --keep-version, tito will tag by bumping the rpm version. (i.e. we bump the Z in X.Y.Z. If you'd prefer to bump the package release instead (normally should just be used for changes to the spec file or patches applied within it), you can change the 'tagger' class in .tito/tito.props to ReleaseTagger. This will affect all packages in this git branch, if you'd prefer to do this on a per-package basis you can do so in a package specific tito.props. (see section below)

Once a package is tagged you will need to push both the auto-commit and the tag to your remote git repository before tito will let you build it. (better support for standalone git repositories is coming, for now --offline will help)

See "man tito" for more options.

BUILDING PACKAGES

To build the most recent .tar.gz for a package, cd into that packages directory and run:

tito build --tgz

Note that this tarball will have a consistent checksum every time.

Likewise the --srpm and --rpm options allow you to build both binary and source rpms.

Add in the --tag=TAG option to build any of the above for any past tag.

If you're working on something locally and would like to check that your package is still building ok without pushing your changes to the remote repository, add the --test option. This will build a test rpm from your most recently committed work. (NOTE: does not include uncommitted changes)

TODO: Document the use of --release, which is complicated and untested against Fedora's Koji.

See "man tito" for more options.

RELEASING PACKAGES

Tito supports a mechanism where you can define multiple release targets.

In .tito/releasers.conf, create a section like:

[yum-f15-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-15-x86_64
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito/fedora-15/x86_64/

You can define as many release targets as you like with various configurations. To publish the most recently tagged build in your current branch you would run:

tito release yum-f15-x86_64

You can specify multiple targets on the CLI.

See "man 8 releasers.conf" for more information on defining release targets.

See "man tito" for more information on CLI arguments to "tito release".

CUSTOM BUILDERS / TAGGERS / RELEASERS

If the existing implementations Tito provides are not sufficient for your needs, it is possible to define a lib_dir in tito.props buildconfig section. This is a directory that tito will add to the python path during execution, allowing you a place to define your own custom implementations of builders, taggers, and releasers.

The process of actually writing a custom Builder/Tagger/Releaser is an exercise left to the reader, but essentially you will want to work off the code in the tito.builder module. Inherit from the base Builder, and override the methods you need to.

Please note that if you store your custom implementations inside your source tree, they will need to be kept in sync in all branches you are using for consistent behavior. Also, there are no guarantees that tito will not change in future releases, meaning that your custom implementations may occasionally need to be updated.

TROUBLESHOOTING

If you create a tag accidentally or that you wish to re-do, make sure you have not git pushed the tag yet, the auto-commit is the most recent in your git history, and run:

git tag -d YOURNEWTAG
git reset --hard HEAD^1

If your project is standalone (no remote reference you communicate with as authoritative) you may wish to set offline = "true" in .tito/tito.props under the buildconfig section, so you do not need to specify --offline with each invocation.

CONFIGURATION

See:

man 5 tito.props

man 5 releasers.conf

man 5 titorc

COMMUNITY

If you need an advice or want to chat with Tito developers, join us on #tito channel at irc.freenode.net.

Projects managed with Tito

Here follows a list of projects managed with Tito. It is not trying to be a complete list of every project using tito but rather a few examples that potential users can check out.

If your project uses Tito, feel free to add it here.

EXTERNAL DOCS

How to create new release of RPM package in 5 seconds

How to build in Copr

Building RHEL packages with Tito

More Repositories

1

dnf

Package manager based on libdnf and libsolv. Replaces YUM.
Python
1,226
star
2

rpm

The RPM package manager
C
494
star
3

mock

Mock is a tool for a reproducible build of RPM packages.
Python
381
star
4

dnf5

Next-generation RPM package management system
C++
233
star
5

microdnf

Lightweight implementation of dnf in C
C
216
star
6

libdnf

Package management library.
C++
182
star
7

rpmlint

Tool for checking common errors in rpm packages
Python
128
star
8

yum

[DEPRECATED] YUM package manager
Python
125
star
9

dnf-plugins-core

Core DNF Plugins
Python
108
star
10

createrepo_c

C implementation of the createrepo.
C
96
star
11

hawkey

This is hawkey, library providing simplified C and Python API to libsolv. Hawkey project is obsoleted.
C
88
star
12

librepo

A library providing C and Python (libcURL like) API for downloading packages and linux repository metadata in rpm-md format
C
74
star
13

dnf-plugins-extras

repository for DNF community plugins
Python
65
star
14

modulemd-tools

Collection of tools for parsing and generating modulemd YAML files
Python
49
star
15

popt

C library for parsing command line parameters
C
49
star
16

yum-utils

[DEPRECATED] A collection of utilities, plugins and examples related to the YUM package manager
Python
34
star
17

librpm.rs

Rust bindings to the RPM Package Manager libraries (librpm, librpmbuild, librpmsign)
Rust
31
star
18

libcomps

Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3.
C
29
star
19

distribution-gpg-keys

Collection of GPG keys used in Linux Distributions
Python
28
star
20

spec-cleaner

spec-cleaner
Python
28
star
21

createrepo

Python
27
star
22

dnf-plugin-system-upgrade

A DNF plugin for system upgrades (moved to dnf-plugins-extras!)
Python
24
star
23

deltarpm

C
21
star
24

ci-dnf-stack

CI tests for the dnf stack
Gherkin
14
star
25

rpm-sequoia

An OpenPGP backend for rpm using Sequoia PGP
Rust
14
star
26

urlgrabber

Python
14
star
27

drpm

C
10
star
28

rpm-web

RPM web content
Python
10
star
29

fakeuname

Small library that overrides uname() system call to return configured fake kernel release.
C
7
star
30

rpm-gitoverlay

Manage an overlay repository of RPMs from upstream git
Python
7
star
31

fedora-distro-aliases

Aliases for active Fedora releases
Python
5
star
32

maximum-rpm

Maximum RPM
Shell
4
star
33

opensuse-distro-aliases

Aliases for active openSUSE releases
Python
4
star
34

yum-metadata-parser

C
4
star
35

rpm-extras

Shell
3
star
36

python-rpm-packaging

Tools for packaging Python projects with rpm
Python
3
star
37

dnf-URPM

URPM* tool suite implemented on top of DNF
Python
3
star
38

librhsm

C
3
star
39

rpm-metadata

Documentation of the RPM MetaData (rpm-md) format
XSLT
3
star
40

libdnf-l10n

Repository for syncing translations of the libdnf component with weblate.
Python
2
star
41

dnf-plugins-core-l10n

Repository for syncing translations of the dnf-plugins-core component with weblate.
Python
2
star
42

yum-docs

Legacy repository for Yum documentation
2
star
43

libpkgmanifest

Library for working with RPM manifests
C++
2
star
44

perl-rpm-packaging

Tools for packaging Perl projects with rpm
Perl
1
star
45

perl-RPM4

Perl module to access and manipulate RPM files
Perl
1
star
46

rpmconstant

Small library to find constants in rpm headers
C
1
star
47

dnf-l10n

Repository for syncing translations of the dnf component with weblate.
1
star
48

dnf-plugins-extras-l10n

Repository for syncing translations of the dnf-plugins-extras component with weblate.
Python
1
star
49

popt-l10n

Popt translations
CMake
1
star
50

libdnf-plugin-template

Template for libdnf plugin
C
1
star
51

dnf5-l10n

This repo is for synchronization of dnf5 translations with translate.fedoraproject.org
1
star
52

test-repo

A repository for testing DNF Bot and CI. Unfortunately a personal repo is not good enough for that.
1
star
53

mock-test-data

Place to store big binary blobs for the purpose of mock integration testing (shallow clone expected from here)
Python
1
star
54

libparch

Handle architectures for packaging purposes
C
1
star
55

yum-updatesd

yum-updatesd
Python
1
star
56

rpm-l10n

Rpm translations
CMake
1
star
57

org-admin

Adminsitrative requests for the rpm-software-management organization
1
star
58

rpm-software-management.github.io

Blog of the Software Management (DNF, RPM, YUM) teams.
HTML
1
star
59

rpmpgp_legacy

RPM legacy OpenPGP parser
C
1
star
60

R-rpm-macros

Macros and scripts for packaging software in R
R
1
star