aboutsummaryrefslogtreecommitdiffstats
path: root/ftp/net2ftp/Makefile
blob: 10b08f961460536abcf8593611c7e8a5e78c3fb0 (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
# Created by: Alexander Kriventsov
# $FreeBSD$

PORTNAME=   net2ftp
PORTVERSION=    0.98
CATEGORIES= ftp
MASTER_SITES=   http://www.net2ftp.com/download/
DISTNAME=   ${PORTNAME}_v${PORTVERSION}

MAINTAINER= avk@vl.ru
COMMENT=    PHP scripts to work with ftp

USE_ZIP=    YES
NO_BUILD=   YES
.if !defined(WITHOUT_PHP_DEPENDS)
USE_PHP=    ftp mysql pcre session zlib
.endif
#USE_DOS2UNIX=  YES

PLIST=     ${WRKDIR}/plist

CFGFILES=   settings.inc.php settings_authorizations.inc.php settings_screens.inc.php

SUB_LIST+=  PKGNAME=${PKGNAME}
SUB_FILES+= pkg-message

# When creating a package, empty directories will not be generated
# from the pkg tarball.  Therefore make sure no directories are empty.

NO_STAGE=   yes
post-patch:
     @cd ${WRKSRC}/files_to_upload ; \
     for emptydir in $$( ${FIND} . -type d -empty -print ) ; do \
          ${TOUCH} $${emptydir}/.keep-me ; \
     done
     @cd ${WRKSRC}/files_to_upload ; \
     ${FIND} . ! -type d ! -name "settings*.inc.php" | ${SORT} | \
          ${SED} -e "s,^\.,%%WWWDIR%%,"     >${PLIST} ; \
     ${CAT} ${PKGDIR}/pkg-plist-chunk         >>${PLIST} ; \
     ${FIND} . -type d | ${SORT} -r | ${SED} \
          -e "s,^\.$$,@dirrmtry %%WWWDIR%%," \
          -e "s,^\.,@dirrm %%WWWDIR%%,"     >>${PLIST}

do-install: install-app install-conf

install-app:
     @cd ${WRKSRC}/files_to_upload ; \
     for src in $$( ${FIND} . ! -name "settings*.inc.php" ) ; do \
          dst=${WWWDIR}$${src#.} ; \
          if ${TEST} -d $$src ; then \
               ${MKDIR} $$dst ; \
          else \
               ${INSTALL_DATA} $$src $$dst ; \
          fi \
     done

install-conf: install-app
     @cd ${WRKSRC}/files_to_upload ; \
     ${INSTALL_DATA} settings.inc.php ${WWWDIR}/settings.inc.php.sample ; \
     ${INSTALL_DATA} settings_authorizations.inc.php ${WWWDIR}/settings_authorizations.inc.php.sample ; \
     ${INSTALL_DATA} settings_screens.inc.php ${WWWDIR}/settings_screens.inc.php.sample
     @cd ${WWWDIR} ; \
     for CFGFILE in ${CFGFILES} ; do \
          if ${TEST} ! -f $${CFGFILE} ; then \
               ${CP} -p $${CFGFILE}.sample $${CFGFILE} ; \
          fi \
     done

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

.include <bsd.port.mk>