diff options
author | schmonz <schmonz@pkgsrc.org> | 2018-12-12 02:08:10 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2018-12-12 02:08:10 +0000 |
commit | 0cbee7d87cc4c9980ccd3a0c3e82f68c51255ee8 (patch) | |
tree | 5dd21db33c31d18caa6850d788990d9632c7b1cb /pkgtools | |
parent | b55f3b33204278050bc39fec2ad71bb6d6dc1bed (diff) | |
download | pkgsrc-0cbee7d87cc4c9980ccd3a0c3e82f68c51255ee8.tar.gz |
Support Linux with systemd. Set LICENSE (2-clause-bsd). Bump version.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/rc.d-boot/DEINSTALL | 29 | ||||
-rw-r--r-- | pkgtools/rc.d-boot/INSTALL | 15 | ||||
-rw-r--r-- | pkgtools/rc.d-boot/Makefile | 30 | ||||
-rw-r--r-- | pkgtools/rc.d-boot/PLIST | 3 | ||||
-rw-r--r-- | pkgtools/rc.d-boot/files/pkgsrc-rc.d-boot.service | 12 |
5 files changed, 75 insertions, 14 deletions
diff --git a/pkgtools/rc.d-boot/DEINSTALL b/pkgtools/rc.d-boot/DEINSTALL new file mode 100644 index 00000000000..a412feea8f8 --- /dev/null +++ b/pkgtools/rc.d-boot/DEINSTALL @@ -0,0 +1,29 @@ +# $NetBSD: DEINSTALL,v 1.1 2018/12/12 02:08:10 schmonz Exp $ + +RCDBOOT_STYLE=@RCDBOOT_STYLE@ + +case "${STAGE}" in + +DEINSTALL) + case "${RCDBOOT_STYLE}" in + darwin-launchd) + ;; + linux-systemd) + systemctl disable pkgsrc-rc.d-boot.service + ;; + netbsd-native) + ;; + esac + + ${CAT} <<EOF +=========================================================================== + +pkgsrc-provided rc.d scripts will no longer be started at boot. + +If you wish to stop them, please do so now. + +=========================================================================== +EOF + ;; + +esac diff --git a/pkgtools/rc.d-boot/INSTALL b/pkgtools/rc.d-boot/INSTALL index 0474b9443d4..66c3afa9c09 100644 --- a/pkgtools/rc.d-boot/INSTALL +++ b/pkgtools/rc.d-boot/INSTALL @@ -1,15 +1,18 @@ -# $NetBSD: INSTALL,v 1.2 2018/12/05 19:49:26 schmonz Exp $ +# $NetBSD: INSTALL,v 1.3 2018/12/12 02:08:10 schmonz Exp $ -OPSYS=@OPSYS@ +RCDBOOT_STYLE=@RCDBOOT_STYLE@ -case ${STAGE} in +case "${STAGE}" in POST-INSTALL) - case "${OPSYS}" in - Darwin) + case "${RCDBOOT_STYLE}" in + darwin-launchd) launchctl load -w /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist ;; - NetBSD) + linux-systemd) + systemctl enable --now /etc/systemd/system/pkgsrc-rc.d-boot.service + ;; + netbsd-native) ;; esac diff --git a/pkgtools/rc.d-boot/Makefile b/pkgtools/rc.d-boot/Makefile index 909f7e815bb..3f93a6c73ca 100644 --- a/pkgtools/rc.d-boot/Makefile +++ b/pkgtools/rc.d-boot/Makefile @@ -1,13 +1,14 @@ -# $NetBSD: Makefile,v 1.2 2018/12/05 19:49:26 schmonz Exp $ +# $NetBSD: Makefile,v 1.3 2018/12/12 02:08:10 schmonz Exp $ # -PKGNAME= rc.d-boot-20181205 +PKGNAME= rc.d-boot-20181211 CATEGORIES= pkgtools MAINTAINER= schmonz@NetBSD.org COMMENT= Run package rc.d scripts at boot on any supported OS +LICENSE= 2-clause-bsd -ONLY_FOR_PLATFORM= Darwin-*-* NetBSD-*-* +ONLY_FOR_PLATFORM= # empty by default .include "../../mk/bsd.prefs.mk" @@ -24,14 +25,26 @@ NO_BUILD= yes SUBST_CLASSES= paths SUBST_STAGE.paths= pre-configure -SUBST_FILES.paths= rc.d-boot org.pkgsrc.rc.d-boot.plist +SUBST_FILES.paths= rc.d-boot +SUBST_FILES.paths+= org.pkgsrc.rc.d-boot.plist \ + pkgsrc-rc.d-boot.service SUBST_VARS.paths= PREFIX RCD_SCRIPTS_DIR RCORDER -FILES_SUBST+= OPSYS=${OPSYS:Q} +FILES_SUBST+= RCDBOOT_STYLE=${RCDBOOT_STYLE:Q} -.if ${OPSYS} == "Darwin" +.if ${OPSYS} == "Darwin" && exists (/Library/LaunchDaemons) +ONLY_FOR_PLATFORM+= Darwin-*-* +RCDBOOT_STYLE= darwin-launchd CONF_FILES+= ${PREFIX}/share/examples/${PKGBASE}/org.pkgsrc.rc.d-boot.plist \ /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist +.elif ${OPSYS} == "Linux" && exists(/etc/systemd/system) +ONLY_FOR_PLATFORM+= Linux-*-* +RCDBOOT_STYLE= linux-systemd +CONF_FILES+= ${PREFIX}/share/examples/${PKGBASE}/pkgsrc-rc.d-boot.service \ + /etc/systemd/system/pkgsrc-rc.d-boot.service +.elif ${OPSYS} == "NetBSD" && exists(/etc/rc.d) +ONLY_FOR_PLATFORM+= NetBSD-*-* +RCDBOOT_STYLE= netbsd-native .endif INSTALLATION_DIRS= sbin share/examples/${PKGBASE} @@ -40,7 +53,10 @@ do-extract: ${CP} -R ${FILESDIR} ${WRKSRC} do-install: - ${INSTALL_DATA} ${WRKSRC}/org.pkgsrc.rc.d-boot.plist ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/ +. for i in org.pkgsrc.rc.d-boot.plist \ + pkgsrc-rc.d-boot.service + ${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/ +. endfor ${INSTALL_SCRIPT} ${WRKSRC}/rc.d-boot ${DESTDIR}${PREFIX}/sbin/ .include "../../mk/bsd.pkg.mk" diff --git a/pkgtools/rc.d-boot/PLIST b/pkgtools/rc.d-boot/PLIST index 3f2958d110a..aaf80988030 100644 --- a/pkgtools/rc.d-boot/PLIST +++ b/pkgtools/rc.d-boot/PLIST @@ -1,3 +1,4 @@ -@comment $NetBSD: PLIST,v 1.1 2018/12/05 19:23:04 schmonz Exp $ +@comment $NetBSD: PLIST,v 1.2 2018/12/12 02:08:10 schmonz Exp $ sbin/rc.d-boot share/examples/rc.d-boot/org.pkgsrc.rc.d-boot.plist +share/examples/rc.d-boot/pkgsrc-rc.d-boot.service diff --git a/pkgtools/rc.d-boot/files/pkgsrc-rc.d-boot.service b/pkgtools/rc.d-boot/files/pkgsrc-rc.d-boot.service new file mode 100644 index 00000000000..a70f9bd5f82 --- /dev/null +++ b/pkgtools/rc.d-boot/files/pkgsrc-rc.d-boot.service @@ -0,0 +1,12 @@ +[Unit] +Description = Run all pkgsrc rc.d scripts enabled in /etc/rc.conf +After = syslog.target network.target + +[Service] +Type = oneshot +ExecStart = @PREFIX@/sbin/rc.d-boot start +ExecStop = @PREFIX@/sbin/rc.d-boot stop +RemainAfterExit = True + +[Install] +WantedBy = multi-user.target |