diff options
author | madpilot <madpilot@FreeBSD.org> | 2013-10-22 22:54:01 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2013-10-22 22:54:01 +0800 |
commit | a66c6816a32ecaa522a8a7bf771a1a1b1a83b195 (patch) | |
tree | a6468e198e1a44be0a3a9042405883e83164871c /comms | |
parent | 2b1eb572c6634cb3be8ab1e26cb86f7e26520d29 (diff) | |
download | freebsd-ports-gnome-a66c6816a32ecaa522a8a7bf771a1a1b1a83b195.tar.gz freebsd-ports-gnome-a66c6816a32ecaa522a8a7bf771a1a1b1a83b195.tar.zst freebsd-ports-gnome-a66c6816a32ecaa522a8a7bf771a1a1b1a83b195.zip |
- Convert to staging
- Convert to USES
- Use shebangfix where necessary
- Move most @exec/@unexec commands from plist to pkg-install/pkg-deinstall
scripts
- Make rclint somewhat happier
- Convert to new LIB_DEPENDS format
- Strip binaries
- Take maintainership
Diffstat (limited to 'comms')
-rw-r--r-- | comms/smstools3/Makefile | 56 | ||||
-rw-r--r-- | comms/smstools3/files/patch-Makefile | 6 | ||||
-rw-r--r-- | comms/smstools3/files/patch-install.sh | 26 | ||||
-rw-r--r-- | comms/smstools3/files/pkg-deinstall.in | 17 | ||||
-rw-r--r-- | comms/smstools3/files/pkg-install.in | 11 | ||||
-rw-r--r-- | comms/smstools3/files/smsd.in | 16 | ||||
-rw-r--r-- | comms/smstools3/pkg-plist | 8 |
7 files changed, 82 insertions, 58 deletions
diff --git a/comms/smstools3/Makefile b/comms/smstools3/Makefile index cee36103095f..f45bf97f05f5 100644 --- a/comms/smstools3/Makefile +++ b/comms/smstools3/Makefile @@ -3,11 +3,12 @@ PORTNAME= smstools PORTVERSION= 3.1.15 +PORTREVISION= 1 CATEGORIES= comms MASTER_SITES= http://smstools3.kekekasvi.com/packages/ DISTNAME= smstools3-${PORTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= madpilot@FreeBSD.org COMMENT= SMS Gateway software for GSM modems and mobile phones LICENSE= GPLv2 @@ -21,7 +22,11 @@ STATS_DESC= Build status and statistics support WRKSRC= ${WRKDIR}/smstools3 -USE_GMAKE= yes +USES= gmake shebangfix +SHEBANG_FILES= scripts/hex2dec scripts/hex2bin +SHEBANG_LANG= awk +awk_OLD_CMD= /bin/gawk +awk_CMD= ${LOCALBASE}/bin/awk USE_RC_SUBR= smsd SPOOLDIR?= /var/spool/sms LOGDIR?= /var/log/smsd @@ -32,15 +37,15 @@ SUB_LIST+= SPOOLDIR="${SPOOLDIR}" LOGDIR="${LOGDIR}" PIDDIR="${PIDDIR}" \ SMSD_USER="${SMSD_USER}" SMSD_GROUP="${SMSD_GROUP}" PLIST_SUB+= SPOOLDIR="${SPOOLDIR}" LOGDIR="${LOGDIR}" PIDDIR="${PIDDIR}" \ SMSD_USER="${SMSD_USER}" SMSD_GROUP="${SMSD_GROUP}" +SUB_FILES= pkg-install pkg-deinstall PORTDOCS= * PORTEXAMPLES= .procmailrc .qmailrc * -NO_STAGE= yes -.include <bsd.port.pre.mk> +.include <bsd.port.options.mk> .if ${PORT_OPTIONS:MSTATS} -LIB_DEPENDS+= mm:${PORTSDIR}/devel/mm +LIB_DEPENDS+= libmm.so:${PORTSDIR}/devel/mm CFLAGS+= -I${LOCALBASE}/include .else CFLAGS+= -DNOSTATS @@ -48,8 +53,9 @@ CFLAGS+= -DNOSTATS SMSTOOLS_DEFAULT_COMPORT?= /dev/cuau0 post-patch: - @${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/Makefile \ - ${WRKSRC}/install.sh ${WRKSRC}/src/smsd_cfg.h + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ + -e 's|%%STAGEDIR%%|${STAGEDIR}|g' \ + ${WRKSRC}/Makefile ${WRKSRC}/install.sh ${WRKSRC}/src/smsd_cfg.h @${REINPLACE_CMD} 's|/dev/ttyS0|${SMSTOOLS_DEFAULT_COMPORT}|g' \ ${WRKSRC}/examples/smsd.conf.easy \ ${WRKSRC}/examples/smsd.conf.full \ @@ -58,28 +64,26 @@ post-patch: ${WRKSRC}/scripts/* post-install: - @${MKDIR} ${DATADIR} + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/smsd + @${MKDIR} ${STAGEDIR}${DATADIR} @for file in `${FIND} ${WRKSRC}/scripts -type f ! -name 'README' ! -name '*.bak'`; do \ - ${INSTALL_SCRIPT} $$file ${DATADIR}/; \ + ${INSTALL_SCRIPT} $$file ${STAGEDIR}${DATADIR}/; \ done .for FILE in sendsms sms2html sms2unicode unicode2sms - @${LN} -sf ${DATADIR}/${FILE} ${PREFIX}/bin/${FILE} + @${LN} -sf ${DATADIR}/${FILE} ${STAGEDIR}${PREFIX}/bin/${FILE} .endfor - @${INSTALL_DATA} ${WRKSRC}/examples/smsd.conf.easy ${PREFIX}/etc/smsd.conf.sample - @if [ ! -f ${PREFIX}/etc/smsd.conf ]; then \ - ${CP} ${PREFIX}/etc/smsd.conf.sample ${PREFIX}/etc/smsd.conf; \ - fi - @${MKDIR} ${SPOOLDIR} ${LOGDIR} ${PIDDIR} - @${CHOWN} -R ${SMSD_USER}:${SMSD_GROUP} ${SPOOLDIR} ${LOGDIR} ${PIDDIR} -.if ${PORT_OPTIONS:MDOCS} - @${MKDIR} ${DOCSDIR}/slideshow - @${INSTALL_DATA} ${WRKSRC}/doc/*.html ${DOCSDIR}/ - @${INSTALL_DATA} ${WRKSRC}/doc/slideshow/* ${DOCSDIR}/slideshow -.endif -.if ${PORT_OPTIONS:MEXAMPLES} - @${MKDIR} ${EXAMPLESDIR} + @${INSTALL_DATA} ${WRKSRC}/examples/smsd.conf.easy ${STAGEDIR}${PREFIX}/etc/smsd.conf.sample + @${MKDIR} ${STAGEDIR}${DOCSDIR}/slideshow + @${INSTALL_DATA} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}/ + @${INSTALL_DATA} ${WRKSRC}/doc/slideshow/* ${STAGEDIR}${DOCSDIR}/slideshow + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} @for file in `${FIND} ${WRKSRC}/examples -type f ! -name 'README'`; do \ - ${INSTALL_SCRIPT} $$file ${EXAMPLESDIR}/; \ + ${INSTALL_SCRIPT} $$file ${STAGEDIR}${EXAMPLESDIR}/; \ done -.endif -.include <bsd.port.post.mk> + @${MKDIR} ${STAGEDIR}${SPOOLDIR}/incoming ${STAGEDIR}${SPOOLDIR}/outgoing \ + ${STAGEDIR}${SPOOLDIR}/checked ${STAGEDIR}${LOGDIR} \ + ${STAGEDIR}${PIDDIR} + @${CHOWN} -R ${SMSD_USER}:${SMSD_GROUP} ${STAGEDIR}${SPOOLDIR} \ + ${STAGEDIR}${LOGDIR} ${STAGEDIR}${PIDDIR} + +.include <bsd.port.mk> diff --git a/comms/smstools3/files/patch-Makefile b/comms/smstools3/files/patch-Makefile index 88fa1883bfae..2218e6384696 100644 --- a/comms/smstools3/files/patch-Makefile +++ b/comms/smstools3/files/patch-Makefile @@ -5,14 +5,14 @@ # If you change destination of executables, remember to change # startup script (init.d/sms3) too. -BINDIR=/usr/local/bin -+BINDIR=%%PREFIX%%/bin ++BINDIR=%%STAGEDIR%%%%PREFIX%%/bin VERSION=$(shell grep package_version src/version.h | cut -f2) -compile: - cd src && $(MAKE) -$(MAKEFLAGS) +all: -+ cd src && $(MAKE) $(MAKEFLAGS) ++ cd src && $(MAKE) -install: compile - ./install.sh $(BINDIR) @@ -25,7 +25,7 @@ clean: - cd src && $(MAKE) -$(MAKEFLAGS) clean -+ cd src && $(MAKE) $(MAKEFLAGS) clean ++ cd src && $(MAKE) clean -package: compile clean - ./package.sh diff --git a/comms/smstools3/files/patch-install.sh b/comms/smstools3/files/patch-install.sh index 18a117ccbb3c..280b64b7ae3a 100644 --- a/comms/smstools3/files/patch-install.sh +++ b/comms/smstools3/files/patch-install.sh @@ -1,15 +1,15 @@ --- install.sh.orig 2007-04-22 13:43:17.000000000 +0200 -+++ install.sh 2008-05-18 00:16:05.000000000 +0200 ++++ install.sh 2013-10-16 12:22:40.725619989 +0200 @@ -3,7 +3,7 @@ BINDIR=$1 if [ -z "$BINDIR" ]; then - BINDIR=/usr/local/bin -+ BINDIR=%%PREFIX%%/bin ++ BINDIR=%%STAGEDIR%%%%PREFIX%%/bin fi makepath() -@@ -84,14 +84,8 @@ +@@ -84,38 +84,6 @@ delete $BINDIR/getsms delete $BINDIR/putsms @@ -19,16 +19,16 @@ -copy scripts/sms2unicode $BINDIR/sms2unicode -copy scripts/unicode2sms $BINDIR/unicode2sms - - echo "Installing config file" +-echo "Installing config file" -copy examples/smsd.conf.easy /etc/smsd.conf -+copy examples/smsd.conf.easy %%PREFIX%%/etc/smsd.conf - - echo "Creating minimum spool directories" - makedir /var/spool -@@ -100,22 +94,6 @@ - makedir /var/spool/sms/outgoing - makedir /var/spool/sms/checked - +- +-echo "Creating minimum spool directories" +-makedir /var/spool +-makedir /var/spool/sms +-makedir /var/spool/sms/incoming +-makedir /var/spool/sms/outgoing +-makedir /var/spool/sms/checked +- -echo "Installing start-script" -SMS3SCRIPT=scripts/sms3 -if [ -d /etc/init.d ]; then @@ -48,4 +48,4 @@ - echo "You have installed executables to $BINDIR," - echo "you should manually edit $SMS3SCRIPT script." -fi -+echo 'Please dont forget to edit %%PREFIX%%/etc/smsd.conf.' ++echo 'Please dont forget to edit %%STAGEDIR%%%%PREFIX%%/etc/smsd.conf.' diff --git a/comms/smstools3/files/pkg-deinstall.in b/comms/smstools3/files/pkg-deinstall.in new file mode 100644 index 000000000000..bd78c6b46ce2 --- /dev/null +++ b/comms/smstools3/files/pkg-deinstall.in @@ -0,0 +1,17 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "x$2" = "xPOST-DEINSTALL" ]; then + rmdir %%SPOOLDIR%%/incoming %%SPOOLDIR%%/outgoing \ + %%SPOOLDIR%%/checked %%SPOOLDIR%% %%LOGDIR%% %%PIDDIR%% \ + 2>/dev/null || true + echo + echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" + echo "If you are permanently removing smstools, you should also:" | /usr/bin/fmt + echo "'rm -rf %%SPOOLDIR%%'" + echo "'rm -rf %%LOGDIR%%'" + echo "'rm -rf %%PIDDIR%%'" + echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" +fi diff --git a/comms/smstools3/files/pkg-install.in b/comms/smstools3/files/pkg-install.in new file mode 100644 index 000000000000..9f9262263885 --- /dev/null +++ b/comms/smstools3/files/pkg-install.in @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "x$2" = "xPOST-INSTALL" ]; then + mkdir -p %%SPOOLDIR%%/incoming %%SPOOLDIR%%/outgoing \ + %%SPOOLDIR%%/checked %%LOGDIR%% %%PIDDIR%% + chown -R %%SMSD_USER%%:%%SMSD_GROUP%% %%SPOOLDIR%% \ + %%LOGDIR%% %%PIDDIR%% +fi diff --git a/comms/smstools3/files/smsd.in b/comms/smstools3/files/smsd.in index df8062f81e45..c808d37a5b52 100644 --- a/comms/smstools3/files/smsd.in +++ b/comms/smstools3/files/smsd.in @@ -12,17 +12,17 @@ # . /etc/rc.subr -name="smsd" +name=smsd rcvar=smsd_enable load_rc_config ${name} -: ${smsd_enable="NO"} -: ${smsd_pidfile="%%PIDDIR%%/smsd.pid"} -: ${smsd_infofile="%%PIDDIR%%/smsd.working"} -: ${smsd_logfile="%%LOGDIR%%/smsd.log"} -: ${smsd_config="%%PREFIX%%/etc/smsd.conf"} -: ${smsd_user="uucp"} -: ${smsd_group="dialer"} +: ${smsd_enable:=NO} +: ${smsd_pidfile:="%%PIDDIR%%/smsd.pid"} +: ${smsd_infofile:="%%PIDDIR%%/smsd.working"} +: ${smsd_logfile:="%%LOGDIR%%/smsd.log"} +: ${smsd_config:="%%PREFIX%%/etc/smsd.conf"} +: ${smsd_user:=uucp} +: ${smsd_group:=dialer} pidfile=${smsd_pidfile} command="%%PREFIX%%/bin/smsd" diff --git a/comms/smstools3/pkg-plist b/comms/smstools3/pkg-plist index 96d07866dc12..3bf6fec71319 100644 --- a/comms/smstools3/pkg-plist +++ b/comms/smstools3/pkg-plist @@ -29,11 +29,3 @@ bin/unicode2sms etc/smsd.conf.sample @exec if [ ! -f %D/etc/smsd.conf ] ; then cp -p %D/%F %B/smsd.conf; fi @dirrm %%DATADIR%% -@exec mkdir -p %%SPOOLDIR%%/incoming %%SPOOLDIR%%/outgoing %%SPOOLDIR%%/checked %%LOGDIR%% %%PIDDIR%% -@exec chown -R %%SMSD_USER%%:%%SMSD_GROUP%% %%SPOOLDIR%% %%LOGDIR%% %%PIDDIR%% -@unexec echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" -@unexec echo "If you are permanently removing smstools, you should also:" | /usr/bin/fmt -@unexec echo "'rm -rf %%SPOOLDIR%%'" | /usr/bin/fmt -@unexec echo "'rm -rf %%LOGDIR%%'" | /usr/bin/fmt -@unexec echo "'rm -rf %%PIDDIR%%'" | /usr/bin/fmt -@unexec echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" |