Page 1 of 2
Should I login as root while creating packages?
Posted: 26. Sep 2009, 11:29
by rsamurti
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
Re: Should I login as root while creating packages?
Posted: 26. Sep 2009, 11:40
by gapan
I recommend you use fakeroot, like this:
Code: Select all
fakeroot name.SlackBuild 2>&1 | tee build-name.log
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.
Re: Should I login as root while creating packages?
Posted: 28. Sep 2009, 07:43
by JRD
Or event better :
(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?
Posted: 17. Jan 2015, 14:51
by john256
gapan wrote:I recommend you use fakeroot, like this:
Code: Select all
fakeroot name.Slackbuild 2>&1 | tee build-name.log
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.
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)?
Re: Should I login as root while creating packages?
Posted: 17. Jan 2015, 17:46
by gapan
Yes.
Re: Should I login as root while creating packages?
Posted: 25. Jan 2015, 13:02
by john256
I have tried to build a newer git using Pat's slackBuild from
here, but when I run it as recommended:
Code: Select all
fakeroot git.Slackbuild 2>&1 | tee git-1.9.0-build.log
I get the following error:
Code: Select all
/usr/bin/fakeroot: line 178: git.Slackbuild: command not found
What am I doing wrong?
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?
Posted: 25. Jan 2015, 13:55
by gapan
Re: Should I login as root while creating packages?
Posted: 25. Jan 2015, 19:18
by john256
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?
Posted: 25. Jan 2015, 20:50
by gapan
Isn't the current dir in your $PATH?
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?
Posted: 25. Jan 2015, 20:55
by john256
It isn't on the $PATH, but adding "./" as you suggested brought up the same error message.