LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-27-2003, 03:45 AM   #1
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Rep: Reputation: 15
rpm rebuild


how do i rebuild a program in linux from a source rpm.

i am tring to use the command:
rpm --rebuild iptables-1.2.6a-2.src.rpm

it gives me the error

iptables-1.2.6a-2.src.rpm: no such file or directory

the file exists, and even when i specify the location of the file, it still will not work. what am i doing wrong?
 
Old 09-27-2003, 04:55 AM   #2
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Rep: Reputation: 146Reputation: 146
rpmbuild --rebuild is the correct command
 
Old 09-27-2003, 05:25 AM   #3
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
that command is not for red hat. and i must be doing something wrong, because it won't rebuild. something must be missing.
 
Old 09-27-2003, 05:38 AM   #4
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
i'm probably sure you did all this, but i'll ask anyway.

1. you've "su"ed into root?
2. did you "cd" to where the *.src.rpm is at?
3. when you did specify the directory path, is the directory path using long filenames and did you put quotes around the directory path if it is using long filenames?
4. you've typed the filename correctly?
 
Old 09-27-2003, 05:42 AM   #5
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
perhaps i am not understanding how the command works. give me an example of what i am supposed to do... maby that will shed some light on the situation.
 
Old 09-27-2003, 05:48 AM   #6
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
well if you've changed to the directory where the *.src.rpm file is, you've "su"ed into root mode, and you didn't make any typos on the filename then that command you posted should work.

basically let's pretend you downloaded that source rpm file to a directory called "downloads" in your home directory. then the basic commands to use in order would be:

1. cd downloads
2. su
*enter root password*
3. rpm --rebuild iptables-1.2.6a-2.src.rpm

then look in /usr/src/redhat/RPMS for the built *.rpm file and install it.
 
Old 09-27-2003, 06:08 AM   #7
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
this is an exact copy of what i am putting in, and what comes out:

[root@localhost rpm]# pwd
/home/cdw/temp/rpm

[root@localhost rpm]# ls -l
-rw------- 1 root root 307788 Sep 27 04:56 iptables-1.2.6a-2.src.rpm

[root@localhost rpm]# rpm --rebuild ./iptables-1.2.6a-2.src.rpm
./iptables-1.2.6a-2.src.rpm: No such file or directory

i have a 12 gauge shotgun... you think that would work on it?
 
Old 09-27-2003, 06:13 AM   #8
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
it's not set as executable would be my guess. try this command:

chmod 755 *.rpm

and then try the rpm --rebuild command again.
 
Old 09-27-2003, 06:16 AM   #9
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
no go. same problem...
 
Old 09-27-2003, 06:18 AM   #10
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
what's the output of ls -l and rpm --rebuild
 
Old 09-27-2003, 06:22 AM   #11
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
[root@localhost rpm]# pwd
/home/cdw/temp/rpm

[root@localhost rpm]# ls -l
-rwxr-xr-x 1 root root 307788 Sep 27 04:56 iptables-1.2.6a-2.src.rpm

[root@localhost rpm]# rpm --rebuild iptables-1.2.6a-2.src.rpm
iptables-1.2.6a-2.src.rpm: No such file or directory
[root@localhost rpm]#
 
Old 09-27-2003, 06:28 AM   #12
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
dunno. try the command with a wildcard since the chmod command worked.

rpm --rebuild *.rpm
 
Old 09-27-2003, 06:43 AM   #13
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
i built a directory just for this... note the change.

when i issue the command:

[root@localhost wild]# rpm --rebuild ./*.rpm

i still get:

./iptables-1.2.6a-2.src.rpm: No such file or directory

all together:

[root@localhost wild]# ls
iptables-1.2.6a-2.src.rpm
[root@localhost wild]# rpm --rebuild ./*.rpm
./iptables-1.2.6a-2.src.rpm: No such file or directory


and it's the only file in the directory.

the problem has to be something else that we are overlooking... is there supposed to be a directory somewhere that doesn't exist?
 
Old 09-27-2003, 07:49 AM   #14
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Here's the easiest way. Install the .src.rpm. If you're using the root account, then it will default to placing the source tarball and any patches in /usr/src/redhat/SOURCES, and the spec file in /usr/src/redhat/SPECS. Now rpm -ba /usr/src/redhat/SPECS/<specfilename>.

---
Please note you don't need to be root to build rpm's: http://www-106.ibm.com/developerworks/library/l-rpm2/
That's how I do it (I build a lot of custom rpm's), and it works well.
For an unprivileged user account make a subdir structure similar to /usr/src/redhat, copy over the rpmmacros and rpmrc, grant readonly access to the rpm database and you're set.

Also note marking rpm's executable is unnecessary as they're not executables.
 
Old 09-27-2003, 03:59 PM   #15
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
i issued the command rpm -U iptables-1.2.6a-2.src.rpm. it created the files:


[root@localhost SOURCES]# ls -l ip*
-rwxr-xr-x 1 root root 5640 Aug 7 2002 ip6tables.init
-rw-r--r-- 1 root root 723 Aug 27 2001 iptables-1.2.2-bug50990.patch
-rw-rw-r-- 1 root root 294968 Jul 29 2002 iptables-1.2.6a.tar.bz2
-rwxr-xr-x 1 root root 5636 Aug 7 2002 iptables.init

and

[root@localhost SPECS]# ls -l ip*
-rw-rw-r-- 1 root root 6624 Aug 7 2002 iptables.spec

with the command
rpm -ba /usr/src/redhat/SPECS/iptables-1.2.6a-2.src.rpm
i still get:
iptables-1.2.6a-2.src.rpm: No such file or directory
 
  


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
rpm rebuild Xris718 Linux - General 2 05-06-2005 02:34 PM
rpm --rebuild juworld Linux - Newbie 1 02-27-2004 03:30 PM
rpm --rebuild chrisknight Linux - General 1 07-13-2003 09:12 PM
Help on RPM --rebuild ztopher Linux - Software 3 03-28-2003 07:46 AM
RPM rebuild? GT I.N.C Linux - Software 4 10-20-2002 02:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration