GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - EuroLinux/python-rpmpatch: python tooling to automatically edit a RPM Spec file

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
configs
configs
 
 
rpmpatch
rpmpatch
 
 
test-resources
test-resources
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
TODO
TODO
 
 
create_and_fix_venv.sh
create_and_fix_venv.sh
 
 
smoke-tests.bats
smoke-tests.bats
 
 

Repository files navigation

Python RPM AutoPatch

Basically, this is a toolset for doing automated customization of a given rpm.

The idea is to keep it simple and easy to back up, while also making it simple to track what changed and reproduce the changes from the source archive.

The patchsrpm.py script will provide a sample of how to use these libraries. It also provides instructions on how to build a configuration file to begin working with this toolset right away.

Python RPM Autopatch for Enterprise Linux/EuroLinux 6 or 7

The older version that requires and uses python2 is saved and developed on the python2 branch, to use that version you can clone with the -b python2 option, for example:

git clone [email protected]:EuroLinux/python-rpmpatch.git -b python2

or checkout the branch inside the repo directory

cd python-rpmpatch
git checkout python2

Setup

Firstly install rpm-build and development packages

sudo yum install -y rpm-build @development

Note: step below is optional.

We strongly recommend using a virtual environment. Because rpm is system dependent python package, we introduced, a simple create_and_fix_venv.sh scripts that work (at least) on EL8 and EL9 systems. The whole setup is as simple as

sudo dnf install -y rpm-build
sudo dnf install -y python3-virtualenv
./create_and_fix_venv.sh

Usage

Download the package that you want to fix

wget https://your.mirror.example.net/sources/9/x86_64/appstream/Packages/f/firefox-91.9.1-1.el9_0.src.rpm -P srpms

Optionally activate virtualenv

. venv/bin/activate

To patch, you need a configuration directory. Example configuration directory is placed inside configs directory, that has sample hierarchy for EuroLinux 6 and 9.

./rpmpatch/patchsrpm.py --keep_dist --config=configs/el9/ srpms/firefox-91.9.1-1.el9_0.src.rpm

Congratulations You have nicely patched source rpm!

Note:

With --keep_dist the patcher will produce firefox-91.9.1-1.el9_0.src.rpm, without it it will produce srpm with distag used by your distribution/system.

Getting help

  • Invoking ./rpmpatch/patchsrpm.py without argument will provide options and examples.
  • Invoking ./rpmpatch/patchsrpm.py --sampleconfig prints sample config that has all necessary information to create the autopatching process
  • In case of a bug/problem or if You need help GitHub issues are very welcome :)!

Tests

There are very simple smoke tests. Note that smoke tests use rpmdev-wipetree command during executions. The tests are bats based.

Installing bats on Enterprise Linux 8/9:

sudo dnf install -y epel-release
sudo dnf install -y bats

Running tests

bats smoke-tests.bats

History

This project was originally developed by Scientific Linux Developers, which we would like to thanks. We migrated it to Python 3 and add developed it a little further.

About

python tooling to automatically edit a RPM Spec file

Resources

Readme
License
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.