[milters] Archive

Lists Index Date Thread Search

Article: 402
From: Robert Kirkley -X (rkirkley - Coyote Creek Consulting at Cisco)
Date: 2010-04-01 11:30:10 -0400
Subject: RE: Error building libsnert 1.73.17 on RHEL 5.3

Actually I wasn't looking far enough up.  The failure came from the
sqlite3 build, and without sqlite3 the libsnert failed.  I couldn't get
the provided sqlite3 to build no matter what, so I went looking for an
RPM.  There was none for this version, so I followed these steps to get
one:

Grab the latest RHEL 5 src.rpm of sqlite3:
# wget
http://archive.linux.duke.edu/pub/centos/5.4/os/SRPMS/sqlite-3.3.6-5.src
.rpm

Next we will rebuild this src.rpm

# rpmbuild --rebuild sqlite-3.3.6-5.src.rpm

Everything from the rebuild should now be under /usr/src/redhat/

Go to /usr/src/redhat/SOURCES , we need to replace the source.tar.gz
with the new source

# cd /usr/src/redhat/SOURCES
# wget http://www.sqlite.org/sqlite-3.6.23.1.tar.gz

Get rid of the old source stuff that came with the src.rpm

# rm sqlite-3.3.6-opcodes.patch
# rm sqlite-3.3.6.tar.gz

Now move over to the /usr/src/redhat/SPECS directory , we need to modify
the .spec, I think these were the lines I modified (basically update the
version so it can find your new source tar.gz and remove any of the
patching lines)

Version: 3.6.23.1
Release: 0
#%patch0 -p1 -b .opcode

NOTE that if you are using a different version than sqlite-3.6.23.1
update that copied spec to match your source you downloaded from sqlite

First build i386 rpm

# rpmbuild --target i386 -ba sqlite.spec

Next build x86_64 rpm

# rpmbuild -ba sqlite.spec

Now update/install i386 rpms

# rpm -Uvh /usr/src/redhat/RPMS/i386/sqlite-3.6.23.1-0.i386.rpm
# rpm -Uvh /usr/src/redhat/RPMS/i386/sqlite-devel-3.6.23.1-0.i386.rpm

Now update/install x86_64 rpms

# rpm -Uvh /usr/src/redhat/RPMS/x86_64/sqlite-3.6.23.1-0.x86_64.rpm
# rpm -Uvh
/usr/src/redhat/RPMS/x86_64/sqlite-devel-3.6.23.1-0.x86_64.rpm

Prior to building we need to copy over a source file from the rpm
building process (this is necessary because libsnert build still looks
for this file and the rpm install doesn't place it in our /usr/lib path)

# cp /usr/src/redhat/BUILD/sqlite-3.6.23.1/.libs/libsqlite3.a
/usr/lib64/
# cp /usr/src/redhat/BUILD/sqlite-3.6.23.1/.libs/libsqlite3.a /usr/lib/

Now we move to the libSnert directory to make and build

# cd (wherever you extracted this)com/snert/src/lib
# ./configure --with-sqlite3=/usr
# make build

You should be good to go now, just use the --with-sqlite3=/usr for your
configure of libsnert and any other milters you configure.


I'm not sure if anyone else on RHEL 5.x had my problems, but this worked
for me.

Robert



-----Original Message-----
From: milters@milter.info [mailto:milters@milter.info] On Behalf Of
Robert Kirkley -X (rkirkley - Coyote Creek Consulting at Cisco)
Sent: Tuesday, March 30, 2010 11:35 AM
To: milters@milter.info
Subject: [milters] Error building libsnert 1.73.17 on RHEL 5.3

System:

Red Hat Enterprise Linux Server release 5.3 (Tikanga)
2.6.18-128.1.14.el5 #1 SMP Mon Jun 1 15:52:58 EDT 2009 x86_64 x86_64
x86_64 GNU/Linux
db4-devel-4.3.29-9
db4-4.3.29-9
sendmail-8.13.8-2.el5
sendmail-devel-8.13.8-2.el5


Configure seemed to go OK:

LibSnert/1.73.17
Copyright 1996, 2010 by Anthony Howe. All rights reserved.

  Platform............: Linux gcc
  Berkeley DB.........: 4.3 -ldb-4.3
  POSIX Threads.......: yes yes
  SQLite3.............: yes
  Sendmail libmilter..: yes
  Semaphore API.......: SYSTEMV_API
  Shared Memory API...: SYSTEMV_API
  CFLAGS..............: -I/usr/include/db4
-I/opt/miltertesting/org/sqlite/include -D_REENTRANT -O2 -Wall -m64
-I${top_srcdir}/../../include 
  LDFLAGS.............: -L/opt/miltertesting/org/sqlite/lib -m64
-L${top_srcdir}/../../lib 
  LIBS................: -lpthread -ldl 



The make build fails at kvm.c part:

***************************************************************
==> /opt/miltertesting/com/snert/src/lib/type
***************************************************************

gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Object.o -c Object.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Data.o -c Data.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Integer.o -c
Integer.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Decimal.o -c
Decimal.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Hash.o -c Hash.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Vector.o -c Vector.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o queue.o -c queue.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o Text.o -c Text.c
gcc  -I/usr/include/db4 -I/opt/miltertesting/org/sqlite/include
-D_REENTRANT -O2 -Wall -m64 -I../../../include  -o kvm.o -c kvm.c
kvm.c: In function 'kvm_check_socket':
kvm.c:1921: warning: dereferencing type-punned pointer will break
strict-aliasing rules
kvm.c: In function 'kvm_open_socket':
kvm.c:2333: warning: dereferencing type-punned pointer will break
strict-aliasing rules
kvm.c:2743:3: error: #error "SQLite3 version 3.3.9 or better required."
kvm.c: In function 'kvm_prepare_sql':
kvm.c:3206: warning: implicit declaration of function
'sqlite3_prepare_v2'
make[1]: *** [kvm.o] Error 1
make[1]: Leaving directory `/opt/miltertesting/com/snert/src/lib/type'
/bin/sh: line 0: cd: util: No such file or directory
/bin/sh: line 0: cd: io: No such file or directory
/bin/sh: line 0: cd: net: No such file or directory
/bin/sh: line 0: cd: mail: No such file or directory
/bin/sh: line 0: cd: sys: No such file or directory
/bin/sh: line 0: cd: tools: No such file or directory
make: *** [build] Error 1


Any ideas?


Robert Kirkley
Systems Engineer
Coyote Creek Consulting at Cisco





Lists Index Date Thread Search