pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/50041: Roundcube is supposed to run with Apache



Le 08/07/2015 22:20, frederic%fauberteau.org@localhost a écrit :
Number:         50041
Category:       pkg
Synopsis:       Roundcube is supposed to run with Apache
Confidential:   no
Severity:       non-critical
Priority:       low
Responsible:    pkg-manager
State:          open
Class:          change-request
Submitter-Id:   net
Arrival-Date:   Wed Jul 08 20:20:00 +0000 2015
Originator:     Fr�d�ric
Release:        pkgsrc-2015Q1
Organization:
Environment:
NetBSD trashware 6.1_STABLE NetBSD 6.1_STABLE (TRASHWARE) #0: Tue Jul
7 09:13:34 CEST 2015
triaxx@trashware:/home/triaxx/dev/nbsd/netbsd-6/obj/sys/arch/amd64/compile/TRASHWARE
amd64
Description:
The perms for some files of roundcube are set for Apache.
How-To-Repeat:
By installing roundcube.
Fix:
This is just an idea:

Ok, I should give more precision about the patch. I would add an option to choose the webserver since I use nginx and I don't want Apache dependency. The dependencies on Apache or nginx has been moved in options.mk and a example configuration file for nginx has been added. Is it a good idea?

Sorry, but my pkgsrc tree was outdated and I had forgotten a fpm dependency.

Attached the revised patch:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/roundcube/Makefile,v
retrieving revision 1.73
diff -u -r1.73 Makefile
--- Makefile	6 Jun 2015 14:14:12 -0000	1.73
+++ Makefile	9 Jul 2015 12:50:28 -0000
@@ -36,12 +36,9 @@

 PKG_SYSCONFSUBDIR?=	roundcube

-WWW_USER?=		${APACHE_USER}
-WWW_GROUP?=		${APACHE_GROUP}
-
 PKG_GROUPS_VARS+=	WWW_GROUP
 PKG_USERS_VARS=		WWW_USER
-BUILD_DEFS+=		VARBASE WWW_USER WWW_GROUP APACHE_USER APACHE_GROUP
+BUILD_DEFS+=		VARBASE WWW_USER WWW_GROUP WWW_CONF_FILE

 RCDIR=			${PREFIX}/share/roundcube
 EGDIR=			${PREFIX}/share/examples/roundcube
@@ -83,8 +80,6 @@
 			${WWW_USER} ${WWW_GROUP} 0640
 .endfor

-.include "../../mk/apache.mk"
-
 SUBST_CLASSES+=		files
 SUBST_STAGE.files=	do-configure
 SUBST_MESSAGE.files=	Fixing configuration files.
@@ -98,12 +93,6 @@
SUBST_SED.files+= -e "s|@PKG_EXAMPLES@|${PREFIX}/share/examples/roundcube|g"
 SUBST_SED.files+=	-e "s|@PKG_SYSCONFBASE@|${PKG_SYSCONFBASE}|g"
 SUBST_SED.files+=	-e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
-.if ${PKG_APACHE} == "apache24"
-SUBST_SED.files+=	-e "/Order allow,deny/d"
-SUBST_SED.files+=	-e "/Order deny,allow/d"
-SUBST_SED.files+=	-e "s,Allow from all,Require all granted,g"
-SUBST_SED.files+=	-e "s,Deny from all,Require all denied,g"
-.endif

 REPLACE_INTERPRETER+=	php
 REPLACE.php.old=	/usr/bin/env php
@@ -113,7 +102,7 @@
 REPLACE_PYTHON=		plugins/password/helpers/chpass-wrapper.py

 post-extract:
-	${CP} ${FILESDIR}/roundcube.conf ${WRKSRC}/roundcube.conf
+	${CP} ${FILESDIR}/${WWW_CONF_FILE} ${WRKSRC}/roundcube.conf

 do-install:
 	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DESTDIR}${DOCDIR}
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mail/roundcube/options.mk,v
retrieving revision 1.10
diff -u -r1.10 options.mk
--- options.mk	17 Jun 2015 08:35:45 -0000	1.10
+++ options.mk	9 Jul 2015 12:50:28 -0000
@@ -2,12 +2,13 @@

 PKG_OPTIONS_VAR=		PKG_OPTIONS.roundcube

-PKG_OPTIONS_REQUIRED_GROUPS=	db converters
+PKG_OPTIONS_REQUIRED_GROUPS=	db converters webserver
 PKG_OPTIONS_GROUP.db=		mysql pgsql sqlite
 PKG_OPTIONS_GROUP.converters=	iconv multibyte
+PKG_OPTIONS_GROUP.webserver=	apache nginx

 PKG_SUPPORTED_OPTIONS=		ldap sockets gd
-PKG_SUGGESTED_OPTIONS=		mysql iconv sockets gd
+PKG_SUGGESTED_OPTIONS=		mysql iconv apache sockets gd

 .include "../../mk/bsd.options.mk"

@@ -47,6 +48,34 @@
 .endif

 ###
+### Use apache web server
+###
+.if !empty(PKG_OPTIONS:Mapache)
+WWW_USER?=              ${APACHE_USER}
+WWW_GROUP?=             ${APACHE_GROUP}
+BUILD_DEFS+=		APACHE_USER APACHE_GROUP
+WWW_CONF_FILE?=		apache.conf
+.include "../../mk/apache.mk"
+.if ${PKG_APACHE} == "apache24"
+SUBST_SED.files+=	-e "/Order allow,deny/d"
+SUBST_SED.files+=	-e "/Order deny,allow/d"
+SUBST_SED.files+=	-e "s,Allow from all,Require all granted,g"
+SUBST_SED.files+=	-e "s,Deny from all,Require all denied,g"
+.endif
+.endif
+
+###
+### Use apache web server
+###
+.if !empty(PKG_OPTIONS:Mnginx)
+DEPENDS+=	nginx-[0-9]*:../../www/nginx
+DEPENDS+=	${PHP_PKG_PREFIX}-fpm-[0-9]*:../../www/php-fpm
+WWW_USER?=		nginx
+WWW_GROUP?=		nginx
+WWW_CONF_FILE?=		nginx.conf
+.endif
+
+###
 ### Use OpenLDAP for storing data.
 ###
 .if !empty(PKG_OPTIONS:Mldap)
Index: files/apache.conf
===================================================================
RCS file: files/apache.conf
diff -N files/apache.conf
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/apache.conf	9 Jul 2015 12:50:28 -0000
@@ -0,0 +1,29 @@
+# $NetBSD: roundcube.conf,v 1.6 2013/06/15 16:08:09 taca Exp $
+#
+# RoundCube configuration file fragment for Apache
+
+<IfModule mod_alias.c>
+    Alias /roundcube "@RCDIR@/"
+</IfModule>
+
+# Don't forget to adapt the configuration in @RCDIR@/.htaccess
+# to your liking.
+<Directory "@RCDIR@">
+    AllowOverride All
+    DirectoryIndex index.php
+    Order allow,deny
+    Allow from all
+</Directory>
+
+#
+# For security, don't serve pages from the roundcube installer directory.
+#
+# If you are using the installer to setup roundcube you will need access to +# the installer/ directory for the initial setup. It is recommended that +# after installation you uncomment the following block in order to restrict
+# access to that directory.
+#
+#<Directory "@RCDIR@/installer">
+#    Order deny,allow
+#    Deny from all
+#</Directory>
Index: files/nginx.conf
===================================================================
RCS file: files/nginx.conf
diff -N files/nginx.conf
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/nginx.conf	9 Jul 2015 12:50:28 -0000
@@ -0,0 +1,14 @@
+# RoundCube configuration file fragment for nginx
+
+server {
+    server_name localhost;
+    root @RCDIR@;
+    index index.php;
+
+    location ~ \.php$ {
+        include @PKG_SYSCONFBASE@/nginx/fastcgi_params;
+        fastcgi_pass localhost:9000;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_index index.php;
+    }
+}
Index: files/roundcube.conf
===================================================================
RCS file: files/roundcube.conf
diff -N files/roundcube.conf
--- files/roundcube.conf	15 Jun 2013 16:08:09 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-# $NetBSD: roundcube.conf,v 1.6 2013/06/15 16:08:09 taca Exp $
-#
-# RoundCube configuration file fragment for Apache
-
-<IfModule mod_alias.c>
-    Alias /roundcube "@RCDIR@/"
-</IfModule>
-
-# Don't forget to adapt the configuration in @RCDIR@/.htaccess
-# to your liking.
-<Directory "@RCDIR@">
-    AllowOverride All
-    DirectoryIndex index.php
-    Order allow,deny
-    Allow from all
-</Directory>
-
-#
-# For security, don't serve pages from the roundcube installer directory.
-#
-# If you are using the installer to setup roundcube you will need access to -# the installer/ directory for the initial setup. It is recommended that -# after installation you uncomment the following block in order to restrict
-# access to that directory.
-#
-#<Directory "@RCDIR@/installer">
-#    Order deny,allow
-#    Deny from all
-#</Directory>


Home | Main Index | Thread Index | Old Index