
Posted on • Originally published atlucaspuntillo.blogspot.com
HOW TO MAKE A RPM PACKAGE
How to make a RPM package
RPM is a versatile Linux packaging originally meant for Red Hat Linux (now RHEL) but now ported to Fedora Linux, Clear linux, and many more distro's. In my opinion, it is more cleaner and refined than the .deb format, DPKG, and APT, (used by Debian Linux and it's derivatives.)
NOTE: The package was made on a CentOS 7 Virtual machine and was tested on a Fedora Linux 33 virtual machine.
Step one, dependencies:
yum install rpm-build rpm-devel rpmlint make diffutils patch rpmdevtools
Step two, setup build directory
mkdir $HOME/rpmmaker
Step three, create a specifications file:
Name: testVersion: 1Release: 1Summary: a test RPM packageLicense: None%descriptionThis is my first RPM package, which does nothing.%prep# We have nothing to prepare.%buildcat > hello-world <<EOF#!/bin/shecho Hello worldEOF%installmkdir -p %{buildroot}/usr/bin/install -m 755 hello-world %{buildroot}/usr/bin/hello-world%files/usr/bin/hello-world%changelog#This is version 1.0!
Save it as helloworld.spec in the rpmmaker directory
Step four, make the rpm:
cd $HOME/rpmmakerrpmdev-setuptreerpmbuild -ba helloworld.spec
The directory/home/YourName/rpmbuild/RPMS/x86_64/
should hold your RPM file.
Step 5, testing the file:
cd into the directory where the rpm is
sudo rpm -i filename.rpmhello-world
If it says "Hello World!" then the file works.
The RPM is now ready to be shared.
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse