]> Pileus Git - ~andy/sunrise/blob - x11-wm/dwm/dwm-1.8.ebuild
app-portage/elogviewer: version bump, see CHANGELOG for details
[~andy/sunrise] / x11-wm / dwm / dwm-1.8.ebuild
1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="a dynamic window manager for X11"
8 HOMEPAGE="http://www.shortest.de/view/dynamic+window+manager"
9 SRC_URI="http://www.shortest.de/download/${P}.tar.gz"
10
11 LICENSE="MIT"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE="savedconfig"
15
16 DEPEND="x11-libs/libX11"
17 RDEPEND="${DEPEND}"
18
19 src_unpack() {
20         unpack ${A}
21         cd "${S}"
22
23         epatch "${FILESDIR}/${P}-makefile.patch"
24
25         if use savedconfig; then
26                 local conf root
27                 [[ -r config.h ]] && rm config.h
28                 for conf in ${PF} ${P} ${PN}; do
29                         for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" /; do
30                                 configfile=${root}etc/portage/savedconfig/${conf}.config.h
31                                 if [[ -r ${configfile} ]]; then
32                                         elog "Found your ${configfile} and using it."
33                                         cp ${configfile} "${S}"/config.h
34                                         return 0
35                                 fi
36                         done
37                 done
38                 ewarn "Could not locate user configfile, so we will save a default one."
39         fi
40 }
41
42 src_compile() {
43         local msg
44         use savedconfig && msg=", please check the configfile"
45         emake CC=$(tc-getCC) || die "emake failed${msg}"
46 }
47
48 src_install() {
49         emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
50
51         insinto /usr/share/${PN}
52         newins config.h ${PF}.config.h
53
54         dodoc README
55 }
56
57 pkg_preinst() {
58         mv "${D}"/usr/share/${PN}/${PF}.config.h "${T}"/
59 }
60
61 pkg_postinst() {
62         if use savedconfig; then
63                 local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig"
64                 elog "Saving this build config to ${config_dir}/${PF}.config.h"
65                 einfo "Read this ebuild for more info on how to take advantage of this option."
66                 mkdir -p "${config_dir}"
67                 cp "${T}"/${PF}.config.h "${config_dir}"/${PF}.config.h
68         fi
69         einfo "This ebuild has support for user defined configs"
70         einfo "Please read this ebuild for more details and re-emerge as needed"
71         einfo "if you want to add or remove functionality for ${PN}"
72         if ! has_version x11-misc/dmenu; then
73                 elog "Installing ${PN} without x11-misc/dmenu"
74                 einfo "To have a menu you can install x11-misc/dmenu"
75         fi
76 }