LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-08-2010, 02:09 PM   #1
ethereal1m
Member
 
Registered: Jan 2010
Distribution: slackware 13.0 64
Posts: 259

Rep: Reputation: 30
Question Try to remove previous installation and create a package but got an error


Dear all,
I once installed a software using make install and uninstalled it manually (since I'm not familiar with make uninstall). But when I try to create a package using src2pkg from its binary, got an error.

Suppose this is the makefile:
Code:
TGT=noip2
CC=gcc
PKG=noip-2.1.tgz

PREFIX=/usr/local
CONFDIR=${PREFIX}/etc
BINDIR=${PREFIX}/bin

# these defines are for Linux
LIBS=
ARCH=linux

# for Mac OS X and BSD systems that have getifaddr(), uncomment the next line
#ARCH=bsd_with_getifaddrs

# for early BSD systems without getifaddrs(), uncomment the next line
#ARCH=bsd


# for solaris, uncomment the next two lines
# LIBS=-lsocket -lnsl
# ARCH=sun

${TGT}: Makefile ${TGT}.c 
	${CC} -Wall -g -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS}

install: ${TGT} 
	if [ ! -d ${BINDIR} ]; then mkdir -p ${BINDIR};fi
	if [ ! -d ${CONFDIR} ]; then mkdir -p ${CONFDIR};fi
	cp ${TGT} ${BINDIR}/${TGT}
	${BINDIR}/${TGT} -C -c /tmp/no-ip2.conf
	mv /tmp/no-ip2.conf ${CONFDIR}/no-ip2.conf

package: ${TGT}
	rm  -f *.bak
	mv ${TGT} binaries/${TGT}-`uname -m`
	scp a-k:/local/bin/noip2 binaries/noip2-`ssh a-k uname -m`
	cd ..; tar zcvf /tmp/${PKG} noip-2.0/*
	scp /tmp/${PKG} a-k:/opt/www/${PKG}
	rm /tmp/${PKG}

clean: 
	rm -f *o
	rm -f binaries/*
	rm -f ${TGT}
And to uninstall, I deleted /usr/local/etc/noip.conf and /usr/loca/bin/noip

Then I did src2pkg:
Code:
root@firefly:/home/ethereal1m/src# src2pkg -VV -W noip-duc-linux.tar.gz 
Found global src2pkg.conf - Reading /etc/src2pkg/src2pkg.conf           
Found source archive: noip-duc-linux.tar.gz                             
Creating working directories:                                           
   PKG_DIR=/tmp/noip-duc-linux-x86_64-1                                 
   SRC_DIR=/tmp/noip-duc-linux-src-1                                    
Unpacking source archive -                                              
./._noip-2.1.9-1                                                        
noip-2.1.9-1/                                                           
noip-2.1.9-1/._binaries                                                 
noip-2.1.9-1/binaries/                                                  
noip-2.1.9-1/binaries/._noip2-i686                                      
noip-2.1.9-1/binaries/noip2-i686                                        
noip-2.1.9-1/binaries/._noip2-x86_64                                    
noip-2.1.9-1/binaries/noip2-x86_64                                      
noip-2.1.9-1/._COPYING                                                  
noip-2.1.9-1/COPYING                                                    
noip-2.1.9-1/._debian.noip2.sh                                          
noip-2.1.9-1/debian.noip2.sh                                            
noip-2.1.9-1/._gentoo.noip2.sh                                          
noip-2.1.9-1/gentoo.noip2.sh                                            
noip-2.1.9-1/._LEEME.PRIMERO                                            
noip-2.1.9-1/LEEME.PRIMERO                                              
noip-2.1.9-1/._LIESMICH.ERST.deutsch                                    
noip-2.1.9-1/LIESMICH.ERST.deutsch                                      
noip-2.1.9-1/._LISEZMOI.ENPREMIER                                       
noip-2.1.9-1/LISEZMOI.ENPREMIER                                         
noip-2.1.9-1/._mac.osx.startup                                          
noip-2.1.9-1/mac.osx.startup                                            
noip-2.1.9-1/._Makefile                                                 
noip-2.1.9-1/Makefile                                                   
noip-2.1.9-1/._noip2.c                                                  
noip-2.1.9-1/noip2.c                                                    
noip-2.1.9-1/._README.FIRST                                             
noip-2.1.9-1/README.FIRST                                               
noip-2.1.9-1/._README.FIRST-SWE                                         
noip-2.1.9-1/README.FIRST-SWE                                           
noip-2.1.9-1/._README.FIRST.FRANCAIS                                    
noip-2.1.9-1/README.FIRST.FRANCAIS                                      
noip-2.1.9-1/._README.FIRST.ITALIANO                                    
noip-2.1.9-1/README.FIRST.ITALIANO                                      
noip-2.1.9-1/._README.FIRST.JAPANESE                                    
noip-2.1.9-1/README.FIRST.JAPANESE                                      
noip-2.1.9-1/._README.FIRST.pt_BR                                       
noip-2.1.9-1/README.FIRST.pt_BR                                         
noip-2.1.9-1/._README.FIRST_PT                                          
noip-2.1.9-1/README.FIRST_PT                                            
noip-2.1.9-1/._redhat.noip.sh                                           
noip-2.1.9-1/redhat.noip.sh                                             

Correcting source permissions - Done
Checking for patches - None found   
Skipping configuration: Nothing to be done
Continuing - We found at least one Makefile
Compiling sources - Using: 'make'          
Compiler Messages:                         
gcc -Wall -g -Dlinux -DPREFIX=\"/usr/local\" noip2.c -o noip2 
Compiling has been - Successful!                              
Checking for Makefile rule: 'install' Okay                    
Creating content in JAIL root - Using: 'make install'         
if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin;fi   
if [ ! -d /usr/local/etc ]; then mkdir -p /usr/local/etc;fi   
cp noip2 /usr/local/bin/noip2                                 
/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf                   
make: /usr/local/bin/noip2: Command not found                 
make: *** [install] Error 127                                 
Safe content creation - Successful!                           
Processing package content:                                   
Correcting package permissions - Done                         
Stripping ELF binaries - Using: strip -p --strip-unneeded Done
Checking for standard documents - Done                        
Creating slack-desc - From default text                       
Searching for links in: noip-duc-linux-x86_64-1 - None found  
Rechecking package correctness -                              
Checking for misplaced dirs -                                 
   Notice - Package contains /usr/local directory, but PRE_FIX is: /usr
   You may need to patch the Makefile(s) to correct the installation prefix.
   FATAL! This build installs faulty directories or files.                  
   You must fix the build as suggested above, or override this action with: 
   FAIL_ON_BAD_DIRS=NO from the command-line or in your src2pkg.conf file.
I don't understand why I got the following errors:
Code:
make: /usr/local/bin/noip2: Command not found                 
make: *** [install] Error 127
And also I don't understand why it is complaining that PRE_FIX is /usr whereas according to MAKEFILE PRE_FIX is /usr/local. Where did it get a change?

Regards,
ethereal1m
 
Old 04-09-2010, 07:19 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi,

I am not familiar with src2pkg, however,
Quote:
And also I don't understand why it is complaining that PRE_FIX is /usr whereas according to MAKEFILE PRE_FIX is /usr/local. Where did it get a change?
PREFIX is /usr/local and PRE_FIX is /usr. That's two different variables. I did not see PRE_FIX in your Makefile. Is it possible that PRE_FIX is set by src2pkg?

P.S.: I assume you posted the complete Makefile and not just an excerpt.
 
1 members found this post helpful.
Old 04-09-2010, 07:24 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
As for your error
Code:
cp noip2 /usr/local/bin/noip2                                 
/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf                   
make: /usr/local/bin/noip2: Command not found                 
make: *** [install] Error 127                                 
Safe content creation - Successful!                           
Processing package content:                                   
Correcting package permissions - Done
This looks like a sanity check. /usr/local/bin/noip2 probably just did not have execute permissions and it was automatically corrected. If it would not have been copied to /usr/local/bin then cp would have thrown an error.

Hope this helps.
 
1 members found this post helpful.
Old 04-09-2010, 07:40 AM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi again,

just downloaded src2pkg. according to that script you should be able to set PRE_FIX by the --prefix, --pre_fix or -p option. All should work the same way. So try something like
Code:
src2pkg --prefix=/usr/local <your other options>
If you ommit --prefix it defaults to /usr.
 
1 members found this post helpful.
Old 04-09-2010, 01:08 PM   #5
ethereal1m
Member
 
Registered: Jan 2010
Distribution: slackware 13.0 64
Posts: 259

Original Poster
Rep: Reputation: 30
Thumbs up

crts .... very nice thanks for clearing things up
 
  


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
Create a package out of an Installation, preserving the correct path Alexvader Slackware 5 12-21-2009 06:49 PM
Trying to Compile Software Package. C compiler cannot create executables * Error Msg* Ciik13 Programming 6 09-25-2009 12:38 AM
apt-get installation hung-up and I cannot remove or purge package qajaq Debian 8 06-13-2009 09:48 AM
Remove Previous Kernel dale_chip Linux - General 1 02-27-2008 11:20 AM
How to remove/reinstall OR revert X to a previous version? C38368 Linux - Newbie 1 05-26-2004 03:57 AM


All times are GMT -5. The time now is 12:32 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