Skip to content

Commit

Permalink
Change COMMENT handling:
Browse files Browse the repository at this point in the history
COMMENTs are now a variable in the Makefile instead of a pkg/COMMENT
file. The COMMENT var should be in the maintainer block after the
homepage.
Modify bsd.pkg.mk, pkglint, url2pkg, and port2pkg (last one untested)
for the new behaviour. Document new state in Packages.txt.
This should save lots of inodes, and lots of time when untarring/updating.
Idea by Alistair Crooks.
For the time being, accept pkg/COMMENT instead of a COMMENT var to avoid
a flag day.
  • Loading branch information
wiz committed Feb 16, 2001
1 parent de75b3e commit 659515a
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 104 deletions.
86 changes: 41 additions & 45 deletions Packages.txt
@@ -1,4 +1,4 @@
# $NetBSD: Packages.txt,v 1.139 2001/02/09 14:48:39 agc Exp $
# $NetBSD: Packages.txt,v 1.140 2001/02/16 13:06:17 wiz Exp $
###########################################################################

==========================
Expand Down Expand Up @@ -349,7 +349,7 @@ which user to su(8) to to do a 'cvs update'.
========================================

Drop your favourite login shell in /usr/local, or install it from
/etc/rc.local. Also, if you use a OS version below 1.5 or stil want
/etc/rc.local. Also, if you use a OS version below 1.5 or you still want
to use the pkgsrc version of ssh for some reason, be sure to install
ssh before starting it from rc.local:

Expand Down Expand Up @@ -402,7 +402,7 @@ The bulk builds consist of three steps:
that report will also be mailed to the build's admin.

During the build, a list of broken packages will be compiled in
.usr/pkgsrc/.broken (or .../.broken.${MACHINE} if OBJMACHINE is set),
/usr/pkgsrc/.broken (or .../.broken.${MACHINE} if OBJMACHINE is set),
individual build logs of broken builds can be found in the package's
directory. These files are used by the bulk-targets to mark broken builds
to not waste time trying to rebuild them, and they can be used to debug
Expand Down Expand Up @@ -452,9 +452,11 @@ itself. The mandatory fields are the DISTNAME which specifies the base name
of the distribution file to be downloaded from the site on the Internet,
MASTER_SITES which specifies that site, CATEGORIES which denotes the
categories into which the package falls, PKGNAME which is the name of the
package and the MAINTAINER name. This is so that anyone who quibbles with
the (always completely correct) decisions taken by the guy who maintains
the port can complain vigorously.
package, the MAINTAINER name, and the COMMENT variable, which should
contain a one-line description of the package (the package name should not
appear, it will be added automatically). The maintainer variable is there
so that anyone who quibbles with the (always completely correct) decisions
taken by the guy who maintains the port can complain vigorously.

The MASTER_SITES may be set to one of the predefined sites:

Expand All @@ -479,18 +481,15 @@ MASTER_SITE_SUBDIR will not work.
Currently the following values are available for CATEGORIES. If more than
one is used, they need to be separated by spaces:

archivers devel math shells
audio editors mbone sysutils
benchmarks emulators meta-pkgs templates
biology finance misc textproc
cad fonts net time
chat games news wm
comms graphics parallel www
converters ham pkgtools x11
corba japanese plan9
cross lang print
databases mail security

archivers audio benchmarks biology cad
chat comms converters cross databases
devel editors emulators finance fonts
games graphics ham japanese lang
mail math mbone misc net
news parallel print security shells
sysutils textproc time wm www
x11

See the NetBSD packages(7) manual page for a description of all available
options and variables.

Expand Down Expand Up @@ -535,6 +534,12 @@ package from the FreeBSD ports collection:
- If there exists a home page for the software in question, please
add the variable HOMEPAGE right after MAINTAINER. The value of this
variable should be the URL for the home page.
- Please also set the COMMENT variable to a short description of the
package.

port2pkg (pkgsrc/pkgtools/port2pkg) does many of the mentioned steps
for you -- operator discretion is advised, though.


4.2 files/*
===========
Expand Down Expand Up @@ -621,11 +626,6 @@ witticisms.
4.4.1 Mandatory files
=====================

* pkg/COMMENT:
A one-line description of the piece of software. There is no need to
mention the package's name - this will automatically be added by the
pkg_* tools when they are invoked.

* pkg/DESCR:
A multi-line description of the piece of software. This should include
any credits where they are due. Please bear in mind that others do not
Expand Down Expand Up @@ -670,8 +670,13 @@ which does a lot of the donkey work for you.

* pkg/MESSAGE
Display this file after installation of the package.
Useful for things like legal notices on almost-free software,
etc.
Useful for things like legal notices on almost-free software, etc.
Please note that you can modify variables in it easily by using
MESSAGE_SUBST in the package's Makefile:
MESSAGE_SUBST+= SOMEVAR="somevalue"
replaces
${SOMEVAR}
in pkg/MESSAGE with "somevalue" before displaying the message.


4.5 scripts/*
Expand Down Expand Up @@ -1771,7 +1776,7 @@ You have to separate between binary and "normale" (source) packages here:
package maintainers can fetch it using FTP or HTTP (WWW). Finally,
send-pr with category "pkg", a synopsis which includes the package name
and version number, a short description of your package
(contents of pkg/COMMENT are OK) and the URL of your tar-file.
(contents of the COMMENT variable are OK) and the URL of your tar-file.

You will be notified if your send-pr has been addressed so you can remove
the tar-file.
Expand Down Expand Up @@ -1843,28 +1848,23 @@ The file contents in this section must be used without the "> " prefix.
>
> MAINTAINER= thorpej@netbsd.org
> HOMEPAGE= http://www.gnu.org/software/bison/bison.html
> COMMENT= GNU yacc clone
>
> GNU_CONFIGURE= yes
> INFO_FILES= bison.info
>
> .include "../../mk/bsd.pkg.mk"


11.1.2 pkg/COMMENT
==================

> GNU yacc clone.


11.1.3 pkg/DESCR
11.1.2 pkg/DESCR
================

> GNU version of yacc. Can make re-entrant parsers, and numerous other
> improvements. Why you would want this when Berkeley yacc(1) is part
> of the NetBSD source tree is beyond me.


11.1.4 pkg/PLIST
11.1.3 pkg/PLIST
================

> @comment <$>NetBSD<$>
Expand All @@ -1882,25 +1882,24 @@ The file contents in this section must be used without the "> " prefix.
> share/bison.hairy


11.1.5 Checking a package "pkglint"
11.1.4 Checking a package "pkglint"
===================================

The NetBSD package system comes with a tool called "pkglint" (located in the
directory "pkgsrc/pkgtools/pkglint") which helps to check the contents of these
files. After installation it is quite easy to use, just change to the
directory of the package you which to examine and execute "pkglint":
directory of the package you wish to examine and execute "pkglint":

> tron@lyssa:/usr/pkgsrc/devel/bison>pkglint
> OK: checking pkg/COMMENT.
> OK: checking pkg/DESCR.
> OK: checking Makefile.
> OK: checking files/md5.
> OK: checking patches/patch-aa.
> looks fine.

Depending on the supplied command line arguments (see "man pkglint") more
intensive checks will be performed. Use e.g. "pkglint -a -v" for a very
detailed and verbose check.
verbose checks will be performed. Use e.g. "pkglint -v" for a very verbose
check.


11.2 Steps for building, installing, packaging
Expand All @@ -1913,7 +1912,7 @@ Create the directory where the package lives, plus any auxiliary directories:
> root@pumpy:/u/pkgsrc/lang(1766)# cd bison
> root@pumpy:/u/pkgsrc/lang/bison(1768)# mkdir files patches pkg

Create Makefile, pkg/COMMENT, pkg/DESCR and pkg/PLIST as in section 11.1,
Create Makefile, pkg/DESCR and pkg/PLIST as in section 11.1,
then continue with fetching the distfile:

> root@pumpy:/u/pkgsrc/lang/bison(1769)# make fetch
Expand Down Expand Up @@ -1983,10 +1982,7 @@ Now compile:
> cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g version.c
> cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getopt.c
> cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getopt1.c
> cc -g -o bison LR0.o allocate.o closure.o conflicts.o derives.o files.o getargs.o gram.o lalr.o lex.o main.o nullable.o output.o print.o reader.o reduce.o symtab.o warshall.o version.o


getopt.o getopt1.o
> cc -g -o bison LR0.o allocate.o closure.o conflicts.o derives.o files.o getargs.o gram.o lalr.o lex.o main.o nullable.o output.o print.o reader.o reduce.o symtab.o warshall.o version.o getopt.o getopt1.o
> ./files.c:240: warning: mktemp() possibly used unsafely, consider using mkstemp()
> rm -f bison.s1
> sed -e "/^#line/ s|bison|/usr/pkg/share/bison|" < ./bison.simple > bison.s1
Expand Down Expand Up @@ -2123,7 +2119,7 @@ Layout for precompiled binary packages on ftp.netbsd.org:
README
distfiles/
pkgsrc -> /pub/NetBSD/NetBSD-current/pkgsrc
1.3/
1.5/
i386/
All/
archivers/
Expand Down
30 changes: 17 additions & 13 deletions mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.662 2001/02/15 13:49:04 agc Exp $
# $NetBSD: bsd.pkg.mk,v 1.663 2001/02/16 13:06:18 wiz Exp $
#
# This file is in the public domain.
#
Expand Down Expand Up @@ -467,7 +467,11 @@ SCRIPTS_ENV+= ${INSTALL_MACROS}
.undef NO_PACKAGE
.endif

COMMENT?= ${PKGDIR}/COMMENT
.if !defined(COMMENT)
# ${CAT} isn't defined yet at the time this part gets executed
COMMENT!= (/bin/cat ${PKGDIR}/COMMENT || /usr/bin/cat ${PKGDIR}/COMMENT || echo -n "(no description)") 2>/dev/null
.endif

DESCR= ${WRKDIR}/.DESCR
DESCR_SRC?= ${PKGDIR}/DESCR
PLIST= ${WRKDIR}/.PLIST
Expand Down Expand Up @@ -716,8 +720,8 @@ SIZE_PKG_FILE= ${WRKDIR}/.SizePkg
SIZE_ALL_FILE= ${WRKDIR}/.SizeAll

.ifndef PKG_ARGS_COMMON
PKG_ARGS_COMMON= -v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -l
PKG_ARGS_COMMON+= -b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
PKG_ARGS_COMMON= -v -c -"${COMMENT:S/"/\"/g:S/`/\`/g} " -d ${DESCR} -f ${PLIST}
PKG_ARGS_COMMON+= -l -b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
PKG_ARGS_COMMON+= -s ${SIZE_PKG_FILE} -S ${SIZE_ALL_FILE}
PKG_ARGS_COMMON+= -P "`${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true|sort -u`"
.ifdef CONFLICTS
Expand Down Expand Up @@ -2580,6 +2584,11 @@ package-name:
.endif # PACKAGE_NAME_TYPE
.endif # !target(package-name)
.if !target(make-readme-html-help)
make-readme-html-help:
@${ECHO} '${PKGNAME:S/&/\&amp;/g:S/>/\&gt;/g:S/</\&lt;/g}</a>: <TD>'"${COMMENT:S/&/\&amp;/g:S/>/\&gt;/g:S/</\&lt;/g:S/"/\"/g:S/`/\`/g}"
.endif # !target(make-readme-html-help)
# Show (recursively) all the packages this package depends on.
# If PACKAGE_DEPENDS_WITH_PATTERNS is set, print as pattern (if possible)
PACKAGE_DEPENDS_WITH_PATTERNS?=true
Expand Down Expand Up @@ -2831,11 +2840,7 @@ binpkg-list:
describe:
@${ECHO} -n "${PKGNAME}|${.CURDIR}|"; \
${ECHO} -n "${PREFIX}|"; \
if [ -f ${COMMENT} ]; then \
${ECHO} -n "`${CAT} ${COMMENT}`"; \
else \
${ECHO} -n "** No Description"; \
fi; \
${ECHO} -n "${COMMENT:S/"/\"/g:S/`/\`/g}"; \
if [ -f ${DESCR_SRC} ]; then \
${ECHO} -n "|${DESCR_SRC}"; \
else \
Expand Down Expand Up @@ -2940,8 +2945,7 @@ README.html: .PRECIOUS
-e '/%%VULNERABILITIES%%/d' \
-e '/%%VULDATE%%/r $@.tmp6' \
-e '/%%VULDATE%%/d' \
-e '/%%COMMENT%%/r ${PKGDIR}/COMMENT' \
-e '/%%COMMENT%%/d' \
-e "s/%%COMMENT%%/${COMMENT:S/"/\"/g:S/`/\`/g:S|/|\/|g}/" \
-e '/%%BUILD_DEPENDS%%/r $@.tmp1' \
-e '/%%BUILD_DEPENDS%%/d' \
-e '/%%RUN_DEPENDS%%/r $@.tmp2' \
Expand Down Expand Up @@ -3149,7 +3153,7 @@ print-PLIST:
.if !target(fake-pkg)
fake-pkg: ${PLIST} ${DESCR} ${MESSAGE}
${_PKG_SILENT}${_PKG_DEBUG}\
if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then \
if [ ! -f ${PLIST} -o ! -f ${DESCR} ]; then \
${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; \
exit 1; \
fi
Expand Down Expand Up @@ -3213,7 +3217,7 @@ fake-pkg: ${PLIST} ${DESCR} ${MESSAGE}
${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
${PKG_CREATE} ${PKG_ARGS_INSTALL} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \
${CP} ${COMMENT} ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
${ECHO} "${COMMENT:S/"/\"/g:S/`/\`/g}" > ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
${CP} ${BUILD_VERSION_FILE} ${PKG_DBDIR}/${PKGNAME}/+BUILD_VERSION; \
${CP} ${BUILD_INFO_FILE} ${PKG_DBDIR}/${PKGNAME}/+BUILD_INFO; \
if ${TEST} -e ${SIZE_PKG_FILE}; then \
Expand Down
22 changes: 14 additions & 8 deletions mk/bsd.pkg.subdir.mk
@@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.subdir.mk,v 1.40 2001/01/13 15:35:53 tv Exp $
# $NetBSD: bsd.pkg.subdir.mk,v 1.41 2001/02/16 13:06:19 wiz Exp $
# Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
#
Expand Down Expand Up @@ -49,6 +49,7 @@ STRIPFLAG?= -s
.endif

AWK?= /usr/bin/awk
CAT?= /bin/cat
BASENAME?= /usr/bin/basename
ECHO?= echo
ECHO_MSG?= ${ECHO}
Expand Down Expand Up @@ -143,13 +144,9 @@ README.html: .PRECIOUS
.for entry in ${SUBDIR}
.if defined(PKGSRCTOP)
@${ECHO} -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`${ECHO} ${entry} | ${HTMLIFY}`"'</a>: <TD>' >> $@.tmp
@${ECHO} `cd ${entry} && ${MAKE} ${MAKEFLAGS} show-comment | ${HTMLIFY}` >> $@.tmp
.else
@${ECHO} -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} ${MAKEFLAGS} package-name | ${HTMLIFY}`</a>: <TD>" >> $@.tmp
.endif
.if exists(${entry}/pkg/COMMENT)
@${HTMLIFY} ${entry}/pkg/COMMENT >> $@.tmp
.else
@${ECHO} "(no description)" >> $@.tmp
@${ECHO} '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} ${MAKEFLAGS} make-readme-html-help`" >> $@.tmp
.endif
.endfor
@${SORT} -t '>' +3 -4 $@.tmp > $@.tmp2
Expand All @@ -159,7 +156,7 @@ README.html: .PRECIOUS
.else
@> $@.tmp3
.endif
@cat ${README} | \
@${CAT} ${README} | \
${SED} -e 's/%%CATEGORY%%/'"`${BASENAME} ${.CURDIR}`"'/g' \
-e '/%%NUMITEMS%%/r$@.tmp4' \
-e '/%%NUMITEMS%%/d' \
Expand All @@ -181,6 +178,15 @@ README.html: .PRECIOUS
@cd ${subdir} && ${MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" ${_README_TYPE}
.endfor

show-comment:
@if [ "${COMMENT}" ]; then \
${ECHO} "${COMMENT:S/"/''/}"; \
elif [ -f pkg/COMMENT ] ; then \
${CAT} pkg/COMMENT; \
else \
${ECHO} '(no description)'; \
fi

.if !target(show-distfiles)
show-distfiles:
@for entry in ${SUBDIR}; do \
Expand Down
4 changes: 2 additions & 2 deletions pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.77 2001/01/29 10:48:09 abs Exp $
# $NetBSD: Makefile,v 1.78 2001/02/16 13:06:19 wiz Exp $
#

DISTNAME= pkglint-2.36
DISTNAME= pkglint-2.37
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down

0 comments on commit 659515a

Please sign in to comment.