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.
Procedure
-
Create a
tar
archive of your application source code:In this example, your application source code is in a directory named
my-app
. -
Move the
.tar
archive of your software to therpmbuild/SOURCES
directory: -
Create a
spec
file for a new RPM package calledmy-app
:This command creates a spec file for your
my-app
application in~/rpmbuild/SPECS/my-app.spec
. -
Modify the
~/rpmbuild/SPECS/my-app.spec
file 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
.rpm
file 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 a .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 AutoSD image.
Next steps