1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

sysutils/runit-faster: Update to 2.1.3

Runit and all patches have been imported into the upstream repository.
Simplify the port accordingly.

Pet portclippy while here.

Changes:	https://github.com/t6/freebsd-runit/releases/tag/v2.1.3
This commit is contained in:
Tobias Kortkamp 2019-06-02 12:04:47 +00:00
parent ae12d8e467
commit b44965e70e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=503307
10 changed files with 21 additions and 257 deletions

View File

@ -2,92 +2,46 @@
# $FreeBSD$
PORTNAME= runit
DISTVERSION= ${RUNITVERSION}-${CONFVERSION}
RUNITVERSION= 2.1.2
CONFVERSION= 0.1.36
DISTVERSION= 2.1.3
CATEGORIES= sysutils
MASTER_SITES= http://smarden.org/runit/ \
http://www.bayofrum.net/dist/runit/ \
https://github.com/t6/freebsd-runit/releases/download/v${CONFVERSION}/:config \
LOCAL/tobik:config \
https://pkg.tobik.me/distfiles/:config
MASTER_SITES= https://github.com/t6/freebsd-runit/releases/download/v${DISTVERSION}/ \
LOCAL/tobik
PKGNAMESUFFIX= -faster
DISTFILES= runit-${RUNITVERSION}${EXTRACT_SUFX} \
freebsd-runit-${CONFVERSION}${EXTRACT_SUFX}:config
DISTNAME= freebsd-runit-${DISTVERSION}
MAINTAINER= tobik@FreeBSD.org
COMMENT= Runit based init replacement for ${OPSYS}
LICENSE= BSD3CLAUSE CC0-1.0
LICENSE_COMB= multi
LICENSE_FILE_BSD3CLAUSE= ${WRKSRC}/package/COPYING
LICENSE_FILE_CC0-1.0= ${WRKDIR}/freebsd-runit-${CONFVERSION}/README.md
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= snooze:sysutils/snooze
USE_RC_SUBR= runsvdir
MAKE_ENV= RUNITDIR=${RUNITDIR} \
SBINDIR=${SBINDIR} \
SVDIR=${PREFIX}/etc/sv
CONFLICTS_INSTALL= runit
PLIST_SUB= RUNITDIR=${RUNITDIR}
SUB_FILES= pkg-message
SUB_LIST= RUNITDIR=${RUNITDIR}
USE_RC_SUBR= runsvdir
WRKSRC= ${WRKDIR}/admin/runit-${RUNITVERSION}
PLIST_SUB= RUNITDIR=${RUNITDIR}
PORTDOCS= *
OPTIONS_DEFINE= DOCS ROOT
OPTIONS_SUB= yes
ROOT_DESC= Install bootstrap files into /etc/runit and /sbin
PORTDOCS= *
ROOT_VARS= RUNITDIR=/etc/runit SBINDIR=/sbin
ROOT_VARS_OFF= RUNITDIR=${ETCDIR} SBINDIR=${PREFIX}/sbin
ROOT_VARS= RUNITDIR=/etc/runit SBINDIR=/sbin
post-patch:
@${REINPLACE_CMD} -e 's,/service/,/var/service,' \
-e 's,/etc/runit,${RUNITDIR},' \
-e 's,/sbin/runit,${SBINDIR}/runit,' \
${WRKSRC}/man/* ${WRKSRC}/doc/*.html \
${WRKSRC}/src/sv.c \
${WRKSRC}/src/runsvchdir.c \
${WRKSRC}/src/runit.c \
${WRKSRC}/src/runit.h
do-configure:
@${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/src/conf-cc
@${ECHO_CMD} "${CC}" > ${WRKSRC}/src/conf-ld
do-build:
@cd ${WRKSRC} && package/compile
do-install:
@${MKDIR} ${STAGEDIR}${RUNITDIR} ${STAGEDIR}${SBINDIR}
cd ${WRKSRC}/command && ${INSTALL_PROGRAM} runit runit-init \
${STAGEDIR}${SBINDIR}
cd ${WRKSRC}/command && ${INSTALL_PROGRAM} \
chpst runsv runsvchdir runsvdir sv svlogd utmpset \
${STAGEDIR}${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/man/*.8 ${STAGEDIR}${PREFIX}/man/man8
@${DO_MAKE_BUILD} -C ${WRKDIR}/freebsd-runit-${CONFVERSION} \
DESTDIR=${STAGEDIR} \
LOCALBASE=${LOCALBASE} \
PREFIX=${PREFIX} \
RUNITDIR=${RUNITDIR} \
SVDIR=${PREFIX}/etc/sv \
install
# Point runit to the run directory (a necessity to let runit work on
# read-only root filesystems) and make sure rebooting and powering off
# can work correctly.
@${LN} -s /var/run/runit/reboot ${STAGEDIR}${RUNITDIR}/reboot
@${LN} -s /var/run/runit/stopit ${STAGEDIR}${RUNITDIR}/stopit
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} \
package/CHANGES package/README package/THANKS doc/*.html \
${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKDIR}/freebsd-runit-${CONFVERSION}/docs/runit-faster.md \
${STAGEDIR}${DOCSDIR}
@${REINPLACE_CMD} 's,all: docs,all:,' ${WRKSRC}/Makefile
post-install:
# Micromanaging pkg-plist is no fun here... Generate it on the fly
@ -97,6 +51,6 @@ post-install:
>> ${TMPPLIST}
do-test:
@cd ${WRKSRC} && package/check
@cd ${WRKSRC}/runit && package/check
.include <bsd.port.mk>

View File

@ -1,5 +1,3 @@
TIMESTAMP = 1554109612
SHA256 (runit-2.1.2.tar.gz) = 6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18
SIZE (runit-2.1.2.tar.gz) = 110916
SHA256 (freebsd-runit-0.1.36.tar.gz) = 38dd91d6b92517eb0b4ad1c8be2c21037024e124f843e781ad415641103cf034
SIZE (freebsd-runit-0.1.36.tar.gz) = 34592
TIMESTAMP = 1559475686
SHA256 (freebsd-runit-2.1.3.tar.gz) = 26721897eeb778cebe129f2520c502183e354270fc204b61cc0d038b8e26137e
SIZE (freebsd-runit-2.1.3.tar.gz) = 141256

View File

@ -1,11 +0,0 @@
--- src/chkshsgr.c.orig 2018-03-05 09:33:03 UTC
+++ src/chkshsgr.c
@@ -4,7 +4,7 @@
int main()
{
- short x[4];
+ gid_t x[4];
x[0] = x[1] = 0;
if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);

View File

@ -1,28 +0,0 @@
--- src/pathexec_run.c.orig 2014-08-10 18:22:35 UTC
+++ src/pathexec_run.c
@@ -5,6 +5,7 @@
#include "str.h"
#include "env.h"
#include "pathexec.h"
+#include <unistd.h>
static stralloc tmp;
@@ -15,7 +16,7 @@ void pathexec_run(const char *file,const char * const
int savederrno;
if (file[str_chr(file,'/')]) {
- execve(file,argv,envp);
+ execve(file,(char *const *)argv,(char *const *)envp);
return;
}
@@ -32,7 +33,7 @@ void pathexec_run(const char *file,const char * const
if (!stralloc_cats(&tmp,file)) return;
if (!stralloc_0(&tmp)) return;
- execve(tmp.s,argv,envp);
+ execve(tmp.s,(char *const *)argv,(char * const *)envp);
if (errno != error_noent) {
savederrno = errno;
if ((errno != error_acces) && (errno != error_perm) && (errno != error_isdir)) return;

View File

@ -1,20 +0,0 @@
--- src/prot.c.orig 2018-03-05 09:31:55 UTC
+++ src/prot.c
@@ -3,7 +3,7 @@
#include "hasshsgr.h"
#include "prot.h"
-int prot_gid(int gid)
+int prot_gid(gid_t gid)
{
#ifdef HASSHORTSETGROUPS
short x[2];
@@ -15,7 +15,7 @@ int prot_gid(int gid)
return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
}
-int prot_uid(int uid)
+int prot_uid(uid_t uid)
{
return setuid(uid);
}

View File

@ -1,15 +0,0 @@
--- src/prot.h.orig 2018-03-05 09:38:43 UTC
+++ src/prot.h
@@ -3,7 +3,10 @@
#ifndef PROT_H
#define PROT_H
-extern int prot_gid(int);
-extern int prot_uid(int);
+#include <sys/param.h>
+#include <unistd.h>
+
+extern int prot_gid(gid_t);
+extern int prot_uid(uid_t);
#endif

View File

@ -1,15 +0,0 @@
--- src/runit.c.orig 2018-03-06 14:39:19 UTC
+++ src/runit.c
@@ -309,10 +309,10 @@ int main (int argc, const char * const *argv, char * c
reboot_system(RB_AUTOBOOT);
}
else {
-#ifdef RB_POWER_OFF
+#ifdef RB_POWEROFF
strerr_warn2(INFO, "power off...", 0);
sync();
- reboot_system(RB_POWER_OFF);
+ reboot_system(RB_POWEROFF);
sleep(2);
#endif
#ifdef RB_HALT_SYSTEM

View File

@ -1,10 +0,0 @@
--- src/svlogd.c.orig 2014-08-10 18:22:34 UTC
+++ src/svlogd.c
@@ -430,6 +430,7 @@ unsigned int logdir_open(struct logdir *ld, const char
ld->name =(char*)fn;
ld->ppid =0;
ld->match ='+';
+ ld->udpaddr.sin_family =AF_INET;
ld->udpaddr.sin_port =0;
ld->udponly =0;
while (! stralloc_copys(&ld->prefix, "")) pause_nomem();

View File

@ -1,90 +0,0 @@
Since init lacks this code in FreeBSD (utx-logout is performed in pam_lastlog)
we will simply make utmpset.c a noop if utmpx is present.
http://lists.freebsd.org/pipermail/freebsd-ports/2011-May/067872.html
--- src/tryuwtmpx.c.orig 2014-08-10 18:22:35 UTC
+++ src/tryuwtmpx.c
@@ -1,9 +1,9 @@
#include <sys/types.h>
#include <utmpx.h>
-struct futmpx ut;
+struct utmpx ut;
int main(void) {
- char *s =ut.ut_name;
+ char *s =ut.ut_user;
return(0);
}
--- src/utmpset.c.orig 2014-08-10 18:22:35 UTC
+++ src/utmpset.c
@@ -22,6 +22,11 @@ const char *progname;
void usage(void) { strerr_die4x(1, "usage: ", progname, USAGE, "\n"); }
int utmp_logout(const char *line) {
+
+#ifdef _UW_TMP_UTMPX
+ int ok = 1; /* do_nada(); */
+#else /* _UW_TMP_UTMP */
+
int fd;
uw_tmp ut;
int ok =-1;
@@ -45,9 +50,13 @@ int utmp_logout(const char *line) {
break;
}
close(fd);
+#endif /* _UW_TMP_UTMPX */
return(ok);
}
int wtmp_logout(const char *line) {
+#ifdef _UW_TMP_UTMPX
+ return 1; /* do_nada(); */
+#else /* _UW_TMP_UTMP */
int fd;
int len;
struct stat st;
@@ -79,6 +88,7 @@ int wtmp_logout(const char *line) {
}
close(fd);
return(1);
+#endif /* _UW_TMP_UTMPX */
}
int main (int argc, const char * const *argv, const char * const *envp) {
--- src/uw_tmp.h1.orig 2014-08-10 18:22:35 UTC
+++ src/uw_tmp.h1
@@ -3,6 +3,8 @@
/* sysdep: -utmpx */
+#ifndef _UW_TMP_UTMP
+#define _UW_TMP_UTMP
#ifdef _PATH_UTMP
#define UW_TMP_UFILE _PATH_UTMP
#define UW_TMP_WFILE _PATH_WTMP
@@ -17,3 +19,4 @@
#endif
typedef struct utmp uw_tmp;
+#endif /* _UW_TMP_UTMP */
--- src/uw_tmp.h2.orig 2014-08-10 18:22:35 UTC
+++ src/uw_tmp.h2
@@ -3,11 +3,12 @@
/* sysdep: +utmpx */
-#define UW_TMP_UFILE _UTMPX_FILE
-#define UW_TMP_WFILE _WTMPX_FILE
-
+#ifndef _UW_TMP_UTMPX
+#define _UW_TMP_UTMPX
#ifndef ut_time
#define ut_time ut_tv.tv_sec
#endif
-typedef struct futmpx uw_tmp;
+typedef struct utmpx uw_tmp;
+
+#endif /* _UW_TMP_UTMPX */

View File

@ -36,6 +36,7 @@ bin/svmod
%%RUNITDIR%%/core-services/95-mount-late.sh
%%RUNITDIR%%/core-services/95-swap-late.sh
%%RUNITDIR%%/core-services/99-binmisc.sh
%%RUNITDIR%%/core-services/99-linux.sh
%%RUNITDIR%%/core-services/99-ports-env.sh
%%RUNITDIR%%/core-services/99-start-jails.sh
%%RUNITDIR%%/ctrlaltdel