Subject: building menu datafiles
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 01/08/2001 12:14:21
I want to add some routines so I can automatically generate some datafiles
which can then later be used to create menus, for example for KDE or
Blackbox X11 window manager, from installed packages.

I am looking for some ideas on what the best way to do this would be and
any ideas on a structure for a categorized menu file. 

Basically, I think it can use a package category, binary name and one-line
description. But also it should be able to automatically add menu items
for other user binaries which come in one package.

I am thinking that the menu data could be generated by parsing
/var/db/pkg/ files, but I don't see any common themes; for example 
PKGPATH is not in all the +BUILD_INFO files. Any ideas?

I can look at +BUILD_VERSION to find the category name. Then use this to
look at pkg/PLIST in the actual pkgsrc so I can find each binary.

I can use the +COMMENT file for the description. But I am not
sure about a description for each binary in the same package. Maybe I'll
look at +CONTENTS file for manual pages for binaries (man/man?/*.[18]),
then use the NAME section header (.Sh). Any suggestions?

My other thought is to modify the pkg tools and pkgsrc/mk/ to
automatically add and remove menu datafile entries. Any suggestions about

(Of course, once I have all the menu data compiled, it will be trivial to
generate correct menu files using this information.)

Has this been discussed before?

Any other suggestions?

   Jeremy C. Reed