1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit toolchain-funcs
7 DESCRIPTION="a dynamic window manager for X11"
8 HOMEPAGE="http://suckless.org/view/dynamic+window+manager"
9 SRC_URI="http://suckless.org/download/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
16 DEPEND="x11-libs/libX11"
25 Makefile || die "sed failed"
28 -e "s/CFLAGS = -Os/CFLAGS +=/" \
29 -e "s/LDFLAGS =/LDFLAGS +=/" \
30 config.mk || die "sed failed"
32 if use savedconfig; then
34 [[ -r config.h ]] && rm config.h
35 for conf in ${PF} ${P} ${PN}; do
36 for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" /; do
37 configfile=${root}etc/portage/savedconfig/${conf}.config.h
38 if [[ -r ${configfile} ]]; then
39 elog "Found your ${configfile} and using it."
40 cp ${configfile} "${S}"/config.h
45 ewarn "Could not locate user configfile, so we will save a default one."
51 use savedconfig && msg=", please check the configfile"
52 emake CC=$(tc-getCC) || die "emake failed${msg}"
56 emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
58 insinto /usr/share/${PN}
59 newins config.h ${PF}.config.h
61 exeinto /etc/X11/Sessions
62 newexe "${FILESDIR}"/dwm-session dwm
68 mv "${D}"/usr/share/${PN}/${PF}.config.h "${T}"/
72 if use savedconfig; then
73 local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig"
74 elog "Saving this build config to ${config_dir}/${PF}.config.h"
75 einfo "Read this ebuild for more info on how to take advantage of this option."
76 mkdir -p "${config_dir}"
77 cp "${T}"/${PF}.config.h "${config_dir}"/${PF}.config.h
79 einfo "This ebuild has support for user defined configs"
80 einfo "Please read this ebuild for more details and re-emerge as needed"
81 einfo "if you want to add or remove functionality for ${PN}"
82 if ! has_version x11-misc/dmenu; then
83 elog "Installing ${PN} without x11-misc/dmenu"
84 einfo "To have a menu you can install x11-misc/dmenu"
86 einfo "You can custom status bar with a script in HOME/.dwm/dwmrc"
87 einfo "the ouput is redirected to the standard input of dwm"