diff options
author | crees <crees@FreeBSD.org> | 2011-08-15 23:12:26 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-08-15 23:12:26 +0800 |
commit | 57011b6f692ac7bc5cf0d63898f446540570fcbb (patch) | |
tree | 0d35e0f847d361e704b66c4916fceedebc584b66 /sysutils | |
parent | ba8ee1a0286e88770ad420607f2f66738a2f9d8f (diff) | |
download | freebsd-ports-gnome-57011b6f692ac7bc5cf0d63898f446540570fcbb.tar.gz freebsd-ports-gnome-57011b6f692ac7bc5cf0d63898f446540570fcbb.tar.zst freebsd-ports-gnome-57011b6f692ac7bc5cf0d63898f446540570fcbb.zip |
- Fix build on 7.x
- While here, fix clang build (CC=gcc)
- Stop clobbering config files
PR: ports/157242
Submitted by: Jesse <jessefrgsmith@yahoo.ca> (maintainer)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/swapexd/Makefile | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sysutils/swapexd/Makefile b/sysutils/swapexd/Makefile index c3656431ca05..513716008c38 100644 --- a/sysutils/swapexd/Makefile +++ b/sysutils/swapexd/Makefile @@ -7,6 +7,7 @@ PORTNAME= swapexd PORTVERSION= 0.3 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://makeapbi.sourceforge.net/${PORTNAME}/ @@ -15,15 +16,32 @@ COMMENT= A tool for growing and shrinking on-disk swap space WRKSRC= ${WRKDIR}/${PORTNAME} -PLIST_FILES= sbin/${PORTNAME} etc/${PORTNAME}.conf etc/rc.d/swapexd +PLIST_FILES= sbin/${PORTNAME} etc/rc.d/swapexd + +.include <bsd.port.pre.mk> post-patch: @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" ${WRKSRC}/rc.d/swapexd @${REINPLACE_CMD} -e "s,/etc/,${PREFIX}/etc/,g" ${WRKSRC}/swapexd.h +.if ${OSVERSION} < 800076 + @${REINPLACE_CMD} -e "s,swapctl -s -m ,swapctl -s -h ,g" ${WRKSRC}/swapexd.c +.endif +# Clang fix + @${REINPLACE_CMD} -e '1s/^CC=.*$$/CC=${CC}/' ${WRKSRC}/${MAKEFILE} do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/sbin/ - ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf + ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf.sample ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/swapexd ${PREFIX}/etc/rc.d -.include <bsd.port.mk> +# Deal with config files -- would be a shame to have to make a pkg-plist this +# small +post-install: + ${ECHO_CMD} '@unexec cmp -s %D/etc/${PORTNAME}.conf.sample %D/etc/${PORTNAME}.conf && rm -f %D/etc/${PORTNAME}.conf || true 2>/dev/null' >> ${TMPPLIST} + ${ECHO_CMD} 'etc/${PORTNAME}.conf.sample' >> ${TMPPLIST} + ${ECHO_CMD} '@exec [ -f %D/etc/${PORTNAME}.conf ] || cp -p %D/%F %B/${PORTNAME}.conf' >> ${TMPPLIST} + [ -f %D/etc/${PORTNAME}.conf ] \ + || ${CP} -p ${PREFIX}/etc/${PORTNAME}.conf.sample \ + ${PREFIX}/etc/${PORTNAME}.conf + +.include <bsd.port.post.mk> |