]> Pileus Git - ~andy/sunrise/blob - x11-wm/dwm/dwm-1.3.ebuild
net-nds/lat: Version bump.
[~andy/sunrise] / x11-wm / dwm / dwm-1.3.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.10kloc.org/dwm/"
9 SRC_URI="http://10kloc.org/download/${P}.tar.gz"
10
11 LICENSE="MIT"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE="savedconfig"
15
16 DEPEND="|| ( x11-libs/libX11 <virtual/x11-7 )"
17 RDEPEND="${DEPEND}"
18
19 src_unpack() {
20         unpack ${A}
21         cd "${S}"
22
23         epatch "${FILESDIR}/${P}-config_mk.patch"
24         epatch "${FILESDIR}/${P}-makefile.patch"
25         epatch "${FILESDIR}/${P}-weight.patch"
26
27         if use savedconfig; then
28                 local conf root
29                 [[ -r config.h ]] && rm config.h
30                 for conf in ${PF} ${P} ${PN}; do
31                         for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" /; do
32                                 configfile=${root}etc/portage/savedconfig/${conf}.config.h
33                                 if [[ -r ${configfile} ]]; then
34                                         elog "Found your ${configfile} and using it."
35                                         cp ${configfile} "${S}"/config.h
36                                         return 0
37                                 fi
38                         done
39                 done
40                 ewarn "Could not locate user configfile, so we will save a default one."
41         fi
42 }
43
44 src_compile() {
45         emake CC=$(tc-getCC) || die "emake failed"
46 }
47
48 src_install() {
49         emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
50
51         dodoc README
52 }
53
54 pkg_preinst() {
55         if use savedconfig; then
56                 local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig"
57                 elog "Saving this build config to ${config_dir}/${PF}.config.h"
58                 einfo "Read this ebuild for more info on how to take advantage of this option."
59                 mkdir -p "${config_dir}"
60                 cp "${S}"/config.h "${config_dir}"/${PF}.config.h
61         fi
62 }
63
64 pkg_postinst() {
65         einfo "This ebuild has support for user defined configs"
66         einfo "Please read this ebuild for more details and re-emerge as needed"
67         einfo "if you want to add or remove functionality for ${PN}"
68 }