How to create a simple rpm using spec file just to deploy few files as they are in source in Red Hat Enterprise Linux 5/6/7?

Solution Verified - Updated -

Issue

  • There are few files in a tar compressed archive, just need to create an rpm and deploy them using the same.
  • Here is the tar archive tree structure.
[root@localhost ~]# tar tvf someapp.tar.gz
-rw-r--r-- root/root         0 2014-06-18 08:49 /etc/someapp.cfg
-rw-r--r-- root/root         0 2014-06-18 08:48 /opt/someapp/file1
-rw-r--r-- root/root         0 2014-06-18 08:48 /opt/someapp/file2
-rw-r--r-- root/root         0 2014-06-18 08:48 /opt/someapp/file3
-rw-r--r-- root/root         0 2014-06-18 08:48 /opt/someapp/file4
  • The rpm shall delete existing /etc/someapp.cfg.save and rename /etc/someapp.cfg to /etc/someapp.cfg.save and then deploy /etc/someapp.cfg from rpm.
  • It shall also display /etc/someapp.cfg as a configuration file.
  • The owner and group of all files shall be root with default permissions.

Environment

  • Red Hat Enterprise Linux 5/6/7
  • rpmbuild

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.