Should I login as root while creating packages?
Should I login as root while creating packages?
Hello,
Please pardon me if this question sounds very silly.
I have a basic doubt. To create packages, I need to use the command makepkg which is not available when I have logged in as a non-root user. So, should I always login as root while creating packages or is there any other way to do it?
Thanks for your help.
Anand
Please pardon me if this question sounds very silly.
I have a basic doubt. To create packages, I need to use the command makepkg which is not available when I have logged in as a non-root user. So, should I always login as root while creating packages or is there any other way to do it?
Thanks for your help.
Anand
Re: Should I login as root while creating packages?
I recommend you use fakeroot, like this:
so you can also have a build log. In that case, you should specify makepkg with a full path in the Slackbuild:
Using fakeroot has the huge advantage that if something tries to install in you system instead of the packaging directory, you'll get an error and there is no chance that it will slip out.
Code: Select all
fakeroot name.SlackBuild 2>&1 | tee build-name.log
Code: Select all
/sbin/makepkg -l y -c n ...
Re: Should I login as root while creating packages?
Or event better :
(OLDPATH=$PATH; PATH=/sbin:/usr/sbin/:$PATH; fakeroot name.Slackbuild 2>&1 | tee build-name.log; PATH=$OLDPATH; unset OLDPATH)
(OLDPATH=$PATH; PATH=/sbin:/usr/sbin/:$PATH; fakeroot name.Slackbuild 2>&1 | tee build-name.log; PATH=$OLDPATH; unset OLDPATH)
Re: Should I login as root while creating packages?
Sorry for picking up this ancient thread, but I'd like to know - is this still the recommended way building packages (apart from using sourcery)?gapan wrote:I recommend you use fakeroot, like this:so you can also have a build log. In that case, you should specify makepkg with a full path in the Slackbuild:Code: Select all
fakeroot name.Slackbuild 2>&1 | tee build-name.log
Using fakeroot has the huge advantage that if something tries to install in you system instead of the packaging directory, you'll get an error and there is no chance that it will slip out.Code: Select all
/sbin/makepkg -l y -c n ...
Re: Should I login as root while creating packages?
I have tried to build a newer git using Pat's slackBuild from here, but when I run it as recommended:
I get the following error:
What am I doing wrong?
Note that I have also used also JRD's suggestion from this thread, but got the same error.
Code: Select all
fakeroot git.Slackbuild 2>&1 | tee git-1.9.0-build.log
Code: Select all
/usr/bin/fakeroot: line 178: git.Slackbuild: command not found
Note that I have also used also JRD's suggestion from this thread, but got the same error.
Re: Should I login as root while creating packages?
It is:
Code: Select all
-rwxr-xr-x 1 jjbj users 4863 Jan 25 14:52 git.SlackBuild
Re: Should I login as root while creating packages?
Isn't the current dir in your $PATH?
Try:
Try:
Code: Select all
fakeroot ./git.Slackbuild 2>&1 | tee git-1.9.0-build.log
Re: Should I login as root while creating packages?
It isn't on the $PATH, but adding "./" as you suggested brought up the same error message.