LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-10-2008, 12:50 PM   #1
jjap
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
Why is rpmbuild -ba name.spec is creating a <name>-debug.rpm only


Why is rpmbuild -ba name.spec is creating a <name>-debug.rpm file?
It does not create a regular name.rpm althoug it is creating a source rpm?
Also, how to do test the uninstall?
All I need to do is run "make uninstall".
%uninstall
make uninstall
rpm -e <name>-debug.rpm comes back right away but the files are still there.
 
Old 06-11-2008, 07:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by jjap View Post
Why is rpmbuild -ba name.spec is creating a <name>-debug.rpm file?
- What does 'rpm --showrc|grep -i debug' return? (please use BB code tags to format your output)
- What happens if you add these two lines to the top of your name.spec and rebuild again?:
Code:
%define debug_packages	%{nil}
%define debug_package %{nil}

Quote:
Originally Posted by jjap View Post
It does not create a regular name.rpm althoug it is creating a source rpm?
Post your full spec file contents please?


Quote:
Originally Posted by jjap View Post
Also, how to do test the uninstall?
All I need to do is run "make uninstall".
%uninstall
make uninstall
rpm -e <name>-debug.rpm comes back right away but the files are still there.
The syntax is 'rpm -e name', not 'rpm -e name.rpm'. AFAIK RPM uses the %files section, together with any %preun and %postun for customisation and RPM database dependency checking to determine what to uninstall. Using 'make uninstall' could yield unexpected results if dependencies are not met.
 
Old 06-12-2008, 05:18 PM   #3
jjap
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Almost there -

[QUOTE]
Thanks for your reply. I tried your suggestion of adding the two define lines
Code:
%define debug_packages	%{nil}
%define debug_package %{nil}
and it did not create a debuginfo.rpm.
It seems once I got a file list from doing the manual install
by do a [b]find[\b] command before and after the install, things got better.
here is my .spec file
[code]
%define debug_packages ${nil}
%define debug_package ${nil}

Summary: A Open Database Connectivity
Name: unixODBC
Version: 2.2.12
Release: 1
License: GPL
Group: Applications/Databases
Source0: unixODBC-2.2.12.built.tar.gz


%description
UnixODBC is Open Database Connectivity (ODBC) - a standard software API specific
ation for using database management systems (DBMS).
The ODBC API is a library of ODBC functions that let ODBC-enabled applications c
onnect to any database for which an ODBC driver is available, execute SQL statem
ents, and retrieve results. The goal of ODBC is to make it possible to access a
ny data from any application, regardless of which database management system (DB
MS) is handling the data. ODBC achieves this by inserting a middle layer called
a database driver between an application and the DBMS. This layer translates the
application's data queries into commands that the DBMS understands.

Install UnixODBC to access data from any application.

%prep
%setup -q

%build
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"


%install
make install


%files
/usr/lib/libboundparam.la
/usr/lib/libboundparam.so
/usr/lib/libboundparam.so.1
/usr/lib/libboundparam.so.1.0.0
/usr/lib/libesoobS.la
/usr/lib/libesoobS.so
/usr/lib/libesoobS.so.1
/usr/lib/libesoobS.so.1.0.0
/usr/lib/libgtrtst.la
/usr/lib/libgtrtst.so
/usr/lib/libgtrtst.so.1
/usr/lib/libgtrtst.so.1.0.0
/usr/lib/libmimerS.la
/usr/lib/libmimerS.so
/usr/lib/libmimerS.so.1
/usr/lib/libmimerS.so.1.0.0
/usr/lib/libnn.la
/usr/lib/libnn.so
/usr/lib/libnn.so.1
/usr/lib/libnn.so.1.0.0
/usr/lib/libodbccr.la
/usr/lib/libodbccr.so
/usr/lib/libodbccr.so.1
/usr/lib/libodbccr.so.1.0.0
/usr/lib/libodbcdrvcfg1S.la
/usr/lib/libodbcdrvcfg1S.so
/usr/lib/libodbcdrvcfg1S.so.1
/usr/lib/libodbcdrvcfg1S.so.1.0.0
/usr/lib/libodbcdrvcfg2S.la
/usr/lib/libodbcdrvcfg2S.so
/usr/lib/libodbcdrvcfg2S.so.1
/usr/lib/libodbcdrvcfg2S.so.1.0.0
/usr/lib/libodbcinst.la
/usr/lib/libodbcinst.so
/usr/lib/libodbcinst.so.1
/usr/lib/libodbcinst.so.1.0.0
/usr/lib/libodbc.la
/usr/lib/libodbcminiS.la
/usr/lib/libodbcminiS.so
/usr/lib/libodbcminiS.so.1
/usr/lib/libodbcminiS.so.1.0.0
/usr/lib/libodbcmyS.la
/usr/lib/libodbcmyS.so
/usr/lib/libodbcmyS.so.1
/usr/lib/libodbcmyS.so.1.0.0
/usr/lib/libodbcnnS.la
/usr/lib/libodbcnnS.so
/usr/lib/libodbcnnS.so.1
/usr/lib/libodbcnnS.so.1.0.0
/usr/lib/libodbcpsql.la
/usr/lib/libodbcpsqlS.la
/usr/lib/libodbcpsql.so
/usr/lib/libodbcpsql.so.2
/usr/lib/libodbcpsql.so.2.0.0
/usr/lib/libodbcpsqlS.so
/usr/lib/libodbcpsqlS.so.1
/usr/lib/libodbcpsqlS.so.1.0.0
/usr/lib/libodbc.so
/usr/lib/libodbc.so.1
/usr/lib/libodbc.so.1.0.0
/usr/lib/libodbctxt.la
/usr/lib/libodbctxtS.la
/usr/lib/libodbctxt.so
/usr/lib/libodbctxt.so.1
/usr/lib/libodbctxt.so.1.0.0
/usr/lib/libodbctxtS.so
/usr/lib/libodbctxtS.so.1
/usr/lib/libodbctxtS.so.1.0.0
/usr/lib/liboplodbcS.la
/usr/lib/liboplodbcS.so
/usr/lib/liboplodbcS.so.1
/usr/lib/liboplodbcS.so.1.0.0
/usr/lib/liboraodbcS.la
/usr/lib/liboraodbcS.so
/usr/lib/liboraodbcS.so.1
/usr/lib/liboraodbcS.so.1.0.0
/usr/lib/libsapdbS.la
/usr/lib/libsapdbS.so
/usr/lib/libsapdbS.so.1
/usr/lib/libsapdbS.so.1.0.0
/usr/lib/libtdsS.la
/usr/lib/libtdsS.so
/usr/lib/libtdsS.so.1
/usr/lib/libtdsS.so.1.0.0
/usr/lib/libtemplate.la
/usr/lib/libtemplate.so
/usr/lib/libtemplate.so.1
/usr/lib/libtemplate.so.1.0.0

%clean

%showrc

%preun
cd $buildroot
cd /usr/src/redhat/BUILD/unixODBC-2.2.12

%uninstall
make uninstall
/usr/lib/libtemplate.so.1.0.0

%clean

%showrc

%preun
cd $buildroot
cd /usr/src/redhat/BUILD/unixODBC-2.2.12

%uninstall
make uninstall

%defattr(-,root,root)


[\code]

When I go to install the rpm it appears to be installing files.
My only fear is that I might not have a copmplete list of all the files the manual install created.

The [b]rpm -e unixODBC-2.2.12-1 [\b]actually removes those files, but only because I am running it on the machine where I built the rpm. It works because the /usr/src/redhat/BUILD/unixODBC-2.2.12 path still exists.
I do not just want to remove the files under /usr/lib because maybe that is and incomplete uninstall.
[b]How can I be remove the files properly?[\b]

[\QUOTE]
 
Old 06-12-2008, 06:01 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by jjap View Post
Source0: unixODBC-2.2.12.built.tar.gz
Red Hat RHEL, CentOS, Fedora, rpm.pbone.net and rpmfind.net show pre-built RPMs of unixODBC, so make sure you want to build your own RPM. If you do you should download the .src.rpm, extract the .spec file and learn from that as your .spec file does not conform to standards. We could "adapt" yours, but that would be reinventing the wheel.


Quote:
Originally Posted by jjap View Post
%files
/usr/lib/libboundparam.la
This does not compute. Make a file list with say 'find $RPM_BUILD_DIR -printf '%%defattr(-,root,root) %f\n'' instead.


Quote:
Originally Posted by jjap View Post
%showrc
Never seen --showrc been used this way. Are you sure you shouldn't run 'rpm --showrc' instead?


Quote:
Originally Posted by jjap View Post
%preun
cd $buildroot
cd /usr/src/redhat/BUILD/unixODBC-2.2.12

%uninstall
make uninstall
/usr/lib/libtemplate.so.1.0.0
The pre-uninstall phase is for customised deinstallation tasks, and as I said before will fail if prereqs aren't met. On uninstall there is no "/usr/src/redhat/BUILD/unixODBC-2.2.12" directory on the target system nor should there be, so "make uninstall" will fail horribly.


Quote:
Originally Posted by jjap View Post
%clean
In the cleanup phase you remove your $RPM_BUILD_ROOT.


Quote:
Originally Posted by jjap View Post
When I go to install the rpm it appears to be installing files. My only fear is that I might not have a copmplete list of all the files the manual install created.
See "%files".


Quote:
Originally Posted by jjap View Post
The rpm -e unixODBC-2.2.12-1 actually removes those files, but only because I am running it on the machine where I built the rpm. It works because the /usr/src/redhat/BUILD/unixODBC-2.2.12 path still exists. I do not just want to remove the files under /usr/lib because maybe that is and incomplete uninstall. How can I be remove the files properly?
See start of reply: build a "proper" RPM using the clues and let the RPMDB do its work.

Last edited by unSpawn; 06-12-2008 at 06:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.spec file: creating an RPM: Files don't appear in designated paths CPUFreak91 Linux - Software 18 08-03-2006 09:43 AM
Need help with RPMBUILD .spec included wadevondoom Linux - Software 3 07-27-2006 06:59 PM
Problem with rpmbuild and template.spec file abefroman Linux - Software 0 11-27-2005 12:18 AM
rpmbuild without stripping debug info gdaly77 Linux - Software 0 05-27-2004 02:43 PM
rpmbuild -ba php.spec pk21 Linux - General 0 09-16-2003 09:34 AM


All times are GMT -5. The time now is 08:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration