Packaging applications with RPM¶
Use this workflow to package your own application source code into an RPM package. After you package your software, add it to a local RPM repository. RPM Package Manager queries the RPM packages in this repository, resolves their dependencies, and installs them in your operating system (OS) image.
Important
The host operating system that you use for packaging must be the same as, or compatible with, the target operating system where you want to install the RPM. For example, an RPM that you build on Fedora may not be compatible with your target AutoSD operating system.
Procedure
-
Create a
tararchive of your application source code:In this example, your application source code is in a directory named
my-app. -
Move the
.tararchive of your software to therpmbuild/SOURCESdirectory: -
Create a
specfile for a new RPM package calledmy-app:This command creates a spec file for your
my-appapplication in~/rpmbuild/SPECS/my-app.spec. -
Modify the
~/rpmbuild/SPECS/my-app.specfile with a text editor. For more information about spec files and how to customize them, see the RPM packaging Guide on GitHub. -
Build the binary RPM package:
-
Create a directory for your RPM package repository, move your
.rpmfile to this directory, and initialize the directory as an RPM package repository:
Your RPM package repository is now ready, and it contains your software packaged as an .rpm file. When you build the AutoSD image, include the RPM
package repository in the build manifest to enable the OS image to incorporate your software. For more information about building the AutoSD image,
see Building an image from a custom manifest.
Next steps