From markand@malikania.fr  Mon Apr 14 11:58:42 2014
Return-Path: <markand@malikania.fr>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 0981C5D5;
	Mon, 14 Apr 2014 11:58:42 +0000 (UTC)
Received: from postfix.malikania.fr (ks3292218.kimsufi.com [5.135.187.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 971401D31;
	Mon, 14 Apr 2014 11:58:41 +0000 (UTC)
Received: from postfix.malikania.fr (unknown [10.0.0.5])
	by postfix.malikania.fr (Postfix) with ESMTPS id 02B595872;
	Mon, 14 Apr 2014 13:58:40 +0200 (CEST)
Received: by postfix.malikania.fr (sSMTP sendmail emulation); Mon, 14 Apr 2014 13:58:39 +0200
Message-Id: <20140414115840.02B595872@postfix.malikania.fr>
Date: Mon, 14 Apr 2014 13:58:39 +0200
From: "David Demelier" <markand@malikania.fr>
Reply-To: David Demelier <markand@malikania.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc: swills@FreeBSD.org
Subject: [patch] www/redmine: fix permissions and thin option
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         188607
>Category:       ports
>Synopsis:       [patch] www/redmine: fix permissions and thin option
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    swills
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 14 12:00:00 UTC 2014
>Closed-Date:    Wed Apr 23 13:39:06 UTC 2014
>Last-Modified:  Wed Apr 23 13:40:00 UTC 2014
>Originator:     David Demelier
>Release:        FreeBSD 10.0-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD Pomme.malikania.fr 10.0-RELEASE-p1 FreeBSD 10.0-RELEASE-p1 #1 r264293: Wed Apr 9 10:34:18 CEST 2014 root@Pomme.malikania.fr:/usr/obj/usr/src/sys/Pomme amd64


	
>Description:
The port has been broken again, this patch includes :

1. Fix permission on redmine directories: log, files, tmp and public as described in the redmine installation guide
2. Add gem thin in the Gemfile if the option THIN is enabled, otherwise won't start
3. Clean up thM makefile, CHOWN commands in the Makefile are useless with stage

>How-To-Repeat:
	
>Fix:

	

--- redmine.diff begins here ---
--- Makefile.orig	2014-04-14 12:20:04.000000000 +0200
+++ Makefile	2014-04-14 12:42:43.000000000 +0200
@@ -28,6 +28,9 @@
 USE_RAKE=	yes
 NO_BUILD=	yes
 SUB_LIST+=	RUBY_NAME=${RUBY_NAME}
+USERS=		${WWWOWN}
+GROUPS=		${WWWGRP}
+PLIST_SUB+=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
 
 OPTIONS_DEFINE=	MYSQL MYSQL2 POSTGRESQL RMAGIC WWWSERVER
 OPTIONS_DEFAULT=MYSQL2 RMAGIC WWWSERVER THIN
@@ -62,11 +65,10 @@
 
 .if ${PORT_OPTIONS:MWWWSERVER}
 .if ${PORT_OPTIONS:MTHIN}
-USERS=		${WWWOWN}
-GROUPS=		${WWWGRP}
 RUN_DEPENDS+=	thin:${PORTSDIR}/www/rubygem-thin
 USE_RC_SUBR=	redmine
 SUB_LIST+=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-thin-Gemfile
 .endif
 
 .if ${PORT_OPTIONS:MPASSENGER}
@@ -89,16 +91,11 @@
 
 post-install:
 	${TOUCH} ${STAGEDIR}${WWWDIR}/Gemfile.lock
-	${CHOWN} ${WWWOWN}:${WWWGRP} ${STAGEDIR}${WWWDIR}/Gemfile.lock
 	
 	if ! [ -r ${STAGEDIR}${WWWDIR}/config/settings.yml ]; then		\
 		${INSTALL_DATA} ${STAGEDIR}${WWWDIR}/config/settings.yml-dist	\
 			${STAGEDIR}${WWWDIR}/config/settings.yml;		\
 	fi
-	for subdir in files log tmp public/plugin_assets; do \
-		${CHOWN} -R :${WWWGRP} ${STAGEDIR}${WWWDIR}/$$subdir; \
-		${CHMOD} -R g+w ${STAGEDIR}${WWWDIR}/$$subdir; \
-	done
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
--- pkg-plist.orig	2014-04-14 10:47:41.000000000 +0200
+++ pkg-plist	2014-04-14 12:50:20.000000000 +0200
@@ -1,6 +1,12 @@
 %%WWWDIR%%/CONTRIBUTING.md
+@owner %%WWWOWN%%
+@group %%WWWGRP%%
 %%WWWDIR%%/Gemfile
+@owner %%WWWOWN%%
+@group %%WWWGRP%%
 %%WWWDIR%%/Gemfile.lock
+@owner
+@group
 %%WWWDIR%%/README.rdoc
 %%WWWDIR%%/Rakefile
 %%WWWDIR%%/app/controllers/account_controller.rb
@@ -2174,3 +2180,7 @@
 @dirrmtry %%WWWDIR%%/app/controllers
 @dirrmtry %%WWWDIR%%/app
 @dirrmtry %%WWWDIR%%
+@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/files
+@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/log
+@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/public/plugin_assets
+@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/tmp
--- /dev/null	2014-04-14 12:50:36.000000000 +0200
+++ files/extra-patch-thin-Gemfile	2014-04-14 12:21:58.000000000 +0200
@@ -0,0 +1,12 @@
+--- Gemfile.orig	2014-04-14 12:20:52.000000000 +0200
++++ Gemfile	2014-04-14 12:21:07.000000000 +0200
+@@ -9,6 +9,9 @@
+ gem "mime-types"
+ gem "awesome_nested_set", "2.1.6"
+ 
++# Thin webserver
++gem "thin", "~> 1.6.2"
++
+ # Optional gem for LDAP authentication
+ group :ldap do
+   gem "net-ldap", "~> 0.3.1"
--- redmine.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ruby 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Apr 14 12:00:03 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188607 
Responsible-Changed-From-To: ruby->swills 
Responsible-Changed-By: swills 
Responsible-Changed-When: Wed Apr 16 13:14:59 UTC 2014 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188607 
State-Changed-From-To: open->closed 
State-Changed-By: swills 
State-Changed-When: Wed Apr 23 13:39:05 UTC 2014 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188607 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/188607: commit references a PR
Date: Wed, 23 Apr 2014 13:38:58 +0000 (UTC)

 Author: swills
 Date: Wed Apr 23 13:38:53 2014
 New Revision: 351940
 URL: http://svnweb.freebsd.org/changeset/ports/351940
 QAT: https://qat.redports.org/buildarchive/r351940/
 
 Log:
   - Fix permission on redmine directories: log, files, tmp and public as
     described in the redmine installation guide [1]
   - Add gem thin in the Gemfile if the option THIN is enabled, otherwise won't
     start [1]
   - Clean up the makefile, CHOWN commands in the Makefile are useless with stage [1]
   - Update Gemfile patch to allow newer version of rake while here
   
   PR:		ports/188607 [1]
   Submitted by:	"David Demelier" <markand@malikania.fr> [1]
 
 Added:
   head/www/redmine/files/extra-patch-thin-Gemfile   (contents, props changed)
 Modified:
   head/www/redmine/Makefile
   head/www/redmine/files/patch-Gemfile
   head/www/redmine/pkg-plist
 
 Modified: head/www/redmine/Makefile
 ==============================================================================
 --- head/www/redmine/Makefile	Wed Apr 23 13:37:58 2014	(r351939)
 +++ head/www/redmine/Makefile	Wed Apr 23 13:38:53 2014	(r351940)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	redmine
  PORTVERSION=	2.5.1
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	www
  MASTER_SITES=	http://www.redmine.org/releases/
  
 @@ -28,6 +28,9 @@ USE_RUBY_FEATURES=	iconv
  USE_RAKE=	yes
  NO_BUILD=	yes
  SUB_LIST+=	RUBY_NAME=${RUBY_NAME}
 +USERS=		${WWWOWN}
 +GROUPS=		${WWWGRP}
 +PLIST_SUB+=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
  
  OPTIONS_DEFINE=	MYSQL MYSQL2 POSTGRESQL RMAGIC WWWSERVER
  OPTIONS_DEFAULT=MYSQL2 RMAGIC WWWSERVER THIN
 @@ -62,11 +65,10 @@ EXTRA_PATCHES+=	${FILESDIR}/extra-patch-
  
  .if ${PORT_OPTIONS:MWWWSERVER}
  .if ${PORT_OPTIONS:MTHIN}
 -USERS=		${WWWOWN}
 -GROUPS=		${WWWGRP}
  RUN_DEPENDS+=	thin:${PORTSDIR}/www/rubygem-thin
  USE_RC_SUBR=	redmine
  SUB_LIST+=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
 +EXTRA_PATCHES+=	${FILESDIR}/extra-patch-thin-Gemfile
  .endif
  
  .if ${PORT_OPTIONS:MPASSENGER}
 @@ -89,16 +91,11 @@ do-install:
  
  post-install:
  	${TOUCH} ${STAGEDIR}${WWWDIR}/Gemfile.lock
 -	${CHOWN} ${WWWOWN}:${WWWGRP} ${STAGEDIR}${WWWDIR}/Gemfile.lock
  	
  	if ! [ -r ${STAGEDIR}${WWWDIR}/config/settings.yml ]; then		\
  		${INSTALL_DATA} ${STAGEDIR}${WWWDIR}/config/settings.yml-dist	\
  			${STAGEDIR}${WWWDIR}/config/settings.yml;		\
  	fi
 -	for subdir in files log tmp public/plugin_assets; do \
 -		${CHOWN} -R :${WWWGRP} ${STAGEDIR}${WWWDIR}/$$subdir; \
 -		${CHMOD} -R g+w ${STAGEDIR}${WWWDIR}/$$subdir; \
 -	done
  	@${CAT} ${PKGMESSAGE}
  
  .include <bsd.port.post.mk>
 
 Added: head/www/redmine/files/extra-patch-thin-Gemfile
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/www/redmine/files/extra-patch-thin-Gemfile	Wed Apr 23 13:38:53 2014	(r351940)
 @@ -0,0 +1,12 @@
 +--- Gemfile.orig	2014-04-14 12:20:52.000000000 +0200
 ++++ Gemfile	2014-04-14 12:21:07.000000000 +0200
 +@@ -9,6 +9,9 @@
 + gem "mime-types"
 + gem "awesome_nested_set", "2.1.6"
 + 
 ++# Thin webserver
 ++gem "thin", "~> 1.6.2"
 ++
 + # Optional gem for LDAP authentication
 + group :ldap do
 +   gem "net-ldap", "~> 0.3.1"
 
 Modified: head/www/redmine/files/patch-Gemfile
 ==============================================================================
 --- head/www/redmine/files/patch-Gemfile	Wed Apr 23 13:37:58 2014	(r351939)
 +++ head/www/redmine/files/patch-Gemfile	Wed Apr 23 13:38:53 2014	(r351940)
 @@ -7,7 +7,7 @@
  -gem "rake", "~> 10.1.1"
  -gem "jquery-rails", "~> 2.0.2"
  +gem "rails", "~> 3.2.17"
 -+gem "rake", "~> 10.2.2"
 ++gem "rake", "~> 10.3"
  +gem "jquery-rails", "~> 3.0"
   gem "coderay", "~> 1.1.0"
   gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
 
 Modified: head/www/redmine/pkg-plist
 ==============================================================================
 --- head/www/redmine/pkg-plist	Wed Apr 23 13:37:58 2014	(r351939)
 +++ head/www/redmine/pkg-plist	Wed Apr 23 13:38:53 2014	(r351940)
 @@ -1,6 +1,12 @@
  %%WWWDIR%%/CONTRIBUTING.md
 +@owner %%WWWOWN%%
 +@group %%WWWGRP%%
  %%WWWDIR%%/Gemfile
 +@owner %%WWWOWN%%
 +@group %%WWWGRP%%
  %%WWWDIR%%/Gemfile.lock
 +@owner
 +@group
  %%WWWDIR%%/README.rdoc
  %%WWWDIR%%/Rakefile
  %%WWWDIR%%/app/controllers/account_controller.rb
 @@ -2174,3 +2180,7 @@
  @dirrmtry %%WWWDIR%%/app/controllers
  @dirrmtry %%WWWDIR%%/app
  @dirrmtry %%WWWDIR%%
 +@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/files
 +@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/log
 +@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/public/plugin_assets
 +@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/tmp
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
