View | Details | Raw Unified | Return to bug 120505 | Differences between
and this patch

Collapse All | Expand All

(-)phpldapadmin098/Makefile (-29 / +55 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	phpldapadmin098
8
PORTNAME=	phpldapadmin098
9
PORTVERSION=	0.9.8.4
9
PORTVERSION=	0.9.8.4
10
PORTREVISION=	1
10
PORTEPOCH=	1
11
PORTEPOCH=	1
11
CATEGORIES=	net www
12
CATEGORIES=	net www
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
Lines 20-57 Link Here
20
USE_PHP=	gettext ldap openssl pcre session
21
USE_PHP=	gettext ldap openssl pcre session
21
DEFAULT_PHP_VER=	4
22
DEFAULT_PHP_VER=	4
22
23
23
.if defined(WITH_SUPHP)
24
.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
24
25
25
PKGNAMESUFFIX+=	-suphp
26
PKGNAMESUFFIX+=	-suphp
26
RUN_DEPENDS+=	${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
27
RUN_DEPENDS+=	${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
27
WANT_PHP_CGI=	yes
28
WANT_PHP_CGI=	yes
28
29
29
PLAUSR?=	pldapadm
30
31
SUB_LIST+=	PLAUSR=${PLAUSR} \
32
		PLAGRP=${PLAGRP}
33
SUB_FILES+=	pkg-install  pkg-deinstall
34
35
.else
30
.else
36
31
37
WANT_PHP_WEB=	yes
32
WANT_PHP_WEB=	yes
38
33
39
.endif
34
.endif
40
35
41
# PLAUSR is only used WITH_SUPHP
36
# PLA_USR is only used WITH_SUPHP
42
PLADIR?=	www/${PORTNAME}
37
PLA_GRP?=	${WWWGRP}
43
PLADIRX?=	${PLADIR:S/098//}
38
PLA_GID?=	${_PLA_GID}
44
PLAGRP?=	${WWWGRP}
45
CFGDIR=		config
39
CFGDIR=		config
46
CFGFILE=	config.php
40
CFGFILE=	config.php
47
41
48
SUB_LIST+=	PKGNAME=${PKGNAME} \
42
PLIST=		${WRKDIR}/plist
49
		PLADIR=${PLADIR}   \
43
PLIST_SUB+=	PLA_GRP=${PLA_GRP}
50
		PLADIRX=${PLADIRX}
44
45
.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
46
47
PLA_USR?=	_pla
48
PLA_UID?=	636
49
PLA_GCOS?=	"phpLDAPAdmin Owner"
50
PLA_HOME?=	/nonexistent
51
PLA_SHELL?=	/usr/sbin/nologin
52
53
SUB_LIST+=	PLA_USR=${PLA_USR}    \
54
		PLA_UID=${PLA_UID}    \
55
		PLA_GRP=${PLA_GRP}    \
56
		PLA_GID=${PLA_GID}    \
57
		PLA_GCOS=${PLA_GCOS}  \
58
		PLA_HOME=${PLA_HOME}  \
59
		PLA_SHELL=${PLA_SHELL}
60
SUB_FILES+=	pkg-install pkg-deinstall
61
62
.endif
63
64
SUB_LIST+=	PKGNAME=${PKGNAME}
51
SUB_FILES+=	pkg-message
65
SUB_FILES+=	pkg-message
52
66
53
PLIST=		${WRKDIR}/plist
67
.include <bsd.port.pre.mk>
54
PLIST_SUB+=	PLADIR=${PLADIR} PLAGRP=${PLAGRP}
68
_PLA_GID!=	/usr/sbin/pw group show -n ${PLA_GRP} | ${CUT} -d : -f 3
69
.if empty(_PLA_GID)
70
_PLA_GID=	80
71
.endif
55
72
56
.SILENT:
73
.SILENT:
57
74
Lines 66-81 Link Here
66
	${ECHO_MSG} "However, for best results with PHP5 please use the"
83
	${ECHO_MSG} "However, for best results with PHP5 please use the"
67
	${ECHO_MSG} "net/phpldapadmin port instead."
84
	${ECHO_MSG} "net/phpldapadmin port instead."
68
	${ECHO_MSG} ""
85
	${ECHO_MSG} ""
86
.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
87
	@if /usr/sbin/pw show -n pldapadm >/dev/null 2>&1 ; then	      \
88
	    ${ECHO_MSG} "===> WARNING ******************************" ;	      \
89
	    ${ECHO_MSG} "The default username used by ${PKNAME} has changed"; \
90
	    ${ECHO_MSG} "to ${PLA_USR} -- you should delete the old user:" ;  \
91
	    ${ECHO_MSG} "  # /usr/sbin/pw user del -n pldapadm" ;	      \
92
	    ${ECHO_MSG} "" ;						      \
93
	fi
94
.endif
69
95
70
post-patch:
96
post-patch:
71
	cd ${WRKSRC} ;                                                      \
97
	cd ${WRKSRC} ;							    \
72
	${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
98
	${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
73
	    ${SORT} | ${SED} -e "s!^\.!%%PLADIR%%!"             >${PLIST} ; \
99
	    ${SORT} | ${SED} -e "s!^\.!%%WWWDIR%%!"		>${PLIST} ; \
74
	${CAT} ${PKGDIR}/pkg-plist-chunk                       >>${PLIST} ; \
100
	${CAT} ${PKGDIR}/pkg-plist-chunk		       >>${PLIST} ; \
75
	${FIND} . -type d | ${SORT} -r | ${SED}                             \
101
	${FIND} . -type d | ${SORT} -r | ${SED}				    \
76
	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%PLADIR%%/${CFGDIR}!'          \
102
	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%WWWDIR%%/${CFGDIR}!'	    \
77
	    -e 's!^\.$$!@dirrmtry %%PLADIR%%!'                              \
103
	    -e 's!^\.$$!@dirrmtry %%WWWDIR%%!'				    \
78
	    -e 's!^\.!@dirrm %%PLADIR%%!'                      >>${PLIST}
104
	    -e 's!^\.!@dirrm %%WWWDIR%%!'		       >>${PLIST}
79
105
80
pre-install:
106
pre-install:
81
.if defined(WITH_SUPHP)
107
.if defined(WITH_SUPHP)
Lines 87-104 Link Here
87
install-app:
113
install-app:
88
	cd ${WRKSRC} ; \
114
	cd ${WRKSRC} ; \
89
	for src in $$( ${FIND} . ! -name .cvsignore  ) ; do \
115
	for src in $$( ${FIND} . ! -name .cvsignore  ) ; do \
90
	    dst=${PREFIX}/${PLADIR}$${src#.} ; \
116
	    dst=${WWWDIR}$${src#.} ; \
91
	    if ${TEST} -d $$src ; then \
117
	    if ${TEST} -d $$src ; then \
92
	        ${MKDIR} $$dst ; \
118
		${MKDIR} $$dst ; \
93
	    else \
119
	    else \
94
	        ${INSTALL_DATA} $$src $$dst ; \
120
		${INSTALL_DATA} $$src $$dst ; \
95
	    fi \
121
	    fi \
96
	done
122
	done
97
123
98
install-conf:
124
install-conf:
99
	cd ${PREFIX}/${PLADIR}/${CFGDIR} ; \
125
	cd ${WWWDIR}/${CFGDIR} ; \
100
	${CHMOD} 0640 ${CFGFILE}.example ; \
126
	${CHMOD} 0640 ${CFGFILE}.example ; \
101
	${CHGRP} ${PLAGRP} ${CFGFILE}.example ; \
127
	${CHGRP} ${PLA_GRP} ${CFGFILE}.example ; \
102
	if ${TEST} ! -f ${CFGFILE} ; then \
128
	if ${TEST} ! -f ${CFGFILE} ; then \
103
	    ${CP} -p ${CFGFILE}.example ${CFGFILE} ; \
129
	    ${CP} -p ${CFGFILE}.example ${CFGFILE} ; \
104
	fi
130
	fi
Lines 109-112 Link Here
109
.endif
135
.endif
110
	${CAT} ${PKGMESSAGE}
136
	${CAT} ${PKGMESSAGE}
111
137
112
.include <bsd.port.mk>
138
.include <bsd.port.post.mk>
(-)phpldapadmin098/files/pkg-deinstall.in (-4 / +4 lines)
Lines 9-21 Link Here
9
The phpldapadmin-suphp port has been deleted.
9
The phpldapadmin-suphp port has been deleted.
10
If you are not upgrading and don't intend to use
10
If you are not upgrading and don't intend to use
11
phpLDAPadmin any more then you may wish to delete
11
phpLDAPadmin any more then you may wish to delete
12
the %%PLAUSR%% account, which can be done with
12
the %%PLA_USR%% account, which can be done with
13
the following command:
13
the following command:
14
14
15
    # pw userdel %%PLAUSR%%
15
    # pw userdel %%PLA_USR%%
16
EOMSG
16
EOMSG
17
    if [ -d %%PREFIX%%/%%PLADIR%% ] ; then
17
    if [ -d %%WWWDIR%% ] ; then
18
	echo "    # rm -rf %%PREFIX%%/%%PLADIR%%/"
18
	echo "    # rm -rf %%WWWDIR%%/"
19
    fi
19
    fi
20
    echo
20
    echo
21
    ;;
21
    ;;
(-)phpldapadmin098/files/pkg-install.in (-54 / +66 lines)
Lines 1-70 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# $FreeBSD: ports/net/phpldapadmin098/files/pkg-install.in,v 1.1 2005/12/11 23:51:12 lawrance Exp $
3
# $FreeBSD$
4
#
4
#
5
5
6
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
6
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
7
7
8
pladir=%%PREFIX%%/%%PLADIR%%
8
pla_dir=%%WWWDIR%%
9
plausr=%%PLAUSR%%
9
pla_usr=%%PLA_USR%%
10
plagrp=%%PLAGRP%%
10
pla_uid=%%PLA_UID%%
11
11
pla_grp=%%PLA_GRP%%
12
plagcos="phpLDAPadmin Owner"
12
pla_gid=%%PLA_GID%%
13
plahome=/nonexistent
13
14
plashell=/sbin/nologin
14
pla_gcos="%%PLA_GCOS%%"
15
pla_home=%%PLA_HOME%%
16
pla_shell=%%PLA_SHELL%%
15
17
16
create_group() {
18
create_group() {
17
    local user group gcos home shell
19
    local user uid group gid gcos home shell
18
20
19
    user=$1
21
    user=$1
20
    group=$2
22
    uid=$2
21
    gcos=$3
23
    group=$3
22
    home=$4
24
    gid=$4
23
    shell=$5
25
    gcos=$5
26
    home=$6
27
    shell=$7
24
28
25
    if pw groupadd -n $group ; then
29
26
	echo "===> Group $group created"
30
    if pw group show -n $group >/dev/null 2>&1 ; then
31
	echo "===> Using pre-existing group $group"
27
    else
32
    else
28
	cat <<-EOERRORMSG
33
	if pw groupadd -n $group -g $gid ; then
29
	*** Failed to create the $group group.
34
	    echo "===> Group $group created"
35
	else
36
	    cat <<-EOERRORMSG
37
 		*** Failed to create the $group group.
30
38
31
	Please add the $user user and $group group
39
		Please add the $user user and $group group
32
	manually with the commands:
40
		manually with the commands:
41
42
		    pw groupadd -n $group -g $gid
43
		    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
44
		        -d $home -s $shell -h -
33
45
34
	    pw groupadd -n $group
46
		and retry installing this package.
35
	    pw useradd -n $user -g $group -c "$gcos" \\
47
		EOERRORMSG
36
	        -d $home -s $shell -h -
48
	    exit 1
37
	    
49
	fi
38
	and retry installing this package.
39
	EOERRORMSG
40
	exit 1
41
    fi
50
    fi
51
42
}
52
}
43
53
44
54
45
create_user() {
55
create_user() {
46
    local user group gcos home shell
56
    local user uid group gid gcos home shell
47
57
48
    user=$1
58
    user=$1
49
    group=$2
59
    uid=$2
50
    gcos=$3
60
    group=$3
51
    home=$4
61
    gid=$4
52
    shell=$5
62
    gcos=$5
63
    home=$6
64
    shell=$7
53
65
54
    if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then
66
    if pw user show -n $user >/dev/null 2>&1 ; then
55
	echo "===> Created $user user"
67
	echo "===> Using pre-existing user $user"
56
    else
68
    else
57
	cat <<-EOERRORMSG
69
	if pw useradd -n $user -u $uid -g $group -c "$gcos" \
58
	*** Failed to create the $user user.
70
	    -d $home -s $shell -h - ; then
71
	    echo "===> Created $user user"
72
	else
73
	    cat <<-EOERRORMSG
74
		*** Failed to create the $user user.
59
75
60
	Please add the $user user manually with the command:
76
		Please add the $user user manually with the command:
61
77
62
	    pw useradd -n $user -g $group -c "$gcos" \\
78
		    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
63
		        -d $home -s $shell -h -
79
		       -d $home -s $shell -h -
64
80
65
	and retry installing this package.
81
		and retry installing this package.
66
	EOERRORMSG
82
		EOERRORMSG
67
	exit 1
83
	    exit 1
84
	fi
68
    fi
85
    fi
69
}
86
}
70
87
Lines 73-95 Link Here
73
    PRE-INSTALL)
90
    PRE-INSTALL)
74
91
75
        # Create the pla user and group if they do not already exist
92
        # Create the pla user and group if they do not already exist
76
93
	create_group $pla_usr $pla_uid $pla_grp $pla_gid \
77
        if pw user show -n $plausr >/dev/null 2>&1 ; then
94
                     "$pla_gcos" $pla_home $pla_shell
78
	    echo "===> Using pre-existing user $plausr"
95
	create_user  $pla_usr $pla_uid $pla_grp $pla_gid \
79
	else
96
                     "$pla_gcos" $pla_home $pla_shell
80
	    if ! pw group show -n $plagrp >/dev/null 2>&1 ; then
81
		create_group $plausr $plagrp "$plagcos" $plahome \
82
		    $plashell
83
	    fi
84
	    create_user $plausr $plagrp "$plagcos" $plahome $plashell
85
	fi
86
	;;
97
	;;
98
87
    POST-INSTALL)
99
    POST-INSTALL)
88
100
89
    	# Change ownership of the phpLDAPadmin directory
101
    	# Change ownership of the phpMyAdm directory
90
102
91
        echo "===> Adjusting file ownership in $pladir"
103
        echo "===> Adjusting file ownership in $pla_dir"
92
        chown -R $plausr:$plagrp $pladir || exit 1
104
        chown -R $pla_usr:$pla_grp $pla_dir || exit 1
93
	;;
105
	;;
94
esac
106
esac
95
107
(-)phpldapadmin098/files/pkg-message.in (-5 / +5 lines)
Lines 1-16 Link Here
1
1
2
%%PKGNAME%% has been installed into:
2
%%PKGNAME%% has been installed into:
3
3
4
    %%PREFIX%%/%%PLADIR%%
4
    %%WWWDIR%%
5
5
6
Please edit config.php to suit your needs.
6
Please edit config.php to suit your needs.
7
7
8
To make phpLDAPadmin available through your web site, I suggest that
8
To make phpLDAPadmin available through your web site, I suggest that
9
you add something like the following to httpd.conf:
9
you add something like the following to httpd.conf:
10
10
11
    Alias /phpldapadmin/ "%%PREFIX%%/%%PLADIR%%/htdocs"
11
    Alias /phpldapadmin/ "%%WWWDIR%%/htdocs"
12
12
13
    <Directory "%%PREFIX%%/%%PLADIR%%/htdocs">
13
    <Directory "%%WWWDIR%%/htdocs">
14
        Options none
14
        Options none
15
        AllowOverride none
15
        AllowOverride none
16
16
Lines 24-33 Link Here
24
need to modify your apache configuration and merge the settings from
24
need to modify your apache configuration and merge the settings from
25
your original configuration file:
25
your original configuration file:
26
26
27
    %%PREFIX%%/%%PLADIRX%%/config.php
27
    %%WWWDIR%%/config.php
28
28
29
 to
29
 to
30
30
31
   %%PREFIX%%/%%PLADIR%%/config/config.php
31
    %%WWWDIR%%/config/config.php
32
32
33
33
(-)phpldapadmin098/pkg-plist-chunk (-3 / +3 lines)
Lines 1-7 Link Here
1
@mode 640
1
@mode 640
2
@group %%PLAGRP%%
2
@group %%PLA_GRP%%
3
@unexec if cmp -s %D/%%PLADIR%%/config/config.php.example %D/%%PLADIR%%/config/config.php ; then rm -f %D/%%PLADIR%%/config/config.php ; fi
3
@unexec if cmp -s %D/%%WWWDIR%%/config/config.php.example %D/%%WWWDIR%%/config/config.php ; then rm -f %D/%%WWWDIR%%/config/config.php ; fi
4
%%PLADIR%%/config/config.php.example
4
%%WWWDIR%%/config/config.php.example
5
@exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
5
@exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
6
@mode
6
@mode
7
@group
7
@group

Return to bug 120505