- use reserverd UID/GID
- use ports-framework to create user/group - remove pkg-(de)install - rename patchfiles - rename rc file ( s/.in// ) - bump PORTREVISION with hat apache@ PR: 169953 Submitted by: Marcello Coutinho <marcellocoutinho@gmail.com>
This commit is contained in:
parent
79769610e4
commit
8983a88800
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=301241
21 changed files with 44 additions and 186 deletions
5
CHANGES
5
CHANGES
|
@ -10,6 +10,11 @@ in the release notes and/or placed into UPDATING.
|
|||
|
||||
All ports committers are allowed to commit to this file.
|
||||
|
||||
20120820:
|
||||
AUTHOR: ohauer@FreeBSD.org
|
||||
* The ports net/spread and net/spread4 are using now the
|
||||
reserved UID/GID 282 instead (user|group)next.
|
||||
|
||||
20120715:
|
||||
AUTHOR: beat@FreeBSD.org
|
||||
|
||||
|
|
1
GIDs
1
GIDs
|
@ -129,6 +129,7 @@ frontbase:*:276:
|
|||
mrtg:*:279:
|
||||
xymon:*:280:
|
||||
prelude:*:281:
|
||||
spread:*:282:
|
||||
backuppc:*:300:
|
||||
_sphinx:*:312:
|
||||
dkfilter:*:325:
|
||||
|
|
1
UIDs
1
UIDs
|
@ -135,6 +135,7 @@ frontbase:*:276:276::0:0:FrontBase Daemon:/usr/local/FrontBase/Databases:/bin/sh
|
|||
mrtg:*:279:279::0:0:MRTG daemon:/nonexistent:/usr/sbin/nologin
|
||||
xymon:*:280:280::0:0:Xymon Monitor:/nonexistent:/usr/sbin/nologin
|
||||
prelude:*:281:281::0:0:Prelude user:/nonexistent:/usr/sbin/nologin
|
||||
spread:*:282:282::0:0:Spread user:/nonexistent:/usr/sbin/nologin
|
||||
backuppc:*:300:300::0:0:BackupPC pseudo-user:/nonexistent:/usr/sbin/nologin
|
||||
_sphinx:*:312:312::0:0:Sphinxsearch Owner:/nonexistent:/usr/sbin/nologin
|
||||
dkfilter:*:325:325::0:0:DK Filter Owner:/nonexistent:/usr/sbin/nologin
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= spread
|
||||
PORTVERSION= 3.17.4
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net perl5
|
||||
MASTER_SITES= http://www.edu-linux.org/down/
|
||||
DISTNAME= ${PORTNAME}-src-${PORTVERSION}
|
||||
|
@ -20,9 +21,15 @@ PORTSCOUT= limit:^3
|
|||
|
||||
GNU_CONFIGURE= yes
|
||||
USE_PERL5= yes
|
||||
USE_RC_SUBR= spread.sh
|
||||
USE_RC_SUBR= spread
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
USERS= spread
|
||||
GROUPS= spread
|
||||
RUNDIR= /var/run/spread
|
||||
|
||||
PLIST_SUB+= USERS=${USERS} GROUPS=${GROUPS} RUNDIR=${RUNDIR}
|
||||
|
||||
MAKE_ARGS+= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS}
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-src-${PORTVERSION}
|
||||
|
||||
|
@ -55,9 +62,6 @@ post-build:
|
|||
${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile
|
||||
@cd ${WRKSRC}/perl/Spread && ${MAKE}
|
||||
|
||||
pre-install:
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
post-install:
|
||||
.for f in ${HEADERFILES}
|
||||
${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/include
|
||||
|
@ -82,7 +86,7 @@ post-install:
|
|||
${INSTALL_DATA} ${WRKSRC}/Readme.txt ${DOCSDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/license.txt ${DOCSDIR}/LICENSE
|
||||
.endif
|
||||
@${INSTALL} -m 750 -o ${USERS} -g ${GROUPS} -d ${RUNDIR}
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- Makefile.in Thu Sep 23 12:12:52 2004
|
||||
+++ Makefile.in Tue Oct 4 14:49:56 2005
|
||||
--- ./Makefile.in.orig 2004-09-23 19:12:52.000000000 +0200
|
||||
+++ ./Makefile.in 2012-07-20 21:55:23.000000000 +0200
|
||||
@@ -26,7 +26,7 @@
|
||||
#Rules: major -- inc for incompatible change
|
||||
# : minor -- inc for bugfix or forward compatible change
|
||||
|
@ -91,15 +91,15 @@
|
|||
rm -f config.cache config.log docs/*.out core
|
||||
rm -rf autom4te.cache
|
||||
|
||||
@@ -254,11 +262,6 @@
|
||||
done
|
||||
@@ -255,11 +263,6 @@
|
||||
if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \
|
||||
$(buildtoolsdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \
|
||||
- fi
|
||||
fi
|
||||
- if [ ! -f $(DESTDIR)$(sysconfdir)/spread.conf ]; then \
|
||||
- $(INSTALL) -m 644 $(srcdir)/sample.spread.conf $(DESTDIR)$(sysconfdir)/spread.conf; \
|
||||
- else \
|
||||
- echo "$(DESTDIR)$(sysconfdir)/spread.conf already exists, install will not overwrite"; \
|
||||
fi
|
||||
- fi
|
||||
|
||||
uninstallall: uninstall
|
||||
-rm -f $(DESTDIR)$(sysconfdir)/spread.conf
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- spread.c Thu Jun 19 00:31:23 2003
|
||||
+++ spread.c Mon Dec 8 20:55:41 2003
|
||||
--- ./spread.c.orig 2006-11-20 05:53:13.000000000 +0100
|
||||
+++ ./spread.c 2012-07-20 21:55:23.000000000 +0200
|
||||
@@ -48,6 +48,8 @@
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
|
@ -29,12 +29,10 @@
|
|||
/* initialize each valid authentication protocol */
|
||||
null_init();
|
||||
ip_init();
|
||||
@@ -193,6 +201,20 @@
|
||||
E_handle_events();
|
||||
|
||||
@@ -195,6 +203,20 @@
|
||||
return 0;
|
||||
+}
|
||||
+
|
||||
}
|
||||
|
||||
+static void
|
||||
+writepidfile()
|
||||
+{
|
||||
|
@ -47,6 +45,8 @@
|
|||
+ snprintf(pidbuf, sizeof(pidbuf), "%ld\n", (long)getpid());
|
||||
+ write(pidfd, pidbuf, strlen(pidbuf));
|
||||
+ close(pidfd);
|
||||
}
|
||||
|
||||
+}
|
||||
+
|
||||
static void Print_help(void)
|
||||
{
|
||||
Alarmp( SPLOG_FATAL, SYSTEM, "Usage: spread\n%s\n%s\n%s\n",
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=spread
|
||||
GROUP=spread
|
||||
|
||||
echo "===> deinstall note:"
|
||||
echo " Please note that user ${USER} and group ${GROUP} was not removed"
|
||||
echo " from this system:"
|
||||
echo ""
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo " To delete spread user permanently"
|
||||
echo " $ pw userdel ${USER}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
||||
echo " To delete spread group permanently"
|
||||
echo " $ pw groupdel ${GROUP}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
USER=spread
|
||||
USER_HOMEDIR=/nonexistent
|
||||
GROUP=spread
|
||||
RUNDIR=/var/run/spread
|
||||
NOLOGIN=/sbin/nologin
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if pw groupadd ${GROUP}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
if pw usermod ${USER} -d ${USER_HOMEDIR}
|
||||
then
|
||||
echo "Changed home directory of \"${USER}\" to \"${USER_HOMEDIR}\"."
|
||||
else
|
||||
echo "Changing home directory of \"${USER}\" to \"${USER_HOMEDIR}\" failed."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if pw useradd ${USER} -g ${GROUP} -h - \
|
||||
-d ${USER_HOMEDIR} -s ${NOLOGIN} -c "Spread User"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
POST-INSTALL)
|
||||
if [ ! -d ${RUNDIR} ]; then
|
||||
install -d -o ${USER} -g ${GROUP} -m 0750 ${RUNDIR}
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo 'unexpect argument to pkg-install'
|
||||
;;
|
||||
esac
|
|
@ -26,3 +26,5 @@ sbin/spread
|
|||
%%EXAMPLESDIR%%/test.pl
|
||||
@dirrm %%EXAMPLESDIR%%
|
||||
@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Spread
|
||||
@exec install -m 750 -o %%USERS%% -g %%GROUPS%% -d %%RUNDIR%%
|
||||
@dirrmtry %%RUNDIR%%
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= spread4
|
||||
PORTVERSION= 4.1.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net perl5
|
||||
MASTER_SITES= LOCAL/wen
|
||||
DISTNAME= spread-src-${PORTVERSION}
|
||||
|
@ -16,10 +17,16 @@ COMMENT= The Spread Group Communication System, a network toolkit
|
|||
|
||||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
USE_RC_SUBR= spread.sh
|
||||
USE_RC_SUBR= spread
|
||||
USE_LDCONFIG= yes
|
||||
ALL_TARGET= all
|
||||
|
||||
USERS= spread
|
||||
GROUPS= spread
|
||||
RUNDIR= /var/run/spread
|
||||
|
||||
PLIST_SUB+= USERS=${USERS} GROUPS=${GROUPS} RUNDIR=${RUNDIR}
|
||||
|
||||
WRKSRC= ${WRKDIR}/spread-src-${PORTVERSION}
|
||||
|
||||
PKGMESSAGE= ${WRKSRC}/license.txt
|
||||
|
@ -43,9 +50,6 @@ post-extract:
|
|||
@${REINPLACE_CMD} -e 's|INSTALLSUBDIRS=daemon docs|INSTALLSUBDIRS=daemon|' \
|
||||
${WRKSRC}/Makefile.in
|
||||
|
||||
pre-install:
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA} ${WRKSRC}/docs/sample.spread.conf \
|
||||
${PREFIX}/etc/spread.conf.sample
|
||||
|
@ -76,8 +80,7 @@ post-install:
|
|||
.for f in ${MAN3}
|
||||
${INSTALL_MAN} ${WRKSRC}/docs/${f} ${LOCALBASE}/man/man3/
|
||||
.endfor
|
||||
|
||||
@${INSTALL} -m 750 -o ${USERS} -g ${GROUPS} -d ${RUNDIR}
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=spread
|
||||
GROUP=spread
|
||||
|
||||
echo "===> deinstall note:"
|
||||
echo " Please note that user ${USER} and group ${GROUP} was not removed"
|
||||
echo " from this system:"
|
||||
echo ""
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo " To delete spread user permanently"
|
||||
echo " $ pw userdel ${USER}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
||||
echo " To delete spread group permanently"
|
||||
echo " $ pw groupdel ${GROUP}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
USER=spread
|
||||
USER_HOMEDIR=/nonexistent
|
||||
GROUP=spread
|
||||
RUNDIR=/var/run/spread
|
||||
NOLOGIN=/sbin/nologin
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if pw groupadd ${GROUP}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
if pw usermod ${USER} -d ${USER_HOMEDIR}
|
||||
then
|
||||
echo "Changed home directory of \"${USER}\" to \"${USER_HOMEDIR}\"."
|
||||
else
|
||||
echo "Changing home directory of \"${USER}\" to \"${USER_HOMEDIR}\" failed."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if pw useradd ${USER} -g ${GROUP} -h - \
|
||||
-d ${USER_HOMEDIR} -s ${NOLOGIN} -c "Spread User"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
POST-INSTALL)
|
||||
if [ ! -d ${RUNDIR} ]; then
|
||||
install -d -o ${USER} -g ${GROUP} -m 0750 ${RUNDIR}
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo 'unexpect argument to pkg-install'
|
||||
;;
|
||||
esac
|
|
@ -33,3 +33,5 @@ sbin/spread
|
|||
%%PORTDOCS%%%%DOCSDIR%%/TODO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/PORTING
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
||||
@exec install -m 750 -o %%USERS%% -g %%GROUPS%% -d %%RUNDIR%%
|
||||
@dirrmtry %%RUNDIR%%
|
||||
|
|
Loading…
Reference in a new issue