#Maintainer: Thorsten Muehlfelder <thenktor(at)gmx.de>

pkgname=openbox-menu
pkgver=0.3.6.1
pkgrel=1tm
source=("http://mimarchlinux.googlecode.com/files/openbox-menu-$pkgver.tar.bz2")
url="http://mimasgpc.free.fr/openbox-menu_en.html"
docs=('AUTHORS' 'ChangeLog' 'COPYING')
# extra suggests: lxmenu-data

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (dynamic menus for openbox)"
"Tool to create dynamic menus using Openbox pipe menus."
"It uses menu-cache from the LXDE project for menu generation."
)

build() {
	cd $startdir/src/${pkgname}-${pkgver}
	make -j $numjobs || return 1
	mkdir -p $startdir/pkg/usr/bin
	install -m755 openbox-menu $startdir/pkg/usr/bin
	
	mkdir -p $startdir/pkg/usr/doc/$pkgname-$pkgver
	cat << EOF > $startdir/pkg/usr/doc/$pkgname-$pkgver/README.Slackware
See latest help at: http://mimasgpc.free.fr/openbox-menu_en.html

Installation
-------------

Dynamic menu configuration is to be done in the menu.xml file from
/etc/xdg/openbox or in the /home/USER/.config/openbox directory. I
recommand to choose your personal directory for the configuration file,
but it’s up to you.

The program uses, as default, applications.menu from
/etc/xdg/menus directory. It’s possible to use another file but it has
to be located in /etc/xdg/menus directory (that’s the way libmenu-cache
library works).

First step, the dynamic menu needs to be declared in menu.xml this way.

<menu id="desktop-app-menu" label="Applications" execute="<path-to-exec>/openbox-menu" />

Openbox-menu will use applications.menu by default. If you want to use
another menu description, ie lxde-applications.menu provided by
lxmenu-data, just add the filename as argument.

<menu id="desktop-app-menu" label="Applications" execute="<path-to-exec>/openbox-menu lxde-applications.menu" />

Second step, now you’ll have to add this next line where the menu should
appear in openbox root-menu menu.

 <menu id="desktop-app-menu" />

Take a look at the menu.xml example below, it should be easier to
understand.

Post-installation
------------------

Libmenu-cache uses the menu-cached daemon to shorten the menu generation
time. Therefore I recommand to add menu-cached in the openbox start file
(~/.config/openbox/autostart.sh).
EOF
}