26.3 Example Usage

The following example describes the procedure to deliver a file called readme to the /usr/share/myapp directory:

  1. Enter the following commands to create the directory structure and create the .tar file:

    $ mkdir -p usr/share/myapp
    
    $ echo "Hello World" >usr/share/myapp/readme
    
    $ tar zcvf helloworld.tgz usr
    

    When the tarball is unpacked, it will create the /usr/share/myapp directory containing the readme file.

  2. Use Alien package converter to make an RPM package of the tarball by entering the following command:

    $ alien -r helloworld.tgz
    

    The Alien package converter creates the helloworld-1-2.noarch.rpm package.

  3. Verify that the package is valid and list its contents by entering the following commands:

    $ rpm -qlp helloworld-1-2.noarch.rpm
    
    /usr
    
    /usr/share
    
    /usr/share/myapp
    
    /usr/share/myapp/README
    

The alien utility has other options, such as to set the version and description of the package. See “man alien” for more information.