aboutsummaryrefslogtreecommitdiffstats
path: root/devel/gitolite/Makefile
blob: 848a6fe859bf05dbe8d1b8e1e1763da1c616e884 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# New ports collection makefile for:    gitolite
# Date created:             07-28-2011
# Whom:                 milki <milki@rescomp.berkeley.edu>
#
# $FreeBSD$
#

PORTNAME=   gitolite
PORTVERSION=    2.0.3
CATEGORIES= devel
MASTER_SITES=   http://milki.github.com/${PORTNAME}/ \
        LOCAL/tdb

MAINTAINER= milki@rescomp.berkeley.edu
COMMENT=    An access control layer on top of git

LICENSE=    GPLv2

RUN_DEPENDS=    git>=0:${PORTSDIR}/devel/git

USE_PERL5=  yes

SUB_FILES=  pkg-message

OPTIONS=    GITUSER "Create git user as gitolite provider" On

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_GITUSER)
USERS=      git
GROUPS=     ${USERS}
PLIST_SUB+= GITUSER=""
.else
PLIST_SUB+= GITUSER="@comment "
.endif

GLAUTHCOMMAND=  \
\#!/bin/sh\n \
exec ${PREFIX}/libexec/gitolite/gl-auth-command \"\$$@\"\n

GLSETUP=    \
\#!/bin/sh\n \
exec ${PREFIX}/libexec/gitolite/gl-setup \"\$$@\"\n

post-patch:
    @${ECHO} -e "${GLAUTHCOMMAND}" > ${WRKDIR}/auth-command
    @${ECHO} -e "${GLSETUP}" > ${WRKDIR}/setup
.for FILE in gl-admin-push gl-auth-command gl-compile-conf gl-conf-convert gl-mirror-shell gl-mirror-sync gl-query-rc gl-setup gl-setup-authkeys gl-time gl-tool sshkeys-lint
    @${REINPLACE_CMD} \
        -Ee '1s|#!/usr/bin/perl|#!${PERL}|' \
        ${WRKSRC}/src/${FILE}
.endfor
    @${REINPLACE_CMD} \
        -Ee '1s|#!/usr/bin/perl|#!${PERL}|' \
        ${WRKSRC}/hooks/common/update

do-build:
    -@${RM} ${WRKSRC}/src/gl-easy-install
    -@${RM} ${WRKSRC}/src/gl-system-install
    @${REINPLACE_CMD} \
        -E 's%^GL_PACKAGE_CONF=.*%GL_PACKAGE_CONF=${DATADIR}/conf;%' \
        ${WRKSRC}/src/gl-setup
    @${REINPLACE_CMD} \
        -E "s%^#[[:blank:]]*\\\$$GL_PACKAGE_CONF[[:blank:]]*=.*%\$$GL_PACKAGE_CONF = '${DATADIR}/conf';%" \
        ${WRKSRC}/conf/example.gitolite.rc
    @${REINPLACE_CMD} \
        -E "s%^#[[:blank:]]*\\\$$GL_PACKAGE_HOOKS[[:blank:]]*=.*%\$$GL_PACKAGE_HOOKS = '${DATADIR}/hooks';%" \
        ${WRKSRC}/conf/example.gitolite.rc

post-build:
    @${FIND} ${WRKSRC} -name "*.bak" -delete
    @${FIND} ${WRKSRC} -name "*.orig" -delete

do-install:
    ${MKDIR} ${PREFIX}/libexec/gitolite
    ${INSTALL_SCRIPT} ${WRKSRC}/src/* ${PREFIX}/libexec/gitolite/
    ${MKDIR} ${DATADIR}/conf
    ${INSTALL_DATA} ${WRKSRC}/conf/* ${DATADIR}/conf
    ${MKDIR} ${DATADIR}/hooks
    (cd ${WRKSRC}/hooks && ${COPYTREE_BIN} \* ${DATADIR}/hooks)
    ${INSTALL_SCRIPT} ${WRKDIR}/auth-command ${PREFIX}/bin/gl-auth-command
    ${INSTALL_SCRIPT} ${WRKDIR}/setup ${PREFIX}/bin/gl-setup

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>