[CRIU] [PATCH 4/4] Makefiles: add install target

Kir Kolyshkin kir at openvz.org
Thu May 2 06:13:49 EDT 2013


On 05/02/2013 03:02 AM, Vasily Averin wrote:
> On 05/02/2013 11:58 AM, Kirill Kolyshkin wrote:
>> I have seen software that has an uninstall target. But it is dangerous and unreliable, so I didn't implemented it. Install is mostly used by packagers so you can have something like
>>
>> %install
>> make DESTDIR=$RPM_BUILD_DIR install
>>
>> And for uninstall -- if you need uninstall, please use some package system.
> But what if I already have the same binary installed by distributive?
> we'll rewrite it, then system update will re-write our again...
> IMHO install and uninstall should work with /usr/local/bin directories by default
> Am I wrong may be?

Right. I will redo this patches to have PREFIX=/usr/local defined.

>   
>> --
>> sent from android
>>
>> Vasily Averin <vvs at parallels.com> wrote:
>>
>>
>> Kir,
>> could you please clarify, is uninstall required too?
>>
>> Thank you,
>>          Vasily Averin
>>
>> On 05/01/2013 12:25 AM, Kir Kolyshkin wrote:
>>> Note to package maintainers: yes we do support DESTDIR ;)
>>>
>>> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
>>> ---
>>>   Documentation/Makefile | 11 ++++++++++-
>>>   Makefile               | 13 +++++++++++++
>>>   2 files changed, 23 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/Makefile b/Documentation/Makefile
>>> index d856e18..76691e4 100644
>>> --- a/Documentation/Makefile
>>> +++ b/Documentation/Makefile
>>> @@ -7,6 +7,10 @@ XMLTO                := xmlto
>>>   SRC          += crtools.txt
>>>   MANS         := $(patsubst %.txt,%.1,$(SRC))
>>>
>>> +# Installation paths
>>> +MANDIR               := /usr/share/man
>>> +MAN1DIR              := $(MANDIR)/man1
>>> +
>>>   all: $(MANS)
>>>
>>>   %.1: %.txt
>>> @@ -19,4 +23,9 @@ clean:
>>>        $(Q) rm -f ./*.xml
>>>        $(Q) rm -f ./*.1
>>>
>>> -.PHONY: clean
>>> +install: $(MANS)
>>> +     $(E) "  INSTALL " $(MANS)
>>> +     $(Q) mkdir -p $(DESTDIR)$(MAN1DIR)
>>> +     $(Q) install $(MANS) $(DESTDIR)$(MAN1DIR)
>>> +
>>> +.PHONY: clean install
>>> diff --git a/Makefile b/Makefile
>>> index 5cc5fb7..29bf1c0 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -32,6 +32,9 @@ SH          := bash
>>>   MAKE         := make
>>>   OBJCOPY              := objcopy
>>>
>>> +# Installation paths
>>> +SBINDIR              := /usr/sbin
>>> +
>>>   #
>>>   # Fetch ARCH from the uname if not yet set
>>>   #
>>> @@ -203,6 +206,16 @@ criu-$(CRTOOLSVERSION).tar.bz2:
>>>                v$(CRTOOLSVERSION) | bzip2 > $@
>>>   .PHONY: dist tar
>>>
>>> +install: $(PROGRAM) install-man
>>> +     $(E) "  INSTALL " $(PROGRAM)
>>> +     $(Q) mkdir -p $(DESTDIR)$(SBINDIR)
>>> +     $(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR)
>>> +
>>> +install-man:
>>> +     $(Q) $(MAKE) -C Documentation install
>>> +
>>> +.PHONY: install install-man
>>> +
>>>   help:
>>>        $(E) '    Targets:'
>>>        $(E) '      all             - Build all [*] targets'
>>>
>>
>>



More information about the CRIU mailing list