This Java library turns your binary storage
(files, S3 objects, anything) into an RPM repository.
You may add it to your binary storage and it will become
a fully-functionable RPM repository, which
yum
and
dnf
will perfectly understand.
Similar solutions:
Some valuable references:
- RPM format
- Yum repository internals (blog post)
- YUM repository and package management: Complete Tutorial (blog post)
- The Origin of RPM Content
This is the dependency you need:
<dependency>
<groupId>com.artipie</groupId>
<artifactId>rpm-adapter</artifactId>
<version>[...]</version>
</dependency>
Then, you implement com.yegor256.rpm.Storage
interface.
Then, you make an instance of Rpm
class with your storage
as an argument. Finally, you put your artifacts to the storage
and instruct Rpm
to update the meta info:
import com.artipie.rpm.Rpm;
Rpm rpm = new Rpm(storage);
rpm.update("test/my.rpm");
To update the whole repository with all RPM files use batchUpdate
method of Rpm
class:
import com.artipie.rpm.Rpm;
Rpm rpm = new Rpm(storage);
rpm.batchUpdate("test");
Read the Javadoc for more technical details.
Naming policy
RPM may use different names to store metadata files in the package,
by default NamingPolicy.DEFAULT
will be used, to change naming policy use
secondary constructor of Rpm
to configure it. For instance to add SHA1
prefixes for metadata files
use new Rpm(storage, new NamingPolicy.Sha1Prefixed())
.
How it works?
First, you upload your .rpm
artifact to the repository. Then,
you call update()
and these four system XML files are updated
in the repodata
directory:
repomd.xml
, primary.xml.gz
, filelists.xml.gz
, and others.xml.gz
.
Examples of these files you can find in this repo.
Cli
Build the Cli tool using mvn clean package -Pcli
.
You can run it as following
java -jar target/rpm-adapter.jar ./repo-dir/
Options are:
naming-policy
- (optional, defaultsimple
) configures NamingPolicy for Rpmdigest
- (optional, defaultsha256
) configures Digest instance for Rpm
How to contribute
Fork repository, make changes, send us a pull request. We will review
your changes and apply them to the master
branch shortly, provided
they don't violate our quality standards. To avoid frustration, before
sending us your pull request please run full Maven build:
$ mvn clean install -Pqulice
To avoid build errors use Maven 3.2+.