Bug 79094 - A lot of changes on qmail master and all slave ports
Summary: A lot of changes on qmail master and all slave ports
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey Matveychuk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-21 17:20 UTC by Renato Botelho
Modified: 2005-05-05 21:05 UTC (History)
1 user (show)

See Also:


Attachments
qmail-ports.diff (55.66 KB, patch)
2005-03-21 17:20 UTC, Renato Botelho
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Renato Botelho 2005-03-21 17:20:01 UTC
This PR superseds ports/78923

Qmail maintainer (lioux) is cc'ed

This PR has a lot of changes on the following ports:

mail/qmail
mail/qmail-ldap
mail/qmail-mysql
mail/qmail-smtp_auth+tls
mail/qmail-spamcontrol
mail/qmail-tls

The finally of these changes is simplify qmail ports, pacify portlint
messages and remove perl dependence. If this is approved, the only
thing that use perl will be pkg-install script on qmail main port.

This script has started to be converted to shell by Marcos Tischer 
Vallim (tischer@gmail.com) and when he finish the work I'll send a
PR removing all perl dependence.

Here is a resume of all changes:

o Pacify a lot of portlint WARN and FATAL messages
o Change ${PERL} to ${SED} or ${REINPLACE_CMD}
o Added patch patch-qmail-1.03-rfc2821.diff to search other MX servers
  when the first return a code > 500 and < 599
o Install mkaliasdir script on ${PREFIX}/scripts directory
o Remove targets to disable-qmail and enable-sendmail and put it on a
  shell script that is installed on /var/qmail/scripts. Change messages
  reflect this.
o Organize better pkg-plist
o Remove thereal-post-patch target and put all on post-post-patch target
o Add [0-9] to CONFLICTS on qmail-ldap port
o Change LIB_DEPENDS to USE_MYSQL=yes on qmail-mysql port
o Change qmail-spamcontrol to don't need more to apply patches mannualy

Files added:

mail/qmail/files/bootfiles.sed.in
mail/qmail/files/enable-qmail.in
Comment 1 Sergei Kolobov freebsd_committer freebsd_triage 2005-03-21 17:37:34 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lioux

Over to qmail maintainer (lioux) for review and approval.
Comment 2 Renato Botelho 2005-03-22 13:27:40 UTC
Lioux,

Here is the new pkg-install, wrote by Marcos Tischer Vallim <tischer@gmail.com>.
This was wrote in csh, and I tested it so much, I think there is no problem.
Just remove USE_PERL5_BUILD=yes and ${PERL5} before ${PKGINSTALL} to use it.

-------------------------------------------------------------------

#!/bin/csh -f

# Author : Marcos Tischer Vallim
# E-Mail : tischer@gmail.com
# Date   : Tue Mar 22 00:40:45 BRT 2005

# Variables
set pw = '/usr/sbin/pw';
set touch = '/usr/bin/touch';
set sed = '/usr/bin/sed';
set null = '/dev/null';

if ($uid != 0) then
	echo "It is necessary to add missing qmail users/groups at";
	echo "this stage.  Please either add them manually or retry";
	echo "as root.";
	exit 1;
endif

if (! -x "$pw") then
	echo "This system looks like a pre-2.2 version of FreeBSD.  We see that it";
	echo "is missing the "pw" utility.  We need this utility.  Please get and";
	echo "install it, and try again.  You can get the source from:";
	echo "";
	echo "  ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz";
	echo "";
	echo "No $pw";
	exit 1;
endif

set groups  = (qmail qnofiles);
set gids    = (82 81);
set users   = (alias qmaild qmaill qmailp qmailq qmailr qmails);
set users_g = (qnofiles qnofiles qnofiles qnofiles qmail qmail qmail);
set uids    = (81 82 83 84 85 86 87);
set doguid  = 0;

if ($#argv) then
	if ($argv[1] == "POST-INSTALL") then
		${PKG_PREFIX}/configure/install x;
		cd ${PKG_PREFIX}/configure && ./config;

		$touch "${PKG_PREFIX}/alias/.{qmail-postmaster,qmail-root,qmail-mailer-daemon}";

		if ($status) then
			echo "Failed to create files :";
			echo "  ${PKG_PREFIX}/alias/.qmail-postmaster";
			echo "  ${PKG_PREFIX}/alias/.qmail-root";
			echo "  ${PKG_PREFIX}/alias/.qmail-mailer-daemon";
			exit 1;
		endif

		exit 0;
	endif

	if ($argv[1] == "PRE-INSTALL") then
		set doguid = 1;
	endif
endif

if (${?PACKAGE_BUILDING}) then
	set doguid = 1;
endif

if ($doguid) then
	set k = 1;
	foreach group ($groups) {
		set chkgid = (`$pw groupshow $group | $sed -e "s/:/ /"`); 
		if ($chkgid[3] != $gids[$k]) then
			echo "Group '$group' should have gid '$gids[$k]'";
			exit 1;
		endif

		@ k = $k + 1;
	}

	set k = 1;
	foreach user ($users) {
		set chkuid = (`$pw usershow $user | $sed -e "s/:/ /"`); 
		if ($chkuid[3] != $uids[$k]) then
			echo "User '$user' should have uid '$uids[$k]'";
			exit 1;
		endif

		@ k = $k + 1;
	}

	exit 0;
endif

set k = 1;
foreach group ($groups)
	$pw groupshow $group >& $null;

	if ($status) then
		$pw groupadd $group -g $gids[$k];

		if ($status) then
			echo "Failed to add group '$group' as gid '$gids[$k]'";
			exit 1;
		endif
	endif

	@ k = $k + 1;
end

set k = 1;
foreach user ($users)
	$pw usershow $user >& $null;

	if ($status) then
		if ($user == "alias") then
			set home = ${PKG_PREFIX}/alias;
		else
			set home = ${PKG_PREFIX};
		endif

		$pw useradd $user -g $users_g[$k] -d $home -s /nonexistent -u $uids[$k];

		if ($status) then
			echo "Failed to add user '$user' as uid '$uids[$k]'";
			exit 1;
		endif
	endif

	@ k = $k + 1;
end

exit 0;

-------------------------------------------------------------------

Thanks a lot
-- 
Renato Botelho
Comment 3 Sergei Kolobov freebsd_committer freebsd_triage 2005-04-12 15:38:27 UTC
Class Changed
From-To: change-request->maintainer-update

Submitter is now qmail port maintainer. 


Comment 4 Sergei Kolobov freebsd_committer freebsd_triage 2005-04-12 15:38:27 UTC
Responsible Changed
From-To: lioux->sergei

I will handle it.
Comment 5 Sergei Kolobov freebsd_committer freebsd_triage 2005-04-24 12:10:19 UTC
Responsible Changed
From-To: sergei->freebsd-ports

Reset responsible - I do not have the time to fully test it at the moment. 
This PR contains a lot of changes and I hope other committers will be  
able to help Renato in committing the changes.
Comment 6 Sergey Matveychuk freebsd_committer freebsd_triage 2005-04-25 06:56:54 UTC
Responsible Changed
From-To: freebsd-ports->sem

Grab
Comment 7 Sergey Matveychuk freebsd_committer freebsd_triage 2005-05-05 21:05:07 UTC
State Changed
From-To: open->closed

Committed, thanks!