Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2001 17:24:03 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Neil Blakey-Milner <nbm@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   mail/vpopmail FreeBSD port cleanup
Message-ID:  <20010704172403.B4644@ringworld.oblivion.bg>

next in thread | raw e-mail | index | archive | help
Hi,

Attached is a patch to the mail/vpopmail port, which attempts to
accomplish several things:

1. Rip out the configure script lines that try to modify
   the destination directory.  I think this one needs no explanation :)
   And no, nothing has broken so far.

2. Give the user the ability to override the default username/pass/db
   for MySQL usage (I mean, other than editing vmysql.h by hand).
   Yep, this could expose the username and password in the clear
   environment during the build process; if somebody is afraid of
   that, then they should simply not use it, and use the good ol'
   editing-vmysql.h-by-hand method.  For the rest of us, this is
   way more convenient :)

3. Give the user the ability to override the default id of 89
   for both the vchkpw group and the vpopmail user.  Currently,
   the pkg-install script just aborts when pw(8) detects that
   the value 89 is already in use (e.g. by the mailman port :)

G'luck,
Peter

-- 
Hey, out there - is it *you* reading me, or is it someone else?

Index: ports/mail/vpopmail/Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/vpopmail/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- ports/mail/vpopmail/Makefile	2001/05/24 13:15:57	1.10
+++ ports/mail/vpopmail/Makefile	2001/07/04 14:15:15
@@ -112,5 +112,16 @@
 
 pre-configure:
 	@PKG_PREFIX=${PREFIX}/vpopmail ${PERL5} ${PKGINSTALL}
+.if defined(WITH_MYSQL)
+.if defined(WITH_MYSQL_USER)
+	${PERL} -pi -e "s/(#define MYSQL_USER.*)root(.*)/\$$1${WITH_MYSQL_USER}\$$2/" ${WRKSRC}/vmysql.h
+.endif
+.if defined(WITH_MYSQL_PASSWD)
+	${PERL} -pi -e "s/(#define MYSQL_PASSWD.*)gipgap(.*)/\$$1${WITH_MYSQL_PASSWD}\$$2/" ${WRKSRC}/vmysql.h
+.endif
+.if defined(WITH_MYSQL_DB)
+	${PERL} -pi -e "s/(#define MYSQL_DATABASE.*)vpopmail(.*)/\$$1${WITH_MYSQL_DB}\$$2/" ${WRKSRC}/vmysql.h
+.endif
+.endif
 
 .include <bsd.port.mk>
Index: ports/mail/vpopmail/pkg-install
===================================================================
RCS file: /home/ncvs/ports/mail/vpopmail/pkg-install,v
retrieving revision 1.1
diff -u -r1.1 pkg-install
--- ports/mail/vpopmail/pkg-install	2000/09/21 13:01:40	1.1
+++ ports/mail/vpopmail/pkg-install	2001/07/04 14:15:15
@@ -8,9 +8,31 @@
 %gids = ("vchkpw", 89);
 %uids = ('vpopmail', 89);
 
+sub checkenv () {
+	my ($u, $g);
+
+	# Users
+	foreach $u (keys %users) {
+		$var = uc($u)."_UID";
+		if (defined($ENV{$var})) {
+			$uids{$u} = $ENV{$var};
+		}
+	}
+
+	# Groups
+	foreach $g (@groups) {
+		$var = uc($g)."_GID";
+		if (defined($ENV{$var})) {
+			$gids{$g} = $ENV{$var};
+		}
+	}
+}
+
 if ($ENV{PACKAGE_BUILDING} || $ARGV[1] eq "PRE-INSTALL") {
 	$doguid=1;  # Make sure we get the assigned guids.
 }
+
+checkenv();
 
 foreach $group (@groups) {
 	if (! getgrnam ($group)) {
Index: ports/mail/vpopmail/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/mail/vpopmail/pkg-plist,v
retrieving revision 1.2
diff -u -r1.2 pkg-plist
--- ports/mail/vpopmail/pkg-plist	2001/01/29 12:01:31	1.2
+++ ports/mail/vpopmail/pkg-plist	2001/07/04 14:15:15
@@ -29,8 +29,6 @@
 vpopmail/doc/man_html/vpasswd.html
 vpopmail/doc/man_html/vpopbull.html
 vpopmail/doc/man_html/vsetuserquota.html
-vpopmail/etc/inc_deps
-vpopmail/etc/lib_deps
 vpopmail/include/config.h
 vpopmail/include/vauth.h
 vpopmail/include/vpopmail.h
Index: ports/mail/vpopmail/files/patch-configure
===================================================================
RCS file: patch-configure
diff -N patch-configure
--- /dev/null	Tue Jul  3 15:42:59 2001
+++ patch-configure	Wed Jul  4 17:15:15 2001
@@ -0,0 +1,50 @@
+--- configure.old	Wed Jul  4 17:14:16 2001
++++ configure	Wed Jul  4 17:14:54 2001
+@@ -1613,16 +1613,6 @@
+ rm -f vpopusername 
+ 
+ 
+-if test ! -d $vpopmaildir/etc
+-then 
+-	mkdir $vpopmaildir/etc
+-	chown $vpopmailuid "$vpopmaildir"/etc 
+-	chgrp $vpopmailgid "$vpopmaildir"/etc 
+-        chmod 755 "$vpopmaildir"/etc
+-        echo "configure: warning: making a vpopmail etc directory " 1>&2
+-fi
+-
+-
+ open_smtp_cur="$vpopmaildir/etc/open-smtp"
+ open_smtp_tmp="$vpopmaildir/etc/open-smtp.tmp"
+ open_smtp_lok="$vpopmaildir/etc/open-smtp.lock"
+@@ -1658,7 +1648,6 @@
+   
+         if test "$tcpserver_file" = ""
+         then
+-	    echo "127.:allow,RELAYCLIENT=\"\"" > "$vpopmaildir"/etc/tcp.smtp
+     	    tcpserver_file="$vpopmaildir"/etc/tcp.smtp
+ 	
+             echo "configure: warning: Unable to find your tcpserver relay file." 1>&2
+@@ -1873,7 +1862,6 @@
+         fi
+ 		auth_libs="-L$sqllibdir -lmysqlclient -lz"
+ 
+-		echo "-L$vpopmaildir/lib -lvpopmail -L$sqllibdir -lmysqlclient -lz" > $vpopmaildir/etc/lib_deps
+ 		
+         ;;
+ *)
+@@ -2007,14 +1995,12 @@
+ 		authlib=
+ 		
+ 		auth_inc="-Icdb"
+-		echo "-L$vpopmaildir/lib -lvpopmail" > $vpopmaildir/etc/lib_deps
+ 		
+         ;;
+ *)
+         ;;
+ esac
+ 
+-echo "-I$vpopmaildir/include" > $vpopmaildir/etc/inc_deps
+ 
+ # Check whether --enable-roaming-users or --disable-roaming-users was given.
+ if test "${enable_roaming_users+set}" = set; then

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010704172403.B4644>