1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

- 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
This commit is contained in:
Guido Falsi 2013-10-22 14:54:01 +00:00
parent d40f1501ea
commit 09d358dd31
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=331281
7 changed files with 82 additions and 58 deletions

View File

@ -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>

View File

@ -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

View File

@ -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.'

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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 "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="