<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas Puntillo</title>
    <description>The latest articles on DEV Community by Lucas Puntillo (@puntillolcode).</description>
    <link>https://dev.to/puntillolcode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F554770%2F87590bd4-9d07-4c05-af83-436c99086426.png</url>
      <title>DEV Community: Lucas Puntillo</title>
      <link>https://dev.to/puntillolcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/puntillolcode"/>
    <language>en</language>
    <item>
      <title>HOW TO MAKE A RPM PACKAGE</title>
      <dc:creator>Lucas Puntillo</dc:creator>
      <pubDate>Wed, 06 Jan 2021 15:00:13 +0000</pubDate>
      <link>https://dev.to/puntillolcode/how-to-make-a-rpm-package-1ahn</link>
      <guid>https://dev.to/puntillolcode/how-to-make-a-rpm-package-1ahn</guid>
      <description>&lt;h2&gt;
  
  
  How to make a RPM package
&lt;/h2&gt;

&lt;p&gt;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.) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: The package was made on a CentOS 7 Virtual machine and was tested on a Fedora Linux 33 virtual machine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Step one, dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install rpm-build rpm-devel rpmlint make diffutils patch rpmdevtools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step two, setup build directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir $HOME/rpmmaker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step three, create a specifications file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name:       test
Version:    1
Release:    1
Summary:    a test RPM package
License:    None

%description
This is my first RPM package, which does nothing.

%prep
# We have nothing to prepare.

%build
cat &amp;gt; hello-world &amp;lt;&amp;lt;EOF
#!/bin/sh
echo Hello world
EOF

%install
mkdir -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!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as helloworld.spec in the rpmmaker directory&lt;/p&gt;

&lt;p&gt;Step four, make the rpm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $HOME/rpmmaker
rpmdev-setuptree
rpmbuild -ba helloworld.spec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The directory &lt;code&gt;/home/YourName/rpmbuild/RPMS/x86_64/&lt;/code&gt; should hold your RPM file.&lt;/p&gt;

&lt;p&gt;Step 5, testing the file:&lt;/p&gt;

&lt;p&gt;cd into the directory where the rpm is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo rpm -i filename.rpm
hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it says "Hello World!" then the file works.&lt;/p&gt;

&lt;p&gt;The RPM is now ready to be shared.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>redhat</category>
      <category>rpm</category>
      <category>packagemanagement</category>
    </item>
  </channel>
</rss>
