build: Add dev-dep target to install build-required packages

Submitted by Kirill Tkhai on Oct. 31, 2017, 2:25 p.m.

Details

Message ID 150945993075.10609.2924606667041473577.stgit@localhost.localdomain
State New
Series "build: Add dev-dep target to install build-required packages"
Headers show

Commit Message

Kirill Tkhai Oct. 31, 2017, 2:25 p.m.
This allows to obtain via a single command the requirements,
need to build and install criu.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 Makefile |    5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/Makefile b/Makefile
index 796cad874..61a6a89b7 100644
--- a/Makefile
+++ b/Makefile
@@ -347,6 +347,11 @@  TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
 	docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
 .PHONY: docker-test
 
+dev-dep:
+	$(Q) test ! -f /etc/redhat-release || \
+		yum install gcc protobuf-devel protobuf-c-devel libnet-devel libnl3-devel libcap-devel asciidoc xmlto
+.PHONY: dev-dep
+
 help:
 	@echo '    Targets:'
 	@echo '      all             - Build all [*] targets'

Comments

Dmitry Safonov Oct. 31, 2017, 3:30 p.m.
2017-10-31 14:25 GMT+00:00 Kirill Tkhai <ktkhai@virtuozzo.com>:
> This allows to obtain via a single command the requirements,
> need to build and install criu.
>
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

There is this scripts/install-debian-pkgs.sh
Can we clean it a bit and make more generic way to install
dev packages for rh/debian/etc?

> ---
>  Makefile |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 796cad874..61a6a89b7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -347,6 +347,11 @@ TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
>         docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
>  .PHONY: docker-test
>
> +dev-dep:
> +       $(Q) test ! -f /etc/redhat-release || \
> +               yum install gcc protobuf-devel protobuf-c-devel libnet-devel libnl3-devel libcap-devel asciidoc xmlto
> +.PHONY: dev-dep

It would be nice to have target name saying `install' or something.
`dep' on the other hand may mean make-file dependency, so
it's better to omit. Maybe `install-dev-pkgs'?
Also, add it to `help' target, please.

> +
>  help:
>         @echo '    Targets:'
>         @echo '      all             - Build all [*] targets'
>
Kirill Tkhai Nov. 1, 2017, 10:28 a.m.
On 31.10.2017 18:30, Dmitry Safonov wrote:
> 2017-10-31 14:25 GMT+00:00 Kirill Tkhai <ktkhai@virtuozzo.com>:
>> This allows to obtain via a single command the requirements,
>> need to build and install criu.
>>
>> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> 
> There is this scripts/install-debian-pkgs.sh
> Can we clean it a bit and make more generic way to install
> dev packages for rh/debian/etc?

We can do this. But I don't know who actually uses it,
and whether this change will break something.

Andrew, could you tell, what is the existing scripts/install-debian-pkgs.sh for
and who does use it?
 
>> ---
>>  Makefile |    5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 796cad874..61a6a89b7 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -347,6 +347,11 @@ TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
>>         docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
>>  .PHONY: docker-test
>>
>> +dev-dep:
>> +       $(Q) test ! -f /etc/redhat-release || \
>> +               yum install gcc protobuf-devel protobuf-c-devel libnet-devel libnl3-devel libcap-devel asciidoc xmlto
>> +.PHONY: dev-dep
> 
> It would be nice to have target name saying `install' or something.
> `dep' on the other hand may mean make-file dependency, so
> it's better to omit. Maybe `install-dev-pkgs'?
> Also, add it to `help' target, please.
> 
>> +
>>  help:
>>         @echo '    Targets:'
>>         @echo '      all             - Build all [*] targets'
>>
>
Andrei Vagin Nov. 1, 2017, 5:59 p.m.
On Wed, Nov 01, 2017 at 01:28:18PM +0300, Kirill Tkhai wrote:
> On 31.10.2017 18:30, Dmitry Safonov wrote:
> > 2017-10-31 14:25 GMT+00:00 Kirill Tkhai <ktkhai@virtuozzo.com>:
> >> This allows to obtain via a single command the requirements,
> >> need to build and install criu.
> >>
> >> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> > 
> > There is this scripts/install-debian-pkgs.sh
> > Can we clean it a bit and make more generic way to install
> > dev packages for rh/debian/etc?
> 
> We can do this. But I don't know who actually uses it,
> and whether this change will break something.

[avagin@laptop criu]$ git log contrib/debian/dev-packages.lst
commit 42cbc9e35880905630f39bacb94315ce581250b6
Author: Mike Rapoport <rppt@linux.vnet.ibm.com>
Date:   Wed Apr 5 11:25:36 2017 +0300

    scripts/install-debian-packages: add libnl-route-3-dev
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>

So it looks like Mike is using it.

As for the second part of your sentence, you can create an ubuntu
container and check your changes.

> 
> Andrew, could you tell, what is the existing scripts/install-debian-pkgs.sh for
> and who does use it?
>  
> >> ---
> >>  Makefile |    5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/Makefile b/Makefile
> >> index 796cad874..61a6a89b7 100644
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -347,6 +347,11 @@ TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
> >>         docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
> >>  .PHONY: docker-test
> >>
> >> +dev-dep:
> >> +       $(Q) test ! -f /etc/redhat-release || \
> >> +               yum install gcc protobuf-devel protobuf-c-devel libnet-devel libnl3-devel libcap-devel asciidoc xmlto
> >> +.PHONY: dev-dep
> > 
> > It would be nice to have target name saying `install' or something.
> > `dep' on the other hand may mean make-file dependency, so
> > it's better to omit. Maybe `install-dev-pkgs'?
> > Also, add it to `help' target, please.
> > 
> >> +
> >>  help:
> >>         @echo '    Targets:'
> >>         @echo '      all             - Build all [*] targets'
> >>
> >
Andrei Vagin Nov. 8, 2017, 8:31 p.m.
On Mon, Nov 06, 2017 at 06:37:52PM +0200, Mike Rapoport wrote:
> On Wed, Nov 01, 2017 at 10:59:24AM -0700, Andrei Vagin wrote:
> > On Wed, Nov 01, 2017 at 01:28:18PM +0300, Kirill Tkhai wrote:
> > > On 31.10.2017 18:30, Dmitry Safonov wrote:
> > > > 2017-10-31 14:25 GMT+00:00 Kirill Tkhai <ktkhai@virtuozzo.com>:
> > > >> This allows to obtain via a single command the requirements,
> > > >> need to build and install criu.
> > > >>
> > > >> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> > > > 
> > > > There is this scripts/install-debian-pkgs.sh
> > > > Can we clean it a bit and make more generic way to install
> > > > dev packages for rh/debian/etc?
> 
> Let's use ansible ;-)
> 
> > > 
> > > We can do this. But I don't know who actually uses it,
> > > and whether this change will break something.
> > 
> > [avagin@laptop criu]$ git log contrib/debian/dev-packages.lst
> > commit 42cbc9e35880905630f39bacb94315ce581250b6
> > Author: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > Date:   Wed Apr 5 11:25:36 2017 +0300
> > 
> >     scripts/install-debian-packages: add libnl-route-3-dev
> >     
> >     Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> >     Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> > 
> > So it looks like Mike is using it.
>  
> I don't mind using a make target as long as it's kept up to date
> 
> > As for the second part of your sentence, you can create an ubuntu
> > container and check your changes.
> > 
> > > 
> > > Andrew, could you tell, what is the existing scripts/install-debian-pkgs.sh for
> > > and who does use it?
> > >  
> > > >> ---
> > > >>  Makefile |    5 +++++
> > > >>  1 file changed, 5 insertions(+)
> > > >>
> > > >> diff --git a/Makefile b/Makefile
> > > >> index 796cad874..61a6a89b7 100644
> > > >> --- a/Makefile
> > > >> +++ b/Makefile
> > > >> @@ -347,6 +347,11 @@ TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
> > > >>         docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
> > > >>  .PHONY: docker-test
> > > >>
> > > >> +dev-dep:
> > > >> +       $(Q) test ! -f /etc/redhat-release || \
> > > >> +               yum install gcc protobuf-devel protobuf-c-devel libnet-devel libnl3-devel libcap-devel asciidoc xmlto
> 
> dnf install?

yum works for rhel

> 
> > > >> +.PHONY: dev-dep
> > > > 
> > > > It would be nice to have target name saying `install' or something.
> > > > `dep' on the other hand may mean make-file dependency, so
> > > > it's better to omit. Maybe `install-dev-pkgs'?
> > > > Also, add it to `help' target, please.
> > > > 
> > > >> +
> > > >>  help:
> > > >>         @echo '    Targets:'
> > > >>         @echo '      all             - Build all [*] targets'
> > > >>
> > > > 
> > 
> 
> -- 
> Sincerely yours,
> Mike.
>