git: c3dd71ab4c1c - main - share/examples: move examples into appropriate packages

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 23 Apr 2024 04:52:48 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=c3dd71ab4c1c1edac99eae505dae1d5628a03ab8

commit c3dd71ab4c1c1edac99eae505dae1d5628a03ab8
Author:     Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-04-22 22:08:22 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-23 04:36:35 +0000

    share/examples: move examples into appropriate packages
    
    Allow a new variable SE_xxxPACKAGE to be used to place an example group
    into a package.
    
    Move the following examples into existing appropriate packages:
    
    - bhyve examples into FreeBSD-bhyve
    - bootforth examples into FreeBSD-bootloader
    - csh examples into FreeBSD-csh
    - ipfw examples into FreeBSD-ipfw
    - jail examples into FreeBSD-jail
    - pf examples into FreeBSD-pf
    - ppp examples into FreeBSD-ppp
    - printing examples into FreeBSD-lp
    - uefisign examples into FreeBSD-efi-tools
    - ypldap examples into FreeBSD-yp
    - hast examples into FreeBSD-hast
    
    Move all other examples into the new 'FreeBSD-examples' package.
    
    This removes a significant number of files from the FreeBSD-utilities
    package.
    
    Reviewed by: imp, manu
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1176
---
 release/packages/Makefile.package |  2 ++
 share/examples/Makefile           | 18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package
index c7d906b387fd..2c0aa259737d 100644
--- a/release/packages/Makefile.package
+++ b/release/packages/Makefile.package
@@ -65,6 +65,8 @@ efi-tools_COMMENT=	UEFI Utilities
 efi-tools_DESC=		UEFI Utilities
 elftoolchain_COMMENT=	ElfToolchain programs and libraries
 elftoolchain_DESC=	ElfToolchain programs and libraries
+examples_COMMENT=	Examples in /usr/share/examples
+examples_DESC=		Examples in /usr/share/examples
 fetch_COMMENT=		Fetch Utility
 fetch_DESC=		Fetch Utility
 ftp_COMMENT=		FTP Utilities
diff --git a/share/examples/Makefile b/share/examples/Makefile
index 504f3d7807dc..0425e36c1cf5 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -45,6 +45,7 @@ SE_BSD_DAEMON= \
 .if ${MK_BHYVE} != "no"
 LDIRS+=		bhyve
 SE_DIRS+=	bhyve
+SE_BHYVEPACKAGE=bhyve
 SE_BHYVE=	vmrun.sh
 PACKAGE_bhyve/vmrun.sh=	bhyve
 .endif
@@ -57,6 +58,7 @@ SE_FREEBSD_VERSION= \
 	README
 
 SE_DIRS+=	bootforth
+SE_BOOTFORTH_PACKAGE=bootloader
 SE_BOOTFORTH= \
 	README \
 	boot.4th \
@@ -67,7 +69,8 @@ SE_BOOTFORTH= \
 	screen.4th
 
 SE_DIRS+=	csh
-SE_CSH=	dot.cshrc
+SE_CSHPACKAGE=	csh
+SE_CSH=		dot.cshrc
 
 SE_DIRS+=	drivers
 SE_DRIVERS= \
@@ -98,9 +101,11 @@ SUBDIR+=	ipfilter
 .endif
 
 SE_DIRS+=	ipfw
+SE_IPFWPACKAGE=	ipfw
 SE_IPFW=	change_rules.sh
 
 SE_DIRS+=	jails
+SE_JAILPACKAGE=	jail
 SE_JAILS= \
 	README \
 	VIMAGE \
@@ -203,6 +208,7 @@ SE_PERFMON= \
 .if ${MK_PF} != "no"
 SE_DIRS+=	pf
 .if ${MK_STAGING} == "no"
+SE_PFPACKAGE=	pf
 SE_PF= \
 	ackpri \
 	faq-example1 \
@@ -223,6 +229,7 @@ SE_PPI= \
 	ppilcd.c
 
 SE_DIRS+=	ppp
+SE_PPPPACKAGE=	ppp
 SE_PPP= \
 	chap-auth \
 	login-auth \
@@ -240,6 +247,7 @@ SE_PPP= \
 	ppp.secret.span-isp.working
 
 SE_DIRS+=	printing
+SE_PRINTINGPACKAGE=lp
 SE_PRINTING= \
 	diablo-if-net \
 	hpdf \
@@ -342,13 +350,16 @@ SE_SUNRPC_SORT= \
 LDIRS+=		uefisign
 SE_DIRS+=	uefisign
 SE_UEFISIGN=	uefikeys
+SE_UEFISIGNPACKAGE=efi-tools
 .endif
 
 SE_DIRS+=	ypldap
 SE_YPLDAP=	ypldap.conf
+SE_YPLDAPPACKAGE=yp
 
 .if ${MK_HAST} != "no"
 LDIRS+=		hast
+SE_HASTPACKAGE=	hast
 SE_DIRS+=	hast
 SE_HAST=	ucarp.sh \
 	ucarp_down.sh \
@@ -379,6 +390,11 @@ SER_${d:tu:C/\//_/g}+=	${d}/${f}
 .endfor
 FILESGROUPS+=	SER_${d:tu:C/\//_/g}
 SER_${d:tu:C/\//_/g}DIR+=	${SHAREDIR}/examples/${d}
+.if ${SE_${d:tu:C/\//_/g}PACKAGE:U} != ""
+SER_${d:tu:C/\//_/g}PACKAGE=	${SE_${d:tu:C/\//_/g}PACKAGE}
+.else
+SER_${d:tu:C/\//_/g}PACKAGE=	examples
+.endif
 .endfor
 
 BINDIR= ${SHAREDIR}/examples