Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2012 14:04:11 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r301331 - in head/mail/quickml: . files
Message-ID:  <201207221404.q6ME4BXU091814@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Sun Jul 22 14:04:11 2012
New Revision: 301331
URL: http://svn.freebsd.org/changeset/ports/301331

Log:
  - Make patches for ruby19 environment
  - Fix Makefile
  - SUB_LIST: to work rc.d scripts proper.
  - PLIST_SUB: to change pkg-plist based on Make variables.
  
  PR:		ports/169345
  Submitted by:	Masaki TAGAWA <masaki@club.kyutech.ac.jp>
  Approved by:	maintainer timeout (yaizawa@2004.jukuin.keio.ac.jp, >3 weeks)

Added:
  head/mail/quickml/files/extra-patch-limit-config.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-limit-core.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-limit-messages.ja   (contents, props changed)
  head/mail/quickml/files/extra-patch-limit-quickmlrc.sample.in   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-config.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-core.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-gettext.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-mail.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-messages.ja   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-quickml-analog.in   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-quickml.in   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-utils.rb   (contents, props changed)
  head/mail/quickml/files/extra-patch-woanalog-Makefile.in   (contents, props changed)
Deleted:
  head/mail/quickml/files/without_quickml-analog
Modified:
  head/mail/quickml/Makefile   (contents, props changed)
  head/mail/quickml/files/extra-patch-ruby19-Makefile.in   (contents, props changed)
  head/mail/quickml/pkg-plist   (contents, props changed)

Modified: head/mail/quickml/Makefile
==============================================================================
--- head/mail/quickml/Makefile	Sun Jul 22 13:53:27 2012	(r301330)
+++ head/mail/quickml/Makefile	Sun Jul 22 14:04:11 2012	(r301331)
@@ -7,60 +7,52 @@
 
 PORTNAME=	quickml
 PORTVERSION=	0.7
-PORTREVISION=	12
+PORTREVISION=	13
 CATEGORIES=	mail
 MASTER_SITES=	http://0xcc.net/quickml/
 
 MAINTAINER=	yaizawa@2004.jukuin.keio.ac.jp
 COMMENT=	An easy-to-use mailing list system
 
-OPTIONS+=	ANALOG "Enable quickml-analog" on \
-		LIMIT  "Enable Creators and Members Limitation Patch" off
-
-USERS=	quickml
-GROUPS=	quickml
-
 LICENSE=	GPLv2
 
 USE_AUTOTOOLS=	autoconf
 GNU_CONFIGURE=	yes
 USE_RUBY=	yes
-
 USE_RC_SUBR=	${PORTNAME}
 
-CONFIGURE_ARGS+=	--datadir="${PREFIX}/share/quickml"
-CONFIGURE_ARGS+=	--with-ruby="${RUBY}"
-CONFIGURE_ARGS+=	--with-user="${USERS}"
-CONFIGURE_ARGS+=	--with-group="${GROUPS}"
-CONFIGURE_ARGS+=	--with-rubydir="${RUBY_LIBDIR}"
+USERS=	quickml
+GROUPS=	quickml
+
+CONFIGURE_ARGS=	--datadir="${PREFIX}/share/quickml" \
+	--with-ruby="${RUBY}" \
+	--with-user="${USERS}" \
+	--with-group="${GROUPS}" \
+	--with-rubydir="${RUBY_LIBDIR}"
+
+SUB_LIST=	RUBY=${RUBY}
+
+OPTIONS=	ANALOG "Enable quickml-analog" on \
+		LIMIT  "Enable Creators and Members Limitation Patch" off
 
 .include <bsd.port.pre.mk>
 
 .if ${RUBY_VER} == 1.9
-EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-ruby19-Makefile.in
-.endif
-
-.if !defined(WITHOUT_LIMIT)
-PATCH_DIST_STRIP=	-p1
+EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-ruby19-*
 .endif
 
 .if !defined(WITHOUT_ANALOG)
 USE_GHOSTSCRIPT_RUN=	yes
 RUN_DEPENDS+=	gnuplot:${PORTSDIR}/math/gnuplot \
 		convert:${PORTSDIR}/graphics/ImageMagick
+PLIST_SUB+=	ANALOG=""
+.else
+PLIST_SUB+=	ANALOG="@comment "
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-woanalog-Makefile.in
 .endif
 
-post-fetch:
 .if !defined(WITHOUT_LIMIT)
-	@ ( cd ${DISTDIR} && ${FETCH_CMD} -o ${PORTNAME}-${PORTVERSION}-limited.patch "http://linux.matchy.net/view.xcg?c=plugin;plugin=attach_download;p=QuickMLLimited;file_name=${PORTNAME}-${PORTVERSION}-limited.patch" )
-.endif
-
-post-patch:
-.if !defined(WITHOUT_LIMIT)
-	@${PATCH} ${PATCH_DIST_ARGS} < ${DISTDIR}/${PORTNAME}-${PORTVERSION}-limited.patch
-.endif
-.if defined(WITHOUT_ANALOG)
-	${PATCH} ${PATCH_DIST_ARGS} < ${FILESDIR}/without_quickml-analog
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-limit-*
 .endif
 
 post-install:

Added: head/mail/quickml/files/extra-patch-limit-config.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-limit-config.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,22 @@
+--- lib/quickml/config.rb.org	2004-06-07 17:50:59.000000000 +0900
++++ lib/quickml/config.rb	2012-06-21 15:55:28.000000000 +0900
+@@ -56,6 +56,19 @@
+       @group = (config[:group] or "root")
+       @use_qmail_verp = (config[:use_qmail_verp] or false)
+ 
++      @creator_check = (config[:creator_check] or false)
++      @creator_addresses = if config[:creator_addresses]
++			     config[:creator_addresses]
++			   else
++			     [ @domain ]
++			   end
++      @member_check = (config[:member_check] or false)
++      @member_addresses = if config[:member_addresses]
++			    config[:member_addresses]
++			  else
++			    [ @domain ]
++			  end
++
+       charset = @catalog.charset if @catalog
+       @content_type = "text/plain"
+ 

Added: head/mail/quickml/files/extra-patch-limit-core.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-limit-core.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,144 @@
+--- lib/quickml/core.rb.org	2004-06-09 05:15:11.000000000 +0900
++++ lib/quickml/core.rb	2012-06-21 15:55:28.000000000 +0900
+@@ -17,6 +17,8 @@
+   class TooLargeMail < QuickMLException; end
+   class TooManyMembers < QuickMLException; end
+   class InvalidMLName < QuickMLException; end
++  class InvalidCreator < QuickMLException; end
++  class InvalidMembers < QuickMLException; end
+ 
+   # It preserves case information. but it accepts an
+   # address case-insensitively for member management.
+@@ -96,6 +98,10 @@
+       @logger = @config.logger
+       @catalog = @config.catalog
+ 
++      if newly_created? and @config.creator_check
++        raise InvalidCreator unless valid_members?(creator, @config.creator_addresses)
++      end
++
+       init_ml_config
+       init_members
+       init_count
+@@ -114,6 +120,13 @@
+     attr_reader :charset
+     attr_reader :max_members
+ 
++    def valid_members? (address, pat)
++      pat.each do |entry|
++	return true if /#{entry}/i =~ address
++      end
++      false
++    end
++    
+     def self.valid_name? (name)
+       /^([0-9a-zA-Z_.-]+)(@[0-9a-zA-Z_.-]+)?$/ =~ name
+     end
+@@ -607,6 +620,7 @@
+         begin
+           add_member(address)
+         rescue TooManyMembers
++        rescue InvalidMembers
+         end
+       }
+       submit(mail)
+@@ -636,6 +650,9 @@
+     end
+ 
+     def add_member (address)
++      if @config.member_check
++        raise InvalidMembers unless valid_members?(address, @config.member_addresses)
++      end
+       if exclude?(address)
+ 	@logger.vlog "Excluded: #{address}"
+ 	return
+@@ -827,6 +844,29 @@
+       @logger.log "[#{ml.name}]: Too Many Members: #{address}"
+     end
+ 
++    def report_invalid_members (ml, invalid_members)
++      header = []
++      subject = Mail.encode_field(_("[QuickML] Error: %s", @mail["Subject"]))
++      header.push(["To",	@mail.from],
++		  ["From",	ml.address],
++		  ["Subject",	subject],
++                  ["Content-type", content_type])
++
++      body =  _("The following addresses cannot be added because <%s> mailing list can join known members only.\n\n",
++		ml.address)
++      invalid_members.each {|address|
++        body << sprintf("<%s>\n", address)
++      }
++
++      body << generate_footer
++      Mail.send_mail(@config.smtp_host, @config.smtp_port, @logger,
++		     :mail_from => '', 
++		     :recipient => @mail.from,
++		     :header => header,
++		     :body => body)
++      @logger.log "[#{ml.name}]: Invalid Members by #{@mail.from}"
++    end
++
+     def report_invalid_mladdress (mladdress)
+       header = []
+       subject = Mail.encode_field(_("[QuickML] Error: %s", @mail["Subject"]))
+@@ -846,6 +886,23 @@
+       @logger.log "Invalid ML Address: #{mladdress}"
+     end
+ 
++    def report_invalid_creator (mladdress)
++      header = []
++      subject = Mail.encode_field(_("[QuickML] Error: %s", @mail["Subject"]))
++      header.push(["To",	@mail.from],
++		  ["From",	@config.postmaster],
++		  ["Subject",	subject],
++                  ["Content-type", content_type])
++      body =  _("Invalid Creator: <%s> by <%s>.\n", mladdress, @mail.from)
++      body << generate_footer
++      Mail.send_mail(@config.smtp_host, @config.smtp_port, @logger,
++		     :mail_from => '', 
++		     :recipient => @mail.from,
++		     :header => header,
++		     :body => body)
++      @logger.log "Invalid Creator: #{mladdress} by #{@mail.from}"
++    end
++
+     def mail_log
+       @logger.vlog "MAIL FROM:<#{@mail.mail_from}>"
+       @mail.recipients.each {|recipient|
+@@ -868,6 +925,8 @@
+ 	ml.add_member(address)
+       rescue TooManyMembers
+         @unadded_addresses.push(address)
++      rescue InvalidMembers
++        @invalid_members.push(address)
+       end
+     end
+ 
+@@ -879,6 +938,7 @@
+ 
+     def submit_article (ml)
+       @unadded_addresses = []
++      @invalid_members = []
+       if ml_address_in_to?(ml)
+         add_member(ml, @mail.from)
+         @mail.collect_cc.each {|address| 
+@@ -888,6 +948,9 @@
+       unless @unadded_addresses.empty?
+         report_too_many_members(ml, @unadded_addresses)
+       end
++      unless @invalid_members.empty?
++        report_invalid_members(ml, @invalid_members)
++      end
+       ml.submit(@mail)
+     end
+ 
+@@ -991,6 +1054,8 @@
+ 	  }
+ 	rescue InvalidMLName
+ 	  report_invalid_mladdress(mladdress)
++        rescue InvalidCreator
++	  report_invalid_creator(mladdress)
+ 	end
+       end
+     end

Added: head/mail/quickml/files/extra-patch-limit-messages.ja
==============================================================================
Binary file. No diff available.

Added: head/mail/quickml/files/extra-patch-limit-quickmlrc.sample.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-limit-quickmlrc.sample.in	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,17 @@
+--- quickmlrc.sample.in.org	2004-06-07 17:50:58.000000000 +0900
++++ quickmlrc.sample.in	2012-06-21 15:55:28.000000000 +0900
+@@ -31,4 +31,14 @@
+ 
+   # :message_catalog => nil  # for English messages
+   :message_catalog => '%DATADIR%/messages.ja',
++
++  :creator_check => false,
++  :creator_addresses => [
++      '^.+@example\.net$',
++  ],
++
++  :member_check => false,
++  :member_addresses => [
++      '^.+@example\.net$',
++  ],
+ }

Modified: head/mail/quickml/files/extra-patch-ruby19-Makefile.in
==============================================================================
--- head/mail/quickml/files/extra-patch-ruby19-Makefile.in	Sun Jul 22 13:53:27 2012	(r301330)
+++ head/mail/quickml/files/extra-patch-ruby19-Makefile.in	Sun Jul 22 14:04:11 2012	(r301331)
@@ -5,7 +5,7 @@
  quickml: quickml.in
  	for i in $(MESSAGES); do\
 -	  $(RUBY) lib/quickml/gettext.rb $$i quickml.in lib/quickml/*.rb;\
-+	  $(RUBY) -E Shift_JIS:UTF-16LE lib/quickml/gettext.rb $$i quickml.in lib/quickml/*.rb;\
++	  $(RUBY) -Ke lib/quickml/gettext.rb $$i quickml.in lib/quickml/*.rb;\
  	done
  	rm -f quickml
  	sed -e 's!%RUBY%!$(RUBY)!g' \

Added: head/mail/quickml/files/extra-patch-ruby19-config.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-config.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,11 @@
+--- lib/quickml/config.rb.orig	2012-06-21 17:13:32.000000000 +0900
++++ lib/quickml/config.rb	2012-06-21 17:13:46.000000000 +0900
+@@ -62,7 +62,7 @@
+       @confirm_ml_creation = (config[:confirm_ml_creation] or false)
+ 
+       instance_variables.each {|name|
+-	self.class.class_eval { attr_reader name.delete('@') }
++	self.class.class_eval { attr_reader name.to_s.delete('@') }
+       }
+     end
+ 

Added: head/mail/quickml/files/extra-patch-ruby19-core.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-core.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,15 @@
+--- lib/quickml/core.rb.orig	2004-06-09 05:15:11.000000000 +0900
++++ lib/quickml/core.rb	2012-06-21 16:08:14.000000000 +0900
+@@ -1,3 +1,4 @@
++#coding: euc-jp
+ #
+ # quickml/core - a part of quickml server
+ #
+@@ -8,7 +9,6 @@
+ # You can redistribute it and/or modify it under the terms of 
+ # the GNU General Public License version 2.
+ #
+-$KCODE='e'
+ require 'quickml/utils'
+ require 'quickml/gettext'
+ 

Added: head/mail/quickml/files/extra-patch-ruby19-gettext.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-gettext.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,7 @@
+--- lib/quickml/gettext.rb.orig	2012-06-21 16:12:56.000000000 +0900
++++ lib/quickml/gettext.rb	2012-06-21 16:13:31.000000000 +0900
+@@ -1,3 +1,4 @@
++#coding: euc-jp
+ #
+ # quickml/gettext - a part of quickml server
+ #

Added: head/mail/quickml/files/extra-patch-ruby19-mail.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-mail.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,7 @@
+--- lib/quickml/mail.rb.orig	2012-06-21 16:10:20.000000000 +0900
++++ lib/quickml/mail.rb	2012-06-21 16:11:01.000000000 +0900
+@@ -1,3 +1,4 @@
++#coding: euc-jp
+ #
+ # quickml/mail - a part of quickml server
+ #

Added: head/mail/quickml/files/extra-patch-ruby19-messages.ja
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-messages.ja	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,7 @@
+--- messages.ja.orig	2012-06-21 16:22:16.000000000 +0900
++++ messages.ja	2012-06-21 16:22:45.000000000 +0900
+@@ -1,3 +1,4 @@
++#coding: euc-jp
+ # -*- mode: ruby -*-
+ Messages = {
+   "<%s> was removed from the mailing list:\n<%s>\n" =>

Added: head/mail/quickml/files/extra-patch-ruby19-quickml-analog.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-quickml-analog.in	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,11 @@
+--- quickml-analog.in.orig	2004-06-07 17:50:59.000000000 +0900
++++ quickml-analog.in	2012-06-21 15:52:24.000000000 +0900
+@@ -12,7 +12,7 @@
+ #
+ 
+ require 'getoptlong'
+-require 'ftools'
++require 'fileutils'
+ require 'time'
+ require 'cgi'
+ 

Added: head/mail/quickml/files/extra-patch-ruby19-quickml.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-quickml.in	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,16 @@
+--- quickml.in.orig	2004-06-07 17:50:58.000000000 +0900
++++ quickml.in	2012-06-21 16:05:07.000000000 +0900
+@@ -1,4 +1,5 @@
+ #! %RUBY%
++#coding: euc-jp
+ # -*- mode: ruby -*-
+ #
+ # quickml - an easy-to-use mailing list server
+@@ -11,7 +12,6 @@
+ # the GNU General Public License version 2.
+ #
+ 
+-$KCODE = "e"
+ require 'quickml'
+ 
+ def error (msg)

Added: head/mail/quickml/files/extra-patch-ruby19-utils.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-ruby19-utils.rb	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,19 @@
+--- lib/quickml/utils.rb.orig	2004-06-07 17:50:59.000000000 +0900
++++ lib/quickml/utils.rb	2012-06-21 16:06:07.000000000 +0900
+@@ -1,3 +1,4 @@
++#coding: euc-jp
+ #
+ # quickml/utils - a part of quickml server
+ #
+@@ -8,10 +9,9 @@
+ # You can redistribute it and/or modify it under the terms of 
+ # the GNU General Public License version 2.
+ #
+-$KCODE = 'e'
+ require 'kconv'
+ require 'net/smtp'
+-require 'ftools'
++require 'fileutils'
+ 
+ class TooLongLine < Exception; end
+ class IO

Added: head/mail/quickml/files/extra-patch-woanalog-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/quickml/files/extra-patch-woanalog-Makefile.in	Sun Jul 22 14:04:11 2012	(r301331)
@@ -0,0 +1,24 @@
+*** Makefile.in.with_analog	Thu Jul  1 00:20:16 2004
+--- Makefile.in	Thu Jul  1 00:22:28 2004
+***************
+*** 142,151 ****
+  RD = quickml.en.rd ml-usage.en.rd quickml.ja.rd with-mta.ja.rd
+  MESSAGES = messages.ja
+  EXTRA_DIST = $(RD) $(MESSAGES) quickml.in quickml-ctl.in \
+! 		quickmlrc.sample.in quickml-analog.in
+  
+  CLEANFILES = quickml quickml-ctl quickmlrc.sample quickml-analog
+- bin_SCRIPTS = quickml-analog
+  sbin_SCRIPTS = quickml quickml-ctl 
+  quickmlstatedir = $(localstatedir)/quickml
+  etcdir = $(sysconfdir)
+--- 142,150 ----
+  RD = quickml.en.rd ml-usage.en.rd quickml.ja.rd with-mta.ja.rd
+  MESSAGES = messages.ja
+  EXTRA_DIST = $(RD) $(MESSAGES) quickml.in quickml-ctl.in \
+! 		quickmlrc.sample.in
+  
+  CLEANFILES = quickml quickml-ctl quickmlrc.sample quickml-analog
+  sbin_SCRIPTS = quickml quickml-ctl 
+  quickmlstatedir = $(localstatedir)/quickml
+  etcdir = $(sysconfdir)

Modified: head/mail/quickml/pkg-plist
==============================================================================
--- head/mail/quickml/pkg-plist	Sun Jul 22 13:53:27 2012	(r301330)
+++ head/mail/quickml/pkg-plist	Sun Jul 22 14:04:11 2012	(r301331)
@@ -8,7 +8,7 @@
 %%RUBY_LIBDIR%%/quickml/utils.rb
 %%RUBY_LIBDIR%%/quickml/version.rb
 %%RUBY_LIBDIR%%/quickml.rb
-bin/quickml-analog
+%%ANALOG%%bin/quickml-analog
 sbin/quickml
 sbin/quickml-ctl
 @unexec if cmp -s %D/etc/quickmlrc %D/etc/quickmlrc.sample; then rm -f %D/etc/quickmlrc; fi



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