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?
Issue
- There are few files in a
tarcompressed archive, just need to create anrpmand deploy them using the same. - Here is the
tararchive 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.saveand rename/etc/someapp.cfgto/etc/someapp.cfg.saveand then deploy/etc/someapp.cfgfromrpm. - It shall also display
/etc/someapp.cfgas 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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
