summaryrefslogblamecommitdiff
path: root/mail/elm+ME/Makefile
blob: 8ade8b4b3fc59a7509d81fba1a180e4e867def9b (plain) (tree)
1
2
3
4
5
6
7
8
9


                                                                
 
           
 
 
                      
                                                                     
                    
                                                    

                                 
                                             
                                            
                                                            

                                                                       



                                                                          
                                                                  


                                                                                
 
                               
                            
                           
 
                                           
                                                                
 
                                                       
 





                                                                   

                  
 

                                                        
                   
                   
 
                                 

                                                                    

                               
                                                            

                                 


                                           

                                                                         

                                                                     


                                                                      

                                                    


                 
                   
                  
                 

                     
                                                                   

                                               






                                                     


                                                                               




                           



                                       
 

                          
                             


                                

                                                
                                              
                                            


                                                               


            



                                                                             


                                                          
                                                                
 
                                                                            
                                                                       
                                                                          
             
                                                  

                                                         
 
                
                                                                          
 














                                                                     


              
                                                       



                                                           

                                                     
                      
                                                           

                  

                                          

                        
                            
                         

                                                     


       
                   




























                                                                                






                                                                       
                                                             
                       



                                                             
 
                    
                     





                                                            
                     






                                                            







                                             
                                             

                                            

                        




                                                               
# New ports collection makefile for:	elm ME+ (unofficial Elm)
# Date created:		26 June 1995
# Whom:			ache
#
# $FreeBSD$
#

PORTNAME=	elm+ME
PORTVERSION=	${ELM_VERSION}.${ELM_REVISION}${ELM_PATCHLEVEL:S/_//}
CATEGORIES=	mail
DISTNAME=	elm-${ELM_VERSION}ME+${ELM_REVISION}

# here are the main repositories.
MASTER_SITES=	ftp://ftp.ozone.fmi.fi/KEH/ \
		http://www.ozone.fmi.fi/KEH/
# the following repositories conform to the main repository.
MASTER_SITES+=	ftp://ftp.lip6.fr/pub/unix/mail/elm-me/ \
		ftp://ftp.tu-darmstadt.de/pub/networking/mail/elm+ME/ \
		ftp://ftp.cs.tu-berlin.de/pub/net/mail/elm-me-plus/ \
		ftp://ftp.ntua.gr/pub/net/mail/elm-me/ \
		ftp://ftp.eos.hokudai.ac.jp/pub/network/mail/elm-2.4ME+/ \
		ftp://ftp.win.ne.jp/pub/network/mail/elm-2.4ME+/
# the following repositories maybe conform to the main repository.
# MASTER_SITES+=	ftp://ftp.unina.it/pub/Unix/pkgs/network/mail/elm-me+/ \
# 		ftp://ftp.rge.com/pub/mail/elm/elm-2.4ME+/ \
# 		ftp://ftp.uni-trier.de/pub/unix/network/mail/elm-me+/

PATCH_SITES=	${MASTER_SITES}
PATCHFILES=	# see below.
PATCH_DIST_STRIP=	-p1

MAINTAINER=	cyrille.lefevre@laposte.net
COMMENT=	A once-popular mail user agent, unofficial clone

LIB_DEPENDS=	iconv.3:${PORTSDIR}/converters/libiconv

# not needed since config.sh is generated by scripts/pre-configure.
# BUILD_DEPENDS=	ispell:${PORTSDIR}/textproc/ispell
# BUILD_DEPENDS=	metamail:${PORTSDIR}/mail/metamail
# BUILD_DEPENDS=	pgp:${PORTSDIR}/security/pgp
# BUILD_DEPENDS=	gpg:${PORTSDIR}/security/gnupg

# Global variables
#

WRKSRC=		${WRKDIR}/${DISTNAME:S/-//:S/ME+/.ME+./}

HAS_CONFIGURE=	yes
USE_REINPLACE=	yes

CONFIGURE_SCRIPT=	Configure
SCRIPTS_ENV=	CFLAGS="${CFLAGS}" ${PLIST_SUB} PREFIX="${PREFIX}" \
		LOCALBASE="${LOCALBASE}" MAN1PREFIX="${MAN1PREFIX}"
CONFIGURE_ARGS=	-S -P ${PREFIX}

MAKE_ENV=	MJ="FORMATTER=groff FORMATTER_OPTS=-Tlatin1"
ALL_TARGET=	all documentation

INSTALLS_SHLIB=	yes
LDCONFIG_DIRS=	%%PREFIX%%/%%SHLIB_SUBDIR%%

PLIST_SUB=	SO_REV="${SO_REV}" DOC_SUBDIR="${DOC_SUBDIR}" \
		LIB_SUBDIR="${LIB_SUBDIR}" SHLIB_SUBDIR="${SHLIB_SUBDIR}"

MAN1=		answer.1 checkalias.1 elm.1 elmalias.1 elmcharset.1 \
		elmrc-write.1 elmstringconvert.1 elmterminal.1 \
		elmunidata.1 fastmail.1 frm.1 listalias.1 messages.1 \
		newalias.1 newmail.1 printmail.1 readmsg.1
MLINKS=		frm.1 nfrm.1	newmail.1 wnewmail.1

# Local variables
#

ELM_VERSION=	2.4
ELM_REVISION=	99
ELM_PATCHLEVEL=	f

ELM_PATCHDONE=	false
.for level in _ a b c d e f g h i j k l m n o p q r s t u v w x y z
_level=${level}
.if ${_level} != _ && ${ELM_PATCHDONE} == false
PATCHFILES+=	${DISTNAME:S/+/+PL/}${level}.patch.gz
.endif
.if ${ELM_PATCHLEVEL} == ${level}
ELM_PATCHDONE=	true
.endif
.endfor

# evaluation should be protected 'til extraction to avoid noisy messages.
SO_REV=		$$([ -f ${WRKSRC}/hdrs/patchlevel.h ] && \
		  ${AWK} '/SHAREDTAG:/{print $$2}' ${WRKSRC}/hdrs/patchlevel.h)
MSECS=		1

RCD_SUBDIR=	etc/rc.d
LIB_SUBDIR=	lib/elm
SHLIB_SUBDIR=	libexec/elm
DOC_SUBDIR=	share/doc/elm+ME

RCD_DIR=	${PREFIX}/${RCD_SUBDIR}
LIB_DIR=	${PREFIX}/${LIB_SUBDIR}

_RCD_FILE=	00elm.sh
RCD_FILE=	000.elm.sh
MIME_TYPES=	elm.mimetypes
MIME_CSETS=	elm.mimecharsets
TERM_INFO=	elm.terminalinfo
ELM_RC=		elm.rc
DOC_FILES=	README.ME+ \
		shared_libs/iconv/README.ICONV \
		shared_libs/smtp/README.SMTP \
		shared_libs/tls/README.TLS \
		doc/Alias.fmtd doc/Config.fmtd doc/Cover.fmtd \
		doc/Form.fmtd doc/Ref.fmtd doc/Users.fmtd

# Post-patch
#

post-patch: fix-permissions patch-install-script patch-setgid patch-nls-files

fix-permissions:
	@${CHMOD} -R u+w ${WRKSRC}

patch-install-script:
	@${SED} -e 's,%%SHLIB_SUBDIR%%,${SHLIB_SUBDIR},' \
		${FILESDIR}/${_RCD_FILE} > ${WRKSRC}/${RCD_FILE}

# d_savegrpmboxid is currently broken using setgid(2) instead of setegid(2).
# will probably be fixed in a next release, for instance, fake a patch.
# the alternative would be to disable this option in pre-configure script.
patch-setgid:
	@${REINPLACE_CMD} -e 's|setgid|setegid|' \
		${WRKSRC}/lib/localmbx.c \
		${WRKSRC}/src/init.c ${WRKSRC}/src/lock.c

patch-nls-files:
	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/nls/LANGS

# Pre-install
#

pre-install: backup-mime-charsets backup-terminal-info

backup-mime-charsets:
.if exists(${LIB_DIR}/${MIME_CSETS})
	@${MV} ${LIB_DIR}/${MIME_CSETS} ${LIB_DIR}/${MIME_CSETS}.orig
.endif

backup-terminal-info:
.if exists(${LIB_DIR}/${TERM_INFO})
	@${MV} ${LIB_DIR}/${TERM_INFO} ${LIB_DIR}/${TERM_INFO}.orig
.endif

# Post-install
#

post-install: install-startup-files install-nls-files \
	      install-doc-files install-mime-types \
	      install-mime-charsets restore-mime-charsets \
	      install-terminal-info restore-terminal-info \
	      install-global-rc-file \
	      remove-catman-files remove-catman-links

install-startup-files:
	@${INSTALL_SCRIPT} ${WRKSRC}/${RCD_FILE} ${RCD_DIR}

install-nls-files:
	@cd ${WRKSRC}/nls; ${MAKE} install

install-doc-files:
.if !defined(NOPORTSDOC)
	@${MKDIR} ${DOCSDIR}
.for file in ${DOC_FILES}
	@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
	@${GZIP_CMD} ${DOCSDIR}/${file:T}
.endfor
.endif

install-mime-types:
	@${INSTALL_DATA} ${FILESDIR}/${MIME_TYPES} ${LIB_DIR}/${MIME_TYPES}-dist
.if !exists(${LIB_DIR}/${MIME_TYPES})
	@${INSTALL_DATA} ${FILESDIR}/${MIME_TYPES} ${LIB_DIR}
.endif

install-mime-charsets:
	@${INSTALL_DATA} ${LIB_DIR}/${MIME_CSETS} ${LIB_DIR}/${MIME_CSETS}-dist
# was
# 	@${LIB_DIR}/elmcharset -G \
# 		-I ${WRKSRC}/ConfTool/killsets \
# 		-S ${WRKSRC}/charset/MAPPING/ISO8859 \
# 		-w ${LIB_DIR}/${MIME_CSETS}-dist \
# 		${WRKSRC}/bin/${MIME_CSETS}

restore-mime-charsets:
.if exists(${LIB_DIR}/${MIME_CSETS}.orig)
	@${MV} ${LIB_DIR}/${MIME_CSETS}.orig ${LIB_DIR}/${MIME_CSETS}
.endif

install-terminal-info:
	@${INSTALL_DATA} ${LIB_DIR}/${TERM_INFO} ${LIB_DIR}/${TERM_INFO}-dist
# was
# 	@${LIB_DIR}/elmterminal -G \
# 		-w ${LIB_DIR}/${TERM_INFO}-dist \
# 		${WRKSRC}/bin/${TERM_INFO}

restore-terminal-info:
.if exists(${LIB_DIR}/${TERM_INFO}.orig)
	@${MV} ${LIB_DIR}/${TERM_INFO}.orig ${LIB_DIR}/${TERM_INFO}
.endif

# at installation time, elm already has merged changes to the global
# rc file.  so, the only way to generate a -dist rc file is to
# backup the original rc file, then to generate the -dist rc file
# and to restore the backuped rc file. this allow us, at deinstallation
# time, to not delete an existing customized rc file.
# same assertion about elm.mimecharsets and elm.terminalinfo.
install-global-rc-file:
	@${MV} ${LIB_DIR}/${ELM_RC} ${LIB_DIR}/${ELM_RC}.orig
	@${LIB_DIR}/elmrc-write -G -I
	@${MV} ${LIB_DIR}/${ELM_RC} ${LIB_DIR}/${ELM_RC}-dist
	@${MV} ${LIB_DIR}/${ELM_RC}.orig ${LIB_DIR}/${ELM_RC}

remove-catman-files:
.for sect in ${MSECS}
.for page in ${MAN${sect}}
	@${RM} -f ${MAN${sect}PREFIX}/man/cat${sect}/${page}
.endfor
.endfor

remove-catman-links:
.for sect in ${MSECS}
.for page in ${MLINKS}
.if ${MAN${sect}:M${page}} == ""
	@${RM} -f ${MAN${sect}PREFIX}/man/cat${sect}/${page}
.endif
.endfor
.endfor

.include <bsd.port.pre.mk>

# some sketchy hackery
FETCH_CMD_INTERIOR=	${FETCH_CMD:M*fetch*}

# only enable the hack if FETCH_CMD is fetch
.if !empty(FETCH_CMD_INTERIOR)

# some ftp servers dislike $USER@localhost...
FETCH_ENV=	FTP_PASSWORD=${FTP_PASSWORD}

IFCONFIG?=	ifconfig

HOSTIPADDR=	${IFCONFIG} | ${AWK} '/inet /{print $$2; exit}'
FTP_PASSWORD?=	${USER}@`${HOSTIPADDR}`
.endif

.include <bsd.port.post.mk>