Discussion:
problems building conntrack and its dependencies from RPM
Adam Monsen
2007-06-21 22:40:16 UTC
Permalink
I'm having trouble creating RPMs for conntrack (see
http://netfilter.org) for CentOS 4.3. The dependencies for conntrack
are libnfnetlink and libnetfilter_conntrack; I'd like to make RPMs for
these, too.

First I tried manually compiling and installing all three on the
CentOS box. This seemed to work fine. The only change I had to make to
the source was to comment out the line beginning with "URL" in the
pkgconfig ".pc" files (must be a feature of a newer version of
pkgconfig). Here's how I built the sources:

mkdir /tmp/c && cd /tmp/c
tar -xvjf /tmp/libnfnetlink-0.0.25.tar.bz2
pushd libnfnetlink-0.0.25
# manually comment out "URL" line in libnfnetlink.pc.in, then...
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd
tar -xvjf /tmp/libnetfilter_conntrack-0.0.50.tar.bz2
pushd libnetfilter_conntrack-0.0.50
# manually comment out "URL" line in libnetfilter_conntrack.pc.in, then...
PKG_CONFIG_PATH=$HOME/tmp/ctk/lib/pkgconfig \
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd
tar -xvjf /tmp/conntrack-1.00beta2.tar.bz2
pushd conntrack-1.00beta2/
PKG_CONFIG_PATH=$HOME/tmp/ctk/lib/pkgconfig \
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd


Some information about this CentOS 4.3 build system, in case that helps:
Linux kernel 2.6.14.3 (SMP)
glibc-2.3.4-2.19
gcc-3.4.5-2
rpm-4.3.3-13_nonptl

Note that, according to
http://people.netfilter.org/pablo/conntrackd/install.html, 2.6.14 is
NOT considered recent enough to _run_ conntrack, so perhaps I should
not be trying to build conntrack with this old kernel, either. I can't
imagine why that would matter for the build, though.


And now for my attempt at packaging these in RPMs. As a starting point
I used the source RPMs available for Fedora 7.

First I tried building and installing the libnfnetlink dependency.
With the exception of modifying the pkgconfig .pc files by hand,
libnfnetlink builds ok, and libnfnetlink and libnfnetlink-devel both
install ok.

Next I went for libnetfilter_conntrack. This build fails with some
strange errors:

...
callback.c: In function `__callback':
callback.c:12: error: `NFNL_CB_STOP' undeclared (first use in this function)
callback.c:12: error: (Each undeclared identifier is reported only once
callback.c:12: error: for each function it appears in.)
callback.c:20: error: `NFNL_CB_CONTINUE' undeclared (first use in this function)
callback.c:30: warning: passing arg 2 of `__parse_conntrack' from
incompatible pointer type
callback.c:38: error: `NFNL_CB_FAILURE' undeclared (first use in this function)
...

I say strange because (a)this doesn't happen during the "manual"
source build, and (b)these constants are indeed defined in an enum in
/usr/include/libnfnetlink/libnfnetlink.h, which is included of course
included by the libnetfilter_conntrack source code. This error also
only happens when trying to build from RPM on CentOS 4.3. Ugh. Any
ideas?
--
Adam Monsen
Hiren Patel
2007-06-22 09:05:20 UTC
Permalink
my only guess is that the rpm build process may be telling the make
process to look for headers in a different location as apposed to when
building it manually. maybe post a bit of the spec file, maybe post the
%build section.
Post by Adam Monsen
I'm having trouble creating RPMs for conntrack (see
http://netfilter.org) for CentOS 4.3. The dependencies for conntrack
are libnfnetlink and libnetfilter_conntrack; I'd like to make RPMs for
these, too.
First I tried manually compiling and installing all three on the
CentOS box. This seemed to work fine. The only change I had to make to
the source was to comment out the line beginning with "URL" in the
pkgconfig ".pc" files (must be a feature of a newer version of
mkdir /tmp/c && cd /tmp/c
tar -xvjf /tmp/libnfnetlink-0.0.25.tar.bz2
pushd libnfnetlink-0.0.25
# manually comment out "URL" line in libnfnetlink.pc.in, then...
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd
tar -xvjf /tmp/libnetfilter_conntrack-0.0.50.tar.bz2
pushd libnetfilter_conntrack-0.0.50
# manually comment out "URL" line in libnetfilter_conntrack.pc.in, then...
PKG_CONFIG_PATH=$HOME/tmp/ctk/lib/pkgconfig \
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd
tar -xvjf /tmp/conntrack-1.00beta2.tar.bz2
pushd conntrack-1.00beta2/
PKG_CONFIG_PATH=$HOME/tmp/ctk/lib/pkgconfig \
./configure --prefix=$HOME/tmp/ctk && make -j4 && make install
popd
Linux kernel 2.6.14.3 (SMP)
glibc-2.3.4-2.19
gcc-3.4.5-2
rpm-4.3.3-13_nonptl
Note that, according to
http://people.netfilter.org/pablo/conntrackd/install.html, 2.6.14 is
NOT considered recent enough to _run_ conntrack, so perhaps I should
not be trying to build conntrack with this old kernel, either. I can't
imagine why that would matter for the build, though.
And now for my attempt at packaging these in RPMs. As a starting point
I used the source RPMs available for Fedora 7.
First I tried building and installing the libnfnetlink dependency.
With the exception of modifying the pkgconfig .pc files by hand,
libnfnetlink builds ok, and libnfnetlink and libnfnetlink-devel both
install ok.
Next I went for libnetfilter_conntrack. This build fails with some
...
callback.c:12: error: `NFNL_CB_STOP' undeclared (first use in this function)
callback.c:12: error: (Each undeclared identifier is reported only once
callback.c:12: error: for each function it appears in.)
callback.c:20: error: `NFNL_CB_CONTINUE' undeclared (first use in this function)
callback.c:30: warning: passing arg 2 of `__parse_conntrack' from
incompatible pointer type
callback.c:38: error: `NFNL_CB_FAILURE' undeclared (first use in this function)
...
I say strange because (a)this doesn't happen during the "manual"
source build, and (b)these constants are indeed defined in an enum in
/usr/include/libnfnetlink/libnfnetlink.h, which is included of course
included by the libnetfilter_conntrack source code. This error also
only happens when trying to build from RPM on CentOS 4.3. Ugh. Any
ideas?
--
Hiren Patel | Ops Specialist | ISS Infrastructure | Telkom
E-Mail: ***@telkom.co.za Office: +27 12 680 3460 | Fax: +27 12 680
3299 | Cell: +27 73 456 7980

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adam Monsen
2007-06-22 13:29:23 UTC
Permalink
Post by Hiren Patel
my only guess is that the rpm build process may be telling the make
process to look for headers in a different location as apposed to when
building it manually. maybe post a bit of the spec file, maybe post the
%build section.
[...]

Here's part of libnfnetlink:
-------------------------8<-------------------------
%prep
%setup -q
cp %{SOURCE1} LICENSE


%build
%configure --disable-static
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
------------------------->8-------------------------

libnetfilter_conntrack:
-------------------------8<-------------------------
%prep
%setup -q

%build
%configure --disable-static --disable-rpath

# kill the rpaths
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
------------------------->8-------------------------

and conntrack:
-------------------------8<-------------------------
%prep
%setup -q -n conntrack-1.00beta2


%build
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';'
------------------------->8-------------------------
--
Adam Monsen
Adam Monsen
2007-06-27 01:10:12 UTC
Permalink
Post by Adam Monsen
I'm having trouble creating RPMs for conntrack (see
http://netfilter.org) for CentOS 4.3. The dependencies for conntrack
are libnfnetlink and libnetfilter_conntrack; I'd like to make RPMs for
these, too.
Got this to work. Here are the specfiles in case it saves anyone else
on CentOS/RHEL/etc. any trouble. I clipped the ChangeLogs, sorry. See
the ChangeLogs in the Fedora 7 RPMs if need be.

Hopefully attachments work on this mailing list.
--
Adam Monsen
Loading...