LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 04-08-2004, 11:35 AM   #1
willwrk4u
LQ Newbie
 
Registered: Apr 2004
Distribution: RedHat 3.0ES
Posts: 2

Rep: Reputation: 0
rebuilding cyrus-sasl src.rpm w/mysql support fails


I'm using Redhat3.0ES and cyrus-sasl-2.1.15-3. Since the mysql support
isn't compiled in on the stock rpm and i want sasl authentication done
from mysql lookus for my smtp server, i installed the src.rpm and edited
the spec file by addeding the following.

--with-mysql=/usr/lib/mysql

i issue rpmbuild -ba cyrus-sasl.spec

and i get the following errors:

mysql.c:60:19: mysql.h: No such file or directory
mysql.c: In function `mysql_auxprop_lookup':
mysql.c:254: `MYSQL' undeclared (first use in this function)
mysql.c:254: (Each undeclared identifier is reported only once
mysql.c:254: for each function it appears in.)
mysql.c:254: syntax error before "mysql"
mysql.c:255: `MYSQL_RES' undeclared (first use in this function)
mysql.c:255: `result' undeclared (first use in this function)
mysql.c:256: `MYSQL_ROW' undeclared (first use in this function)
mysql.c:256: syntax error before "row"
mysql.c:329: warning: implicit declaration of function `mysql_init'
mysql.c:329: `mysql' undeclared (first use in this function)
mysql.c:329: warning: comparison between pointer and integer
mysql.c:335: `sock' undeclared (first use in this function)
mysql.c:335: warning: implicit declaration of function
`mysql_real_connect'
mysql.c:350: warning: implicit declaration of function
`mysql_real_escape_string'
mysql.c:353: warning: implicit declaration of function `mysql_select_db'
mysql.c:394: warning: implicit declaration of function `mysql_query'
mysql.c:395: warning: implicit declaration of function
`mysql_store_result'
mysql.c:401: warning: implicit declaration of function
`mysql_affected_rows'
mysql.c:405: warning: implicit declaration of function
`mysql_free_result'
mysql.c:416: `row' undeclared (first use in this function)
mysql.c:416: warning: implicit declaration of function `mysql_fetch_row'
mysql.c:431: warning: implicit declaration of function `mysql_close'
make[2]: *** [mysql.lo] Error 1
make[2]: Leaving directory
`/home/apmartinez/rpmbuilds/BUILD/cyrus-sasl-2.1.15/cyrus-sasl-2.1.15/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/apmartinez/rpmbuilds/BUILD/cyrus-sasl-2.1.15/cyrus-sasl-2.1.15'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.70386 (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.70386 (%build)

mysql.h is located in the /usr/include/ directory so i changed the line
in cyrus-sasl.spec to the following:


--with-mysql=/usr/include/mysql

I then get the following error:

checking for mysql_select_db in -lmysqlclient... no
configure: error: MYSQL libarary mysqlclient not found
error: Bad exit status from /var/tmp/rpm-tmp.22079 (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.22079 (%build)

I have essentially two questions. I really need the mysql support so
just wondering what i can do to make it build properly. Secondly, i
really don't need some other of the features like saslauthd but when i
specified :
--without-saslauthd \
--without-pwcheck \

I get the following error:
RPM build errors:
File not found: /var/tmp/cyrus-sasl-root/usr/sbin/saslauthd
how can i resolve this giving the attached .spec file?

Thanks in advance,

Aaron Martinez

I have included the default cyrus-sasl.spec file below, however the URL's have been altered since i don't have 5 posts as of yet.


%define cs1_version 1.5.28
%define _plugindir %{_libdir}/sasl
%define _plugindir2 %{_libdir}/sasl2

Summary: The Cyrus SASL library.
Name: cyrus-sasl
Version: 2.1.15
Release: 3
License: Freely Distributable
Group: System Environment/Libraries
Source0:
tp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz
Source1:
tp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz.sig
Source2:
tp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{cs1_version}.tar.gz
Source3:
tp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{cs1_version}.tar.gz.sig
Source4: saslauthd.init
Source5: README.RPM
ttp://asg.web.cmu.edu/sasl/sasl-library.html
Patch0: cyrus-sasl-1.5.24-rpath.patch
Patch1: cyrus-sasl-1.5.28-autoconf25.patch
Patch2: cyrus-sasl-1.5.28-automake17.patch
Patch3: cyrus-sasl-2.1.7-gdbm.patch
Patch4: cyrus-sasl-2.1.10-des.patch
Patch5: cyrus-sasl-2.1.14-automake17.patch
Patch6: cyrus-sasl-2.1.13-rpath.patch
Patch7: cyrus-sasl-2.1.15-libtool15.patch
Patch8: cyrus-sasl-2.1.14-plugin.patch
Buildroot: %{_tmppath}/%{name}-root
BuildPrereq: autoconf213, automake15, libtool
# Note: berkeley db for sasl2, gdbm for sasl1.
BuildPrereq: db4-devel, gdbm-devel, krb5-devel >= 1.2, openssl-devel,
pam-devel
BuildPrereq: pkgconfig
Prereq: /sbin/ldconfig, chkconfig, /sbin/service

%description
The %{name} package contains the Cyrus implementation of SASL.
SASL is the Simple Authentication and Security Layer, a method for
adding authentication support to connection-based protocols.

%package devel
Requires: %{name} = %{version}-%{release}
Group: Development/Libraries
Summary: Files needed for developing applications with Cyrus SASL.

%description devel
The %{name}-devel package contains files needed for developing and
compiling applications which use the Cyrus SASL library.

%package gssapi
Requires: %{name} = %{version}-%{release}
Group: System Environment/Libraries
Summary: GSSAPI support for Cyrus SASL.

%description gssapi
The %{name}-gssapi package contains the Cyrus SASL plugins which
support GSSAPI authentication. GSSAPI is commonly used for Kerberos
authentication.

%package plain
Requires: %{name} = %{version}-%{release}
Group: System Environment/Libraries
Summary: PLAIN and LOGIN support for Cyrus SASL.

%description plain
The %{name}-plain package contains the Cyrus SASL plugins which support
PLAIN and LOGIN authentication schemes.

%package md5
Requires: %{name} = %{version}-%{release}
Group: System Environment/Libraries
Summary: CRAM-MD5 and DIGEST-MD5 support for Cyrus SASL.

%description md5
The %{name}-md5 package contains the Cyrus SASL plugins which support
CRAM-MD5 and DIGEST-MD5 authentication schemes.

%prep
%setup -q -c -a 2
pushd cyrus-sasl-%{cs1_version}
%patch0 -p1 -b .rpath
%patch1 -p1 -b .autoconf25
%patch2 -p1 -b .automake17
libtoolize -f -c
aclocal -I config -I cmulocal
automake -a -c -f
autoheader
autoconf -f
popd

pushd cyrus-sasl-%{version}
%patch3 -p1 -b .gdbm
%patch4 -p1 -b .des
%patch5 -p1 -b .automake17
%patch6 -p1 -b .rpath
%patch7 -p1 -b .libtool15
%patch8 -p1 -b .plugin
ln -s ../plugins/plugin_common.c lib/
# Remove the mismatching AC_PROG_LIBTOOL definition and its ltconfig.
> acinclude.m4
rm config/ltconfig
libtoolize -f -c
aclocal -I config -I cmulocal
automake -a -c -f
autoheader
autoconf -f

pushd saslauthd
rm config/ltconfig
libtoolize -f -c
aclocal -I config -I ../cmulocal -I ../config
automake -a -c -f
autoheader
autoconf -f
popd
popd

# Sort of merge the docs.
mkdir cyrus-sasl-%{version}/%{cs1_version}
mkdir cyrus-sasl-%{version}/%{cs1_version}-devel
cp %{name}-%{cs1_version}/{AUTHORS,COPYING,NEWS,README,doc/*.html}
cyrus-sasl-%{version}/%{cs1_version}
cp %{name}-%{cs1_version}/doc/*.txt
cyrus-sasl-%{version}/%{cs1_version}-devel
# Remove duplicate RFCs.
pushd cyrus-sasl-%{version}/%{cs1_version}-devel
for file in * ; do
if [ -f ../doc/${file} ] ; then
rm -f ${file}
fi
done
popd

%build
krb5_prefix=`krb5-config --prefix`
if test x$krb5_prefix = x%{_prefix} ; then
krb5_prefix=
else
CPPFLAGS="-I${krb5_prefix}/include"; export CPPFLAGS
CFLAGS="-I${krb5_prefix}/include"; export CFLAGS
LDFLAGS="-L${krb5_prefix}/%{_lib}"; export LDFLAGS
fi

pushd cyrus-sasl-%{cs1_version}
%configure \
--enable-static --enable-staticdlopen --with-pic --enable-shared
\
--with-plugindir=%{_plugindir} \
--disable-krb4 \
--enable-gssapi${krb5_prefix:+=${krb5_prefix}} \
--with-rc4 \
--with-dblib=gdbm \
--enable-anon \
--enable-plain \
--enable-login
make sasldir=%{_plugindir}
popd

pushd cyrus-sasl-%{version}
LIBS="-lcrypt"; export LIBS
%configure \
--enable-static --with-pic --enable-shared --disable-java \
--with-plugindir=%{_plugindir2} \
--disable-krb4 \
--enable-gssapi${krb5_prefix:+=${krb5_prefix}} \
--with-rc4 \
--with-dblib=berkeley \
--with-saslauthd=/var/run/saslauthd --without-pwcheck \
--enable-anon \
--enable-plain \
--enable-login \
--with-mysql=/usr/include/mysql
# --enable-auth-sasldb -- EXPERIMENTAL
make sasldir=%{_plugindir2}
popd

%install
test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
pushd cyrus-sasl-%{cs1_version}
%makeinstall sasldir=$RPM_BUILD_ROOT/%{_plugindir}
install -m755 -d $RPM_BUILD_ROOT%{_bindir}
libtool --mode=install \
install -m755 sample/client $RPM_BUILD_ROOT%{_bindir}/sasl-sample-client
libtool --mode=install \
install -m755 sample/server $RPM_BUILD_ROOT%{_bindir}/sasl-sample-server
popd

pushd cyrus-sasl-%{version}
%makeinstall sasldir=$RPM_BUILD_ROOT/%{_plugindir2}
install -m755 -d $RPM_BUILD_ROOT%{_bindir}

libtool --mode=install \
install -m755 sample/client
$RPM_BUILD_ROOT%{_bindir}/sasl2-sample-client
libtool --mode=install \
install -m755 sample/server
$RPM_BUILD_ROOT%{_bindir}/sasl2-sample-server
libtool --mode=install \
install -m755 utils/dbconverter-2
$RPM_BUILD_ROOT%{_sbindir}/dbconverter-2

# Install the saslauthd man page in the expected location, even if it's
# pre-formatted.
install -m755 -d $RPM_BUILD_ROOT%{_mandir}/man8/
install -m644 saslauthd/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/

# Create the saslauthd listening directory.
install -m755 -d $RPM_BUILD_ROOT/var/run/saslauthd
install -m755 -d $RPM_BUILD_ROOT/etc/rc.d/init.d
install -m755 $RPM_SOURCE_DIR/saslauthd.init
$RPM_BUILD_ROOT/etc/rc.d/init.d/saslauthd
popd

# Remove unpackaged files from the buildroot.
rm -f $RPM_BUILD_ROOT%{_libdir}/sasl2/libotp.*
rm -f $RPM_BUILD_ROOT%{_mandir}/cat8/saslauthd.8

%clean
test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig
/sbin/chkconfig --add saslauthd

%preun
if [ $1 = 0 ] ; then
/sbin/chkconfig --del saslauthd
fi

%postun
/sbin/ldconfig
if [ $1 != 0 ] ; then
/sbin/service saslauthd condrestart 2>&1 > /dev/null
fi

%files
%defattr(-,root,root)
%doc %{name}-%{version}/%{cs1_version}
%doc %{name}-%{version}/{AUTHORS,COPYING,NEWS,README,doc/*.html}
%doc $RPM_SOURCE_DIR/README.RPM
%{_libdir}/libsasl*.so.*
%dir %{_plugindir}/
%dir %{_plugindir2}/
%{_plugindir}/*anonymous*.so*
%{_plugindir}/*anonymous*.la
%{_plugindir2}/*anonymous*.so*
%{_plugindir2}/*anonymous*.la
%{_plugindir2}/*sasldb*.so*
%{_plugindir2}/*sasldb*.la
%{_mandir}/man8/*
%{_sbindir}/dbconverter-2
%{_sbindir}/saslpasswd
%{_sbindir}/sasldblistusers
%{_sbindir}/saslpasswd2
%{_sbindir}/sasldblistusers2
%{_sbindir}/saslauthd
%config /etc/rc.d/init.d/saslauthd
/var/run/saslauthd

%files plain
%defattr(-,root,root)
%{_plugindir}/*plain*.so*
%{_plugindir}/*plain*.la
%{_plugindir}/*login*.so*
%{_plugindir}/*login*.la
%{_plugindir2}/*plain*.so*
%{_plugindir2}/*plain*.la
%{_plugindir2}/*login*.so*
%{_plugindir2}/*login*.la

%files md5
%defattr(-,root,root)
%{_plugindir}/*crammd5*.so*
%{_plugindir}/*crammd5*.la
%{_plugindir}/*digestmd5*.so*
%{_plugindir}/*digestmd5*.la
%{_plugindir2}/*crammd5*.so*
%{_plugindir2}/*crammd5*.la
%{_plugindir2}/*digestmd5*.so*
%{_plugindir2}/*digestmd5*.la

%files gssapi
%defattr(-,root,root)
%{_plugindir}/*gssapi*.so*
%{_plugindir}/*gssapi*.la
%{_plugindir2}/*gssapi*.so*
%{_plugindir2}/*gssapi*.la

%files devel
%defattr(-,root,root)
%doc %{name}-%{version}/%{cs1_version}-devel
%doc %{name}-%{version}/doc/*.txt
%{_bindir}/sasl-sample-client
%{_bindir}/sasl-sample-server
%{_bindir}/sasl2-sample-client
%{_bindir}/sasl2-sample-server
%{_includedir}/*
%{_libdir}/libsasl*.*a
%{_libdir}/libsasl*.*so
%{_plugindir}/*anonymous*.a
%{_plugindir}/*crammd5*.a
%{_plugindir}/*digestmd5*.a
%{_plugindir}/*gssapi*.a
%{_plugindir}/*login*.a
%{_plugindir}/*plain*.a
%{_plugindir2}/*anonymous*.a
%{_plugindir2}/*crammd5*.a
%{_plugindir2}/*digestmd5*.a
%{_plugindir2}/*gssapi*.a
%{_plugindir2}/*login*.a
%{_plugindir2}/*plain*.a
%{_plugindir2}/*sasldb*.a
%{_mandir}/man3/*
 
Old 04-17-2004, 02:34 PM   #2
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,074

Rep: Reputation: 53
Huh? Where is your mysql-devel package? You need it. It's the one which includes the files required for software development, e.g. include files and shared objects. If it is not provided, you need to rebuild mysql from src.rpm to get the -devel package.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cyrus SASL & Postfix RPM Build ghight Suse/Novell 0 06-03-2005 09:46 AM
anaconda build from src rpm fails LampMan Fedora 3 03-28-2005 02:55 AM
how to know a src.rpm package what support hardware platform jiawj Red Hat 1 11-21-2004 02:47 AM
Cyrus SASL help littlebill Red Hat 0 10-02-2004 08:43 PM
RedHat and src.rpm build of MySQL wdingus Linux - Software 3 04-15-2003 05:23 PM


All times are GMT -5. The time now is 01:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration