Issue while creating RPM


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Issue while creating RPM
# 1  
Old 09-06-2016
Wrench Issue while creating RPM

I am trying to create an RPM that basically creates a JBOss container. At the end it copies folders and files in a particular directory structure.

Code:
    /root/rpmbuild/SOURCES
    [root@vm1-msdp SOURCES]# tree cac-1.0
    cac-1.0
    └── opt
        └── msdp
            └── ca
                └── iam_cac
                    ├── bin
                    │** ├── app.sh
                    │** ├── offset
                    │** ├── start.sh
                    │** ├── status.sh
                    │** └── stop.sh

I have created cac-1.0.tar.gz under /root/rpmbuild/SOURCES.

On the node on which I install this RPM, I want a directory structure like

Code:
   /opt/msdp/ca/iam_cac/bin/*

My spec file looks like:

Code:
    # Don't try fancy stuff like debuginfo, which is useless on binary-only
    # packages. Don't strip binary too
    # Be sure buildpolicy set to do nothing
    %define        __spec_install_post %{nil}
    %define          debug_package %{nil}
    %define        __os_install_post %{_dbpath}/brp-compress
    %define _unpackaged_files_terminate_build 0

    Summary: A very simple toy bin rpm package
    Name: iam_cac
    Version: 1.0
    Release: 1

    SOURCE0 : cac-1.0.tar.gz

    BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

    %description
    %{summary}

    %prep
    %setup -q

    %build
    # Empty section.

    %install
    rm -rf %{buildroot}
    mkdir -p  %{buildroot}

    # in builddir
    cp -a * %{buildroot}

    %clean
    rm -rf %{buildroot}

    %files
    %defattr(-,root,root,-)


I then run;

Code:
    # rpmbuild -ba SPECS/iamcac.spec 
    

    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.jKBlSc
    + umask 022
    + cd /root/rpmbuild/BUILD
    + LANG=C
    + export LANG
    + unset DISPLAY
    + cd /root/rpmbuild/BUILD
    + rm -rf iam_cac-1.0
    + /usr/bin/gzip -dc /root/rpmbuild/SOURCES/cac-1.0.tar.gz
    + /bin/tar -xf -
    + STATUS=0
    + '[' 0 -ne 0 ']'
    + cd iam_cac-1.0
    + /bin/chmod -Rf a+rX,u+w,g-w,o-w .
    + exit 0
    Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.H9BYEA
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd iam_cac-1.0
    + LANG=C
    + export LANG
    + unset DISPLAY
    + exit 0
    Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.OhchxY
    + umask 022
    + cd /root/rpmbuild/BUILD
    + '[' /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64 '!=' / ']'
    + rm -rf /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    ++ dirname /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    + mkdir -p /root/rpmbuild/BUILDROOT
    + mkdir /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    + cd iam_cac-1.0
    + LANG=C
    + export LANG
    + unset DISPLAY
    + rm -rf /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    + mkdir -p /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    + cp -a opt /root/rpmbuild/BUILDROOT/cac-1.0-1.x86_64
    Processing files: iam_cac-1.0-1.x86_64
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/iam_cac-1.0-1.x86_64
    warning: Installed (but unpackaged) file(s) found:
       /opt/msdp/ca/iam_cac/bin/app.sh
       /opt/msdp/ca/iam_cac/bin/offset
       /opt/msdp/ca/iam_cac/bin/start.sh
       /opt/msdp/ca/iam_cac/bin/status.sh
       /opt/msdp/ca/iam_cac/bin/stop.shWrote: /root/rpmbuild/SRPMS/iam_cac-1.0-1.src.rpm
    Wrote: /root/rpmbuild/RPMS/x86_64/cac-1.0-1.x86_64.rpm
    Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.5u5vYq
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd iam_cac-1.0
    + rm -rf /root/rpmbuild/BUILDROOT/iam_cac-1.0-1.x86_64
    + exit 0

It generates :

Code:
    /root/rpmbuild/RPMS/x86_64/iam_cac-1.0-1.x86_64.rpm

but it is only 1.7KB in size and when installed, does not make the file structure I desire.

What else am I missing ?
# 2  
Old 09-13-2016
Here is your problem:

Code:
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/iam_cac-1.0-1.x86_64
    warning: Installed (but unpackaged) file(s) found:
       /opt/msdp/ca/iam_cac/bin/app.sh
       /opt/msdp/ca/iam_cac/bin/offset
       /opt/msdp/ca/iam_cac/bin/start.sh
       /opt/msdp/ca/iam_cac/bin/status.sh
       /opt/msdp/ca/iam_cac/bin/stop.shWrote: /root/rpmbuild/SRPMS/iam_cac-1.0-1.src.rpm

You need to list the files you wish to include in the %files section. Something like:

Code:
%files
/opt/msdp

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Rpm issue with autoconf-2.63-1.AIX6.1.noarch.rpm

dears i am trying to install the autoconf-2.63-1.aix6.1.noarch.rpm but its shows the below error message . P700_dev/svn/dependencies>rpm -i autoconf-2.63-1.aix6.1.noarch.rpm error: failed dependencies: m4 is needed by autoconf-2.63-1 P700_dev/svn/dependencies> (6 Replies)
Discussion started by: thecobra151
6 Replies

2. Red Hat

Issue with rpm package

Hello I have Storage foundation 6.0 version to install in redhat 6.0, so while trying to install one of the application it say to install some dependencies packages so when i try to install the dependencies again it ask for the dependencies so its a lengthy process i say. so now can i get the... (1 Reply)
Discussion started by: cyrus.ranjith
1 Replies

3. AIX

Issue with installing rpm in AIX 6.1

I am trying to install an rpm : libiconv-1.14-1.aix5.1.ppc.rpm which is a dependency to install GIT. While I gave the command I got the foll message: root:user-> $ rpm -i -v libiconv-1.14-1.aix5.1.ppc.rpm libiconv-1.14-1 ar: Cannot open or remove a file containing a running program.... (2 Replies)
Discussion started by: gaugeta
2 Replies

4. Linux

rpm packaging issue for unixodbc driver manager

Hi All, I am trying to make rpm package for unixODBC driver manager 2.3.0 using below spec file. During rpmbuild i am getting the error. Can you pls advice how we can overcome this issue %define name unixODBC %define ver 2.3.0 %define prefix /usr %define sysconfdir /etc %define libdir... (2 Replies)
Discussion started by: kamauv234
2 Replies

5. AIX

Creating RPM

HI All, I have couple of doubts on creating RPM in AIX. I have AIX 5.3 version. I installed rpmbuild on it. Before creating RPM in AIX I just wanted to know whether I can install the RPM created in the other linux flavors like Ubuntu or Red Hat or I need to create the RPM in AIX alone to install... (3 Replies)
Discussion started by: vijayraghavk
3 Replies

6. Red Hat

Creating rpm package file

Hi, I have a binary file ans some scripts which copy the binary file to a location and create some files and then add a entry to cron . I want to create a rpm package file for all these.So that if a user run: rpm -i my.rpm the binary is copied and scripts are run. Can anyone help me in... (1 Reply)
Discussion started by: kailash19
1 Replies

7. UNIX for Advanced & Expert Users

Can someone help me with creating RPM sample i need ?

i know there are tons n tons of documentation out there to help me out to understand this.. but wen i read it, its to confusing for me.. i would really wish a kind hearted person on this forum can come out with a sample spec file for the example steps that i need for the RPM. This will make me... (0 Replies)
Discussion started by: bladez
0 Replies

8. Shell Programming and Scripting

How to make RPM not write to RPM database if RPM fails to deploy?

How to make RPM not write to RPM database if RPM fails to deploy? IE I create an rpm spec file that contains the following if then exit 1 fi My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies

9. Red Hat

RPM Installation & Removal issue

Hi, I created an RPM for one of our internal serer: tel-gw--2010.05.1.0-SNAPSHOT-1.rpm What happened I Installed for 5 times, and it get installed (/usr/tel-gw/) & added 5 entries into rpm db. And when I query RPM db as "rpm -qa | grep tel-gw--2010.05.1.0-SNAPSHOT-1", it shows 5 times in... (0 Replies)
Discussion started by: jw_amp
0 Replies

10. Red Hat

Source RPM issue

Hi, I have created one soruce rpm by using some help file on net. when i installed the rpm with command "rpm -i xxx.rpm", by default it got installed under "/usr/src/redhat/SOURCES/. I want to install these source file under /application/myapps/. Also i want some guidence to improve the source... (0 Replies)
Discussion started by: rajeshatbuzz
0 Replies
Login or Register to Ask a Question