aboutsummaryrefslogtreecommitdiffstats
path: root/www/sams2/Makefile
blob: daaf45c78dde66f4774f6cf65b2172a6981834d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# $FreeBSD$

PORTNAME=   sams2
DISTVERSION=    2.0.0
PORTREVISION=   2
CATEGORIES= www
MASTER_SITES=   http://sams.perm.ru/download/ http://razumit.ru/

MAINTAINER= roma.a.g@gmail.com
COMMENT=    Squid Accounting Management System

LICENSE=    BSD4CLAUSE

LIB_DEPENDS=    libpcre.so:devel/pcre
RUN_DEPENDS=    ${LOCALBASE}/libexec/mysqld:${_MYSQL_SERVER}

USES=       autoreconf gmake libtool tar:bzip2
USE_LDCONFIG=   yes
USE_PHP=    gd mysql zlib
USE_MYSQL=  yes

GNU_CONFIGURE=  yes
INSTALL_TARGET= install-strip
CONFIGURE_ARGS+=--datarootdir=${WWWDIR:H}
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 ${PORT_OPTIONS:MAPACHE}
.  if ${PHP_VER} == "54" && (${APACHE_VERSION} >= 24)
RUN_DEPENDS+=   mod_php5>=0:www/mod_php5
.  endif
.  if ${PHP_VER} == "55" && (${APACHE_VERSION} >= 24)
RUN_DEPENDS+=   mod_php55>=0:www/mod_php55
.  endif
.  if ${APACHE_VERSION} >= 24
AP24=       ""
.  endif
.endif

post-patch:
    @${MV} ${WRKSRC}/m4/acinclude.m4 ${WRKSRC}

post-install:
    ${INSTALL_SCRIPT} ${FILESDIR}/sams2 ${STAGEDIR}${PREFIX}/etc/rc.d/
    ${INSTALL_DATA} ${WRKDIR}/sams2.conf.sample ${STAGEDIR}${PREFIX}/etc
.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>