www/sams2: Fix some issues, especially apache22

There were a number of issues with the first version of sams2.  The
pkg-plist still had a bad "make makeplist" variable ("24" was wrongly
converted to %%APACHE_VERSION%%).  There was also a typo on a PLIST
substitution but this has been completely removed.

This port was converted to options, particularly the APACHE option was
added as a non-default option.  If selected, it will require the
default version of Apache as a dependency and install sample apache
conf files.  Previously the port would scan the whole system and install
conf files in different locations depending on what it found.  Now the
conf file creation is carefully controlled.

Discussed with maintainer.
This commit is contained in:
John Marino 2014-08-25 19:49:16 +00:00
parent 9201f9af74
commit a621ca98fc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=366141
3 changed files with 40 additions and 18 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= sams2
DISTVERSION= 2.0.0
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://sams.perm.ru/download/ http://razumit.ru/
@ -16,7 +17,6 @@ RUN_DEPENDS= ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql${MYSQL_VER}
USES= gmake libtool tar:bzip2
USE_AUTOTOOLS= aclocal libtoolize
USE_LDCONFIG= yes
USE_APACHE= 22+
USE_PHP= gd mysql zlib
USE_MYSQL= yes
@ -28,19 +28,23 @@ MAKE_ARGS+= docdir=${DOCSDIR}
SUB_FILES= sams2.conf.sample
PORTDOCS= *
OPTIONS_DEFINE= DOCS APACHE
OPTIONS_SUB= APACHE
APACHE_USE= APACHE=22+
# We can't use <options> here, ${APACHE*} won't be populated
.include <bsd.port.pre.mk>
.if ${PHP_VER} == "54" && (${APACHE_VERSION} >= 24)
.if ${PORT_OPTIONS:MAPACHE}
. if ${PHP_VER} == "54" && (${APACHE_VERSION} >= 24)
RUN_DEPENDS+= mod_php5>=0:${PORTSDIR}/www/mod_php5
.endif
.if ${PHP_VER} == "55" && (${APACHE_VERSION} >= 24)
. endif
. if ${PHP_VER} == "55" && (${APACHE_VERSION} >= 24)
RUN_DEPENDS+= mod_php55>=0:${PORTSDIR}/www/mod_php55
.endif
.if ${APACHE_VERSION} >= 24
PLIST_SUB+= AP24=""
.else
PLIST_SUB+= AP24="@ comment"
. endif
. if ${APACHE_VERSION} >= 24
AP24= ""
. endif
.endif
do-configure:
@ -51,11 +55,12 @@ do-configure:
post-install:
${INSTALL_SCRIPT} ${FILESDIR}/sams2 ${STAGEDIR}${PREFIX}/etc/rc.d/
${INSTALL_DATA} ${WRKDIR}/sams2.conf.sample ${STAGEDIR}${PREFIX}/etc
.if ${APACHE_VERSION} >= 24
${RM} ${STAGEDIR}${PREFIX}/${APACHEETCDIR}/*.conf-e
(cd ${STAGEDIR}${PREFIX}/${APACHEETCDIR} && \
${MV} doc4sams2.conf doc4sams2.conf.sample && \
${MV} sams2.conf sams2.conf.sample)
.if ${PORT_OPTIONS:MAPACHE}
${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEETCDIR}
${SED} -e 's|__WEBPREFIX|${WWWDIR}|g' ${WRKSRC}/etc/httpd_conf \
> ${STAGEDIR}${PREFIX}/${APACHEETCDIR}/sams2.conf.sample
${SED} -e 's|__DOCPREFIX|${DOCSDIR}|g' ${WRKSRC}/etc/doc_sams2_conf \
> ${STAGEDIR}${PREFIX}/${APACHEETCDIR}/doc4sams2.conf.sample
.endif
.include <bsd.port.post.mk>

View file

@ -0,0 +1,17 @@
--- Makefile.am.orig 2010-11-23 20:18:04 UTC
+++ Makefile.am
@@ -19,14 +19,6 @@ install-data-local:
if [ ! -f $(DESTDIR)/$(sysconfdir)/sams2.conf ] ; then \
$(install_sh) -c -m 644 $(top_srcdir)/etc/sams2.conf $(DESTDIR)/$(sysconfdir) ;\
fi
- if [ ! -f $(DESTDIR)/$(HTTPD_INCLUDE)/sams2.conf ] ; then \
- $(install_sh) -c -m 644 $(top_srcdir)/etc/httpd_conf $(DESTDIR)/$(HTTPD_INCLUDE)/sams2.conf ;\
- sed -i -e 's,__WEBPREFIX,$(datadir)/sams2,g' $(DESTDIR)/$(HTTPD_INCLUDE)/sams2.conf ;\
- fi
- if [ ! -f $(DESTDIR)/$(HTTPD_INCLUDE)/doc4sams2.conf ] ; then \
- $(install_sh) -c -m 644 $(top_srcdir)/etc/doc_sams2_conf $(DESTDIR)/$(HTTPD_INCLUDE)/doc4sams2.conf ;\
- sed -i -e 's,__DOCPREFIX,$(docdir),g' $(DESTDIR)/$(HTTPD_INCLUDE)/doc4sams2.conf ;\
- fi
uninstall-local:

View file

@ -2,8 +2,8 @@ bin/sams2daemon
bin/sams2redir
bin/sams_send_email
bin/samsparser
%%AP24%%@sample %%APACHEETCDIR%%/doc4sams2.conf.sample
%%AP24%%@sample %%APACHEETCDIR%%/sams2.conf.sample
%%APACHE%%@sample %%APACHEETCDIR%%/doc4sams2.conf.sample
%%APACHE%%@sample %%APACHEETCDIR%%/sams2.conf.sample
etc/rc.d/sams2
@sample etc/sams2.conf.sample
lib/sams2/libfsusage.a
@ -219,7 +219,7 @@ lib/sams2/libloadavg.so.1
%%WWWDIR%%/icon/classic/switchuser_32.jpg
%%WWWDIR%%/icon/classic/switchuser_48.jpg
%%WWWDIR%%/icon/classic/sysplug_16.png
%%WWWDIR%%/icon/classic/sysplug_%%APACHE_VERSION%%.png
%%WWWDIR%%/icon/classic/sysplug_24.png
%%WWWDIR%%/icon/classic/sysplug_32.png
%%WWWDIR%%/icon/classic/sysplug_64.png
%%WWWDIR%%/icon/classic/tr_input.gif