Bug 795968 - openSUSE:12.2/libnetfilter_queue: Bug
Summary: openSUSE:12.2/libnetfilter_queue: Bug
Status: RESOLVED INVALID
: 940896 964612 1089831 1089905 1089906 1089907 1089908 1089909 1089910 1089911 1169684 1214172 1218411 (view as bug list)
Alias: None
Product: openSUSE.org
Classification: openSUSE
Component: 3rd party software (show other bugs)
Version: unspecified
Hardware: x86-64 openSUSE 12.2
: P5 - None : Critical (vote)
Target Milestone: ---
Assignee: Jan Engelhardt
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-27 09:34 UTC by Blask Wang
Modified: 2023-12-27 14:35 UTC (History)
6 users (show)

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blask Wang 2012-12-27 09:34:12 UTC
why do you guys write the spec file   "%configure --disable-static --includedir=%_includedir/%name-%version" with _includedir/%name-%version
!!!!!!!!!!!
the devel packages of netfilter series can't be used at all !!!!!!!!!!!
the header file can't find the header file which they have included !!!!
as well as the _libdir  !!!!!!!!!
why not just left the includedir  as default! the "./configure"will do it well enough!!!
this problem happens on all netfilter devel packages
Comment 1 Jan Engelhardt 2012-12-27 09:50:57 UTC
It is there to detect when downstream users fail to use the result from pkgconfig.
Comment 2 Blask Wang 2012-12-27 10:01:50 UTC
(In reply to comment #1)
> It is there to detect when downstream users fail to use the result from
> pkgconfig.

So,It is right?but I just program with libnetfilter-queue,and include the <libnetfilter_queue-1.0.1/libnetfilter_queue/libnetfilter_queue.h>
it has #include <libnfnetlink/libnfnetlink.h>;but the libnfnetlink.h is in /usr/include/libnfnetlink-1.0.0+git35/libnfnetlink/
Comment 3 Jan Engelhardt 2012-12-27 10:09:40 UTC
Users of the library (and that includes further libraries) are to use pkgconfig to determine the CPPFLAGS and LIBS of libnetfilter_queue as well as other packages. For autotools, use a recipe like

 #configure.ac
 PKG_CHECK_MODULES([libnetfilter_queue], [libnetfilter_queue >= 1.0])

 #Makefile.am
 AM_CPPFLAGS = ${libnetfilter_queue_CFLAGS}
 bin_PROGRAMS = myprog
 myprog_LDADD = ${libnetfilter_queue_LIBS}

For other build systems (like cmake), see their documentation on how to integrate pkgconfig.
Because the CPPFLAGS as obtained via pkgconfig contain an -I flag with the correct location, the appropriate include line is in all cases

 #include <libnetfilter_queue/libnetfilter_queue.h>
Comment 4 Blask Wang 2012-12-27 10:13:32 UTC
(In reply to comment #3)
> Users of the library (and that includes further libraries) are to use pkgconfig
> to determine the CPPFLAGS and LIBS of libnetfilter_queue as well as other
> packages. For autotools, use a recipe like
> 
>  #configure.ac
>  PKG_CHECK_MODULES([libnetfilter_queue], [libnetfilter_queue >= 1.0])
> 
>  #Makefile.am
>  AM_CPPFLAGS = ${libnetfilter_queue_CFLAGS}
>  bin_PROGRAMS = myprog
>  myprog_LDADD = ${libnetfilter_queue_LIBS}
> 
> For other build systems (like cmake), see their documentation on how to
> integrate pkgconfig.
> Because the CPPFLAGS as obtained via pkgconfig contain an -I flag with the
> correct location, the appropriate include line is in all cases
> 
>  #include <libnetfilter_queue/libnetfilter_queue.h>

Thank you~ :D, I will go and learn those,Sorry for waste your time.
Comment 5 Jan Engelhardt 2015-08-07 09:30:48 UTC
*** Bug 940896 has been marked as a duplicate of this bug. ***
Comment 6 Jan Engelhardt 2016-02-02 10:17:48 UTC
*** Bug 964612 has been marked as a duplicate of this bug. ***
Comment 7 Greg Freemyer 2016-10-08 15:29:27 UTC
I know this is closed, but Suricata 3.1.2 is now using these same packages.

The "fix" was to use the correct configure statement:

%configure --enable-nfqueue \
           --with-libnetfilter_queue-includes=`pkg-config libnetfilter_queue --variable=includedir` \
           --with-libnetfilter_log-includes=`pkg-config libnetfilter_log --variable=includedir` \
           --with-libnfnetlink-includes=`pkg-config libnfnetlink --variable=includedir` \
           --enable-prelude \
           --enable-gccprotect \
           --enable-old-barnyard2 \
           --enable-non-bundled-htp \
           --enable-geoip \
           --enable-lua \
           --enable-hiredis
Comment 8 Mikhail Kasimov 2016-10-08 16:42:38 UTC
(In reply to Greg Freemyer from comment #7)
> I know this is closed, but Suricata 3.1.2 is now using these same packages.
> 
> The "fix" was to use the correct configure statement:
> 
> %configure --enable-nfqueue \
>            --with-libnetfilter_queue-includes=`pkg-config libnetfilter_queue
> --variable=includedir` \
>            --with-libnetfilter_log-includes=`pkg-config libnetfilter_log
> --variable=includedir` \
>            --with-libnfnetlink-includes=`pkg-config libnfnetlink
> --variable=includedir` \
>            --enable-prelude \
>            --enable-gccprotect \
>            --enable-old-barnyard2 \
>            --enable-non-bundled-htp \
>            --enable-geoip \
>            --enable-lua \
>            --enable-hiredis

[1] https://redmine.openinfosecfoundation.org/projects/suricata/wiki/OpenSuse_Installation
[2] https://redmine.openinfosecfoundation.org/issues/1525
[3] https://redmine.openinfosecfoundation.org/issues/1687
[4] https://github.com/inliniac/suricata/pull/2147
Comment 9 Greg Freemyer 2016-10-08 18:48:44 UTC
From: [1] https://redmine.openinfosecfoundation.org/projects/suricata/wiki/OpenSuse_Installation

--
CPPFLAGS="-I/usr/include/libnetfilter_queue-1.0.2 -I/usr/include/libnfnetlink-1.0.1" ./configure \
    --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-nfqueue --enable-lua
--

Not exactly portable, nor future proof.  What happens when v1.0.2 is updated to v1.0.3, etc.

Some other links imply Suricata itself is now using pkg-config in the autotools logic to get the -I parameter, but without the explicit parameters passed to ./configure, I still got errors.

If there is a better way to address this that doesn't use hardcoded paths, I'd appreciate knowing.  I hope to submit suricata to factory in the not too distant future.

FYI: I assume hardcoded paths would be rejected in a SR to facotry.
Comment 10 Jan Engelhardt 2016-10-08 19:56:45 UTC
Well, anywhere you see a hardcoded path you can mostly substitute $(pkg-config libnetfilter_foo --cflags).
Comment 11 Mikhail Kasimov 2016-10-08 20:07:15 UTC
> Some other links imply Suricata itself is now using pkg-config in the
> autotools logic to get the -I parameter, but without the explicit parameters
> passed to ./configure, I still got errors.

Can you, please, file your error-reports on https://redmine.openinfosecfoundation.org/ ? It's really interesting to make Suricata installation easy on openSUSE, but there's one unpleasant moment, when everybody waits other side to make the fist step.
Comment 12 Mikhail Kasimov 2016-10-08 20:08:59 UTC
(In reply to Mikhail Kasimov from comment #11)
> > Some other links imply Suricata itself is now using pkg-config in the
> > autotools logic to get the -I parameter, but without the explicit parameters
> > passed to ./configure, I still got errors.
> 
> Can you, please, file your error-reports on
> https://redmine.openinfosecfoundation.org/ ? It's really interesting to make
> Suricata installation easy on openSUSE, but there's one unpleasant moment,
> when everybody waits other side to make the fist step.

first* :)
Comment 13 Greg Freemyer 2016-10-09 14:25:40 UTC
(In reply to Mikhail Kasimov from comment #12)
> (In reply to Mikhail Kasimov from comment #11)
> > > Some other links imply Suricata itself is now using pkg-config in the
> > > autotools logic to get the -I parameter, but without the explicit parameters
> > > passed to ./configure, I still got errors.
> > 
> > Can you, please, file your error-reports on
> > https://redmine.openinfosecfoundation.org/ ? It's really interesting to make
> > Suricata installation easy on openSUSE, but there's one unpleasant moment,
> > when everybody waits other side to make the fist step.
> 
> first* :)

Done

See https://redmine.openinfosecfoundation.org/issues/1525#note-22 where I told them the original problem continues.
Comment 14 Mikhail Kasimov 2016-10-09 14:29:49 UTC
(In reply to Greg Freemyer from comment #13)
> (In reply to Mikhail Kasimov from comment #12)
> > (In reply to Mikhail Kasimov from comment #11)
> > > > Some other links imply Suricata itself is now using pkg-config in the
> > > > autotools logic to get the -I parameter, but without the explicit parameters
> > > > passed to ./configure, I still got errors.
> > > 
> > > Can you, please, file your error-reports on
> > > https://redmine.openinfosecfoundation.org/ ? It's really interesting to make
> > > Suricata installation easy on openSUSE, but there's one unpleasant moment,
> > > when everybody waits other side to make the fist step.
> > 
> > first* :)
> 
> Done
> 
> See https://redmine.openinfosecfoundation.org/issues/1525#note-22 where I
> told them the original problem continues.

Yes, I've got message about Suricata 1525, thanks. Waiting for Victor's reaction...
Comment 15 Greg Freemyer 2016-10-09 14:42:55 UTC
(In reply to Jan Engelhardt from comment #10)
> Well, anywhere you see a hardcoded path you can mostly substitute
> $(pkg-config libnetfilter_foo --cflags).

Jan,

Since you're a factory reviewer, do you think it is better to directly modify CPPFLAGS as they do in the Suricata howto:

--
CPPFLAGS="-I/usr/include/libnetfilter_queue-1.0.2 -I/usr/include/libnfnetlink-1.0.1" ./configure \
    --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-nfqueue --enable-lua
--

vs passing it in via the configure statement as security:monitoring/suricata is doing now:

%configure --enable-nfqueue \
           --with-libnetfilter_queue-includes=`pkg-config libnetfilter_queue --variable=includedir` \
           --with-libnetfilter_log-includes=`pkg-config libnetfilter_log --variable=includedir` \
           --with-libnfnetlink-includes=`pkg-config libnfnetlink --variable=includedir` \
           --enable-prelude \
           --enable-gccprotect \
           --enable-old-barnyard2 \
           --enable-non-bundled-htp \
           --enable-geoip \
           --enable-lua \
           --enable-hiredis

I don't see any reason to prefer one over the other.
Comment 16 Jan Engelhardt 2016-10-09 14:57:00 UTC
The --with-xxx=... thing in suricata.spec is the optically and technically most pleasing one. Nothing needs to be done here.
Comment 17 Jan Engelhardt 2018-04-18 08:30:08 UTC
*** Bug 1089831 has been marked as a duplicate of this bug. ***
Comment 18 Jan Engelhardt 2018-04-18 08:30:19 UTC
*** Bug 1089910 has been marked as a duplicate of this bug. ***
Comment 19 Jan Engelhardt 2018-04-18 12:52:00 UTC
*** Bug 1089905 has been marked as a duplicate of this bug. ***
Comment 20 Jan Engelhardt 2018-04-18 12:52:01 UTC
*** Bug 1089906 has been marked as a duplicate of this bug. ***
Comment 21 Jan Engelhardt 2018-04-18 12:52:02 UTC
*** Bug 1089907 has been marked as a duplicate of this bug. ***
Comment 22 Jan Engelhardt 2018-04-18 12:52:03 UTC
*** Bug 1089908 has been marked as a duplicate of this bug. ***
Comment 23 Jan Engelhardt 2018-04-18 12:52:04 UTC
*** Bug 1089909 has been marked as a duplicate of this bug. ***
Comment 24 Jan Engelhardt 2020-04-16 21:27:32 UTC
*** Bug 1169684 has been marked as a duplicate of this bug. ***
Comment 25 Jan Engelhardt 2020-04-16 22:47:05 UTC
*** Bug 1169684 has been marked as a duplicate of this bug. ***
Comment 26 Torsten Duwe 2020-05-26 11:50:20 UTC
*** Bug 1089911 has been marked as a duplicate of this bug. ***
Comment 27 Andreas Stieger 2023-08-11 07:52:49 UTC
*** Bug 1214172 has been marked as a duplicate of this bug. ***
Comment 28 Jan Engelhardt 2023-12-27 10:55:19 UTC
*** Bug 1218411 has been marked as a duplicate of this bug. ***