]> Pileus Git - ~andy/sunrise/blob - x11-wm/dwm/dwm-1.7.1.ebuild
x11-wm/dwm: Version bump
[~andy/sunrise] / x11-wm / dwm / dwm-1.7.1.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}-config_mk.patch"
24         epatch "${FILESDIR}/${P}-makefile.patch"
25
26         if use savedconfig; then
27                 local conf root
28                 [[ -r config.h ]] && rm config.h
29                 for conf in ${PF} ${P} ${PN}; do
30                         for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" /; do
31                                 configfile=${root}etc/portage/savedconfig/${conf}.config.h
32                                 if [[ -r ${configfile} ]]; then
33                                         elog "Found your ${configfile} and using it."
34                                         cp ${configfile} "${S}"/config.h
35                                         return 0
36                                 fi
37                         done
38                 done
39                 ewarn "Could not locate user configfile, so we will save a default one."
40         fi
41 }
42
43 src_compile() {
44         local msg
45         use savedconfig && msg=", please check the configfile"
46         emake CC=$(tc-getCC) || die "emake failed${msg}"
47 }
48
49 src_install() {
50         emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
51
52         insinto /usr/share/${PN}
53         newins config.h ${PF}.config.h
54
55         dodoc README
56 }
57
58 pkg_preinst() {
59         mv "${D}"/usr/share/${PN}/${PF}.config.h "${T}"/
60 }
61
62 pkg_postinst() {
63         if use savedconfig; then
64                 local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig"
65                 elog "Saving this build config to ${config_dir}/${PF}.config.h"
66                 einfo "Read this ebuild for more info on how to take advantage of this option."
67                 mkdir -p "${config_dir}"
68                 cp "${T}"/${PF}.config.h "${config_dir}"/${PF}.config.h
69         fi
70         einfo "This ebuild has support for user defined configs"
71         einfo "Please read this ebuild for more details and re-emerge as needed"
72         einfo "if you want to add or remove functionality for ${PN}"
73         if ! has_version x11-misc/dmenu; then
74                 elog "Installing ${PN} without x11-misc/dmenu"
75                 einfo "To have a menu you can install x11-misc/dmenu"
76         fi
77 }