[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using root privileges to build a package



El 14/1/20 a les 10:54, Andrey Rahmatullin ha escrit:
> On Tue, Jan 14, 2020 at 10:45:02AM +0100, Leopold Palomo-Avellaneda wrote:
>>>> I'm working with a package (octomap) that is composed by two libraries
>>>> depending on another one built in the same package.
>>>>
>>>> The question is that to build that two libraries correctly firstly the library
>>>> that they depend must be build and _installed_. It's the _only_ way that I have
>>>> found without patched all upstream.
>>> Make two source packages or patch it so that it can use the library
>>> without installing it.
>>>
>>>> Please, someone can tell me how can I put in a d/rules a "make install" to /usr
>>>> that works?
>>> The package build process should NEVER do such things.
>>>
>>
>> well, I don't agree with you position. However I have to admit that I'm just a
>> simple DM and not a DD, so my position could be weak.
> Sorry, are you saying you think it's fine for a package build process to
> modify the build host system?

just to install some files and yes, I understand that it shouldn't.

>> But, it's difficult to me understand why I should make a complicate process
>> decoupling a package, patched and so on if just with one make install should be
>> enough.
> Because the package build process must not modify the build host system.

yes, I agree.

>> Reading dpkg documentation and policy 4.9.2 [1] I understand that this step is
>> allowed and can be done.
> Nothing in there says it's allowed. 
> https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules
> even explicitly says "Required targets must not attempt to write outside
> of the unpacked source package tree.".

but, in  rootless-builds.txt specify that:

 When "Rules-Requires-Root" is set to <implementations-keywords>, the
builder (i.e. whatever is executing debian/rules) will expose an interface that
is used to run a command under (fake)root via the "Gain Root API".

and in the section "Implementation provided keywords"

debhelper/upstream-make-install: The dh_auto_install command will run the
"install" target from the upstream's Makefile under (fake)root (for the
"makefile" build system or one derived from it).


that's what I want: run dh_auto_install target from the upstream's Makefile
under root.

and in "Common cases"

Upstream installation insists on "sudo make install"-like behaviour.    => Use
dpkg/target-subcommand or debhelper/upstream-make-install.


I'm working on a pbuilder, so I create it, build a package an destroy it, no
problem if the env is modified. I suppose that we should avoid that someone
could make a rm -rf / in a pre install of a package.

If it's possible, then I will evaluate an alternative.

Best regards,

Leopold

-- 
--
Linux User 152692     GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: