Bug 188607 - [patch] www/redmine: fix permissions and thin option
Summary: [patch] www/redmine: fix permissions and thin option
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: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-14 13:00 UTC by David Demelier
Modified: 2014-04-23 14:40 UTC (History)
1 user (show)

See Also:


Attachments
redmine.diff (2.40 KB, patch)
2014-04-14 13:00 UTC, David Demelier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Demelier 2014-04-14 13:00:00 UTC
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
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-04-14 13:00:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Steve Wills freebsd_committer freebsd_triage 2014-04-16 14:14:59 UTC
Responsible Changed
From-To: ruby->swills

I'll take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-04-23 14:38:58 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"
Comment 4 Steve Wills freebsd_committer freebsd_triage 2014-04-23 14:39:05 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!