LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-17-2016, 03:14 PM   #1
PoleStar
Member
 
Registered: Jul 2010
Posts: 231

Rep: Reputation: 2
rpmbuild do not copy files.


spec file:

Code:
Summary: A collection of great scripts and tools to maintain Linux systems.
Name: tomcat
Version: 1
Release: 1
License: GPL

BuildArch: noarch
Group: Development/Tools

Source: tomcat.tar.gz

BuildRoot: %{_tmppath}/tools

%description
This is a testpackages that containes some files. The files will be placed on a system.

%prep
%setup -q -n %{name}


%build


%install

rm -rf $RPM_BUILD_ROOT

# Then we create the directories where the files go
# don't worry if the directories exist on your target systems, rpm
# creates if necessary
#mkdir -p $RPM_BUILD_ROOT/local/scripts
mkdir -p $RPM_BUILD_ROOT/tmp

# The actual moving
cp * $RPM_BUILD_ROOT/tmp
#cp * $RPM_BUILD_ROOT/local/bin

%clean
rm -rf $RPM_BUILD_ROOT

%files


%defattr(-,root,root)
%attr(0755,root,root) /tmp


%changelog
* Mon Jan 23 2012 el <h@rt.com> - 1-1
software...
It build rpm fine with
rpmbuild -ba my.spec

resulting rpm installs fine.

Code:
[me@localhost SRPMS]$ sudo rpm -ivh tomcat-1-1.src.rpm
   1:tomcat                 ########################################### [100%]
[me@localhost SRPMS]$
But it does not copy files in /tmp dir.

Neither it show as installed.

Code:
[me@localhost SRPMS]$ sudo rpm -ql tomcat-1-1.src.rpm
package tomcat-1-1.src.rpm is not installed
[me@localhost SRPMS]$
 
Old 06-17-2016, 04:03 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the src rpm's are just the source code

there is no program in them to run

did you update the yum or rpm database

yum ( unless fedora 24 then "dnf" or suse then zypper ) should be used for installing a rpm built from the src rpm
and it will have a different name than the SRC rpm

and a question
why install to /tmp ???
instead of the rhel /usr standard
 
Old 06-17-2016, 08:56 PM   #3
PoleStar
Member
 
Registered: Jul 2010
Posts: 231

Original Poster
Rep: Reputation: 2
/tmp because, this rpm is meant to carry one script, that script is only going to run once.

But I will look into putting it in /usr.

So my build rpm need to end up in RPMS in stead for SRPMS.. interesting..
 
Old 06-21-2016, 09:44 AM   #4
PoleStar
Member
 
Registered: Jul 2010
Posts: 231

Original Poster
Rep: Reputation: 2
atcual rpm were being saved under rpmbuild/RPMS/noarch/.....

I was able to install them, and they copied over files.
 
  


Reply



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
cp how to copy hidden files and copy recusively without over writing ballsystemlord Linux - Software 5 05-25-2015 02:08 PM
[SOLVED] RPMBUILD unpackaged files listed clcbluemont Linux - Software 2 05-01-2012 10:39 AM
problem with %files directive in rpmbuild pgpython Programming 1 12-11-2010 08:45 PM
in copy files or ls files the command want to invert select some files how to?? hocheetiong Linux - Newbie 3 06-27-2008 06:32 AM
rpmbuild and custom /etc files cachemonet Red Hat 2 10-05-2007 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:48 AM.

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
Open Source Consulting | Domain Registration