Re: [vchkpw] Configure options for MySQL support?
I now do this with my mail toaster setup (http://matt.simerson.net/computing/mail/toaster/). When you run the perl script (toaster_setup.pl -s vpopmail) it asks you a bunch of questions and then rewrites vmysql.h with your answers instead of the default values. Then it runs ./configure with the appropriate --enable-* stuff based on the interview. Here's the useful logic: sub set_up_vmysql { my ($mysql_repl, $my_write, $my_read, $my_user, $my_pass) = @_; copy(vmysql.h, vmysql.h.orig); my @lines = read_file(vmysql.h); foreach my $line (@lines) { chomp $line; if ( $line =~ /^#define MYSQL_UPDATE_SERVER/ ) { if ($mysql_repl) { $line = #define MYSQL_UPDATE_SERVER \$my_write\; } else { $line = #define MYSQL_UPDATE_SERVER \$my_read\; }; } elsif ( $line =~ /^#define MYSQL_UPDATE_USER/ ) { $line = #define MYSQL_UPDATE_USER \$my_user\; } elsif ( $line =~ /^#define MYSQL_UPDATE_PASSWD/ ) { $line = #define MYSQL_UPDATE_PASSWD \$my_pass\; } elsif ( $line =~ /^#define MYSQL_READ_SERVER/ ) { $line = #define MYSQL_READ_SERVER \$my_read\; } elsif ( $line =~ /^#define MYSQL_READ_USER/ ) { $line = #define MYSQL_READ_USER \$my_user\; } elsif ( $line =~ /^#define MYSQL_READ_PASSWD/ ) { $line = #define MYSQL_READ_PASSWD \$my_pass\; }; }; write_file(vmysql.h, @lines); }; On Tuesday, February 25, 2003, at 10:14 AM, Andre Fortin wrote: This sounds like a good idea to me.. I'd like to see this in the future. Andre -Original Message- From: Robin Bowes [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 10:13 AM To: [EMAIL PROTECTED] Subject: Re: [vchkpw] Configure options for MySQL support? David, On Tue, February 25, 2003 2:13 pm, David Richardson said: I don't plan on changing my MySQL params very often, but I'm _certain_ that I'll forget to update vmysql.h during a recompile and I'll foobar my Vpopmail. Can you guess what bit me resulting in my raising this as an issue?!! Perhaps we could just cobble together a helper perl script to query for and rewrite the vmysql.h params as part of the compile script(s) you use. That's another possibility... Without a lot of other me too votes, is there interest from the vpopmail team in having this idea go a particular direction (into config/make or external perl)? Is this even the appropriate venue to ask??? Let's wait and see... R. -- Robin Bowes | http://robinbowes.com
Re: [vchkpw] Configure options for MySQL support?
Robin, if it's up for a vote, I'll second your motion! I don't plan on changing my MySQL params very often, but I'm _certain_ that I'll forget to update vmysql.h during a recompile and I'll foobar my Vpopmail. Perhaps we could just cobble together a helper perl script to query for and rewrite the vmysql.h params as part of the compile script(s) you use. Without a lot of other me too votes, is there interest from the vpopmail team in having this idea go a particular direction (into config/make or external perl)? Is this even the appropriate venue to ask??? Thanks, Dave. -- Original Message -- From: Robin Bowes [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Tue, 25 Feb 2003 08:50:23 - (GMT) Hi, I currently use a script to build vpopmail to mame sure I keep the same configure options: [EMAIL PROTECTED] tarballs]# cat vpopmail.config.sh #!/bin/bash ./configure \ --enable-tcpserver-file=/etc/tcprules.d/qmail-smtpd \ --enable-logging=e \ --enable-log-name=vpopmail \ --enable-default-domain=robinbowes.com \ --enable-file-sync=n \ --enable-auth-logging=y \ --enable-qmail-ext=y \ --enable-clear-passwd=y \ --enable-valias=y \ --enable-roaming-users=y \ --enable-mysql=y \ make \ make install-strip I keep this in /home/tarballs along with my vpopmail tarballs: [EMAIL PROTECTED] tarballs]# ls -d vpopmail* vpopmail-5.2.1.tar.gz vpopmail-5.3.16.tar.gz vpopmail.config.sh vpopmail-5.3.12.tar.gz vpopmail-5.3.7.tar.gz vpopmail-5.3.16 vpopmail-5.3.9.tar.gz If I need to build vpopmail (any version), I so the following: [EMAIL PROTECTED] tarballs]# tar zxf vpopmail-5.3.12.tar.gz [EMAIL PROTECTED] tarballs]# cd vpopmail-5.3.12 [EMAIL PROTECTED] vpopmail-5.3.12]# ../vpopmail.config.sh creating cache ./config.cache checking for a BSD compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... This worked perfectly until I enabled MySQL support. Now I must edit vmysql.h to include the server/user/password for mysql. Would it be possible to add in a few options for configure to supply these values on the command line, e.g.: ./configure \ --with-mysql-update-server=servername \ --with-mysql-update-user=username \ --with-mysql-update-password=password \ --with-mysql-read-server=servername \ --with-mysql-read-user=username \ --with-mysql-read-password=password The --with-mysql-read-* options could be optional, i.e. use the update server values if the read server is not present. I'd hack this myself, but I'm afraid I know little about writing configure scripts. Thanks, R. -- Robin Bowes | http://robinbowes.com
Re: [vchkpw] Configure options for MySQL support?
David, On Tue, February 25, 2003 2:13 pm, David Richardson said: I don't plan on changing my MySQL params very often, but I'm _certain_ that I'll forget to update vmysql.h during a recompile and I'll foobar my Vpopmail. Can you guess what bit me resulting in my raising this as an issue?!! Perhaps we could just cobble together a helper perl script to query for and rewrite the vmysql.h params as part of the compile script(s) you use. That's another possibility... Without a lot of other me too votes, is there interest from the vpopmail team in having this idea go a particular direction (into config/make or external perl)? Is this even the appropriate venue to ask??? Let's wait and see... R. -- Robin Bowes | http://robinbowes.com
RE: [vchkpw] Configure options for MySQL support?
This sounds like a good idea to me.. I'd like to see this in the future. Andre -Original Message- From: Robin Bowes [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 10:13 AM To: [EMAIL PROTECTED] Subject: Re: [vchkpw] Configure options for MySQL support? David, On Tue, February 25, 2003 2:13 pm, David Richardson said: I don't plan on changing my MySQL params very often, but I'm _certain_ that I'll forget to update vmysql.h during a recompile and I'll foobar my Vpopmail. Can you guess what bit me resulting in my raising this as an issue?!! Perhaps we could just cobble together a helper perl script to query for and rewrite the vmysql.h params as part of the compile script(s) you use. That's another possibility... Without a lot of other me too votes, is there interest from the vpopmail team in having this idea go a particular direction (into config/make or external perl)? Is this even the appropriate venue to ask??? Let's wait and see... R. -- Robin Bowes | http://robinbowes.com