/[gentoo-alt]/trunk/prefix/eclass/commonbox.eclass
Gentoo

Contents of /trunk/prefix/eclass/commonbox.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 4158 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/commonbox.eclass,v 1.30 2005/08/23 14:55:11 swegener Exp $
4 #
5 # Author: Seemant Kulleen <seemant@gentoo.org>
6 #
7 # The commonbox eclass is designed to allow easier installation of the box
8 # window managers such as blackbox and fluxbox and commonbox
9 # The common utilities of those window managers get installed in the
10 # commonbox-utils dependency, and default styles with the commonbox-styles
11 # utility. They all share the /usr/share/commonbox directory now.
12
13
14 EXPORT_FUNCTIONS src_compile src_install pkg_postinst
15
16 IUSE="nls kde gnome xinerama truetype"
17
18 DEPEND="dev-util/pkgconfig
19 =sys-apps/sed-4*"
20
21 RDEPEND="nls? ( sys-devel/gettext )
22 x11-misc/commonbox-utils
23 x11-themes/commonbox-styles"
24
25 PROVIDE="virtual/blackbox"
26
27 myconf=""
28 MYCONF=""
29 mydoc=""
30 BOOTSTRAP=""
31 FORCEXFT=""
32
33 if [ -z "${MYBIN}" ]
34 then
35 MYBIN="${PN}"
36 fi
37
38 commonprep() {
39
40 sed -i -e 's:data ::' ${S}/Makefile.am
41
42 sed -i -e 's:bsetbg::; s:bsetroot::' ${S}/util/Makefile.am
43
44 sed -i -e 's:bsetroot.1::; s:bsetbg.1::' ${S}/doc/Makefile.am
45
46 for i in `find ${S} -name 'Makefile.am'`
47 do
48 sed -i -e 's:$(pkgdatadir)/nls:/usr/share/locale:' ${i}
49 done
50
51 for i in `find ${S}/nls -name 'Makefile.am'`
52 do
53 sed -i -e "s:blackbox.cat:${MYBIN}.cat:g; s:${PN}.cat:${MYBIN}.cat:g" ${i}
54 done
55
56 for i in `find ${S}/src -name 'Makefile*'`
57 do
58 sed -i -e "s:/styles/Results:/styles/Fury-NG:" \
59 -e "s:/styles/mbdtex:/styles/Fury-NG:" \
60 -e "s:/styles/Clean:/styles/Fury-NG:" ${i}
61 done
62
63 }
64
65 commonbox_src_compile() {
66
67 commonprep
68
69 if [ -z "${BOOTSTRAP}" ]
70 then
71 aclocal
72 automake
73 autoconf
74 else
75 ./bootstrap
76 fi
77
78 use nls \
79 && myconf="${myconf} --enable-nls" \
80 || myconf="${myconf} --disable-nls"
81
82 use kde \
83 && myconf="${myconf} --enable-kde" \
84 || myconf="${myconf} --disable-kde"
85
86 use gnome \
87 && myconf="${myconf} --enable-gnome" \
88 || myconf="${myconf} --disable-gnome"
89
90 use xinerama \
91 && myconf="${myconf} --enable-xinerama" \
92 || myconf="${myconf} --disable-xinerama"
93
94 use truetype \
95 && myconf="${myconf} --enable-xft" \
96 || myconf="${myconf} --disable-xft"
97
98 if [ -z "${MYCONF}" ]
99 then
100 econf \
101 --sysconfdir=/etc/X11/${MYBIN} \
102 --datadir=/usr/share/commonbox \
103 ${myconf} || die
104 else
105 econf \
106 --sysconfdir=/etc/X11/${MYBIN} \
107 --datadir=/usr/share/commonbox \
108 ${myconf} ${MYCONF} || die
109 fi
110
111 [ ! -z "${FORCEXFT}" ] && echo "#define XFT 1" >> ${S}/config.h
112
113 emake \
114 pkgdatadir=/usr/share/commonbox || die
115
116 }
117
118
119 commonbox_src_install() {
120
121 dodir /usr/share/commonbox/${PN}
122
123 make DESTDIR=${D} install || die
124
125 # move the ${PN} binary to ${MYBIN}
126
127 if [ "${MYBIN}" != "${PN}" ]
128 then
129 mv ${D}/usr/bin/${PN} ${D}/usr/bin/${MYBIN}
130
131 # same to manpage
132 rm ${D}/usr/share/man/man1/${PN}.1
133 mv doc/${PN}.1 doc/${MYBIN}.1
134 doman doc/${MYBIN}.1
135 fi
136
137 dodoc README* AUTHORS TODO* ${mydoc}
138
139 # move nls stuff
140 use nls && ( \
141 dodir /usr/share/commonbox/${MYBIN}
142 mv ${D}/usr/share/${PN}/nls ${D}/usr/share/commonbox/${MYBIN}
143 )
144
145 rmdir ${D}/usr/share/${MYBIN}
146
147 dodir /etc/X11/Sessions
148 echo "/usr/bin/${MYBIN}" > ${D}/etc/X11/Sessions/${MYBIN}
149 fperms a+x /etc/X11/Sessions/${MYBIN}
150 }
151
152 commonbox_pkg_postinst() {
153 #notify user about the new share dir
154 if [ -d /usr/share/commonbox ]
155 then
156 einfo
157 einfo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
158 einfo "! ${MYBIN} no longer uses /usr/share/${MYBIN} as the !"
159 einfo "! default share directory to contain styles and menus. !"
160 einfo "! The default directory is now /usr/share/commonbox !"
161 einfo "! Please move any files in /usr/share/${MYBIN} that you !"
162 einfo "! wish to keep (personal styles and your menu) into the !"
163 einfo "! new directory and modify your menu files to point all !"
164 einfo "! listed paths to the new directory. !"
165 einfo "! Also, be sure to update the paths in each user's !"
166 einfo "! config file found in their home directory. !"
167 einfo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
168 einfo
169 fi
170
171 commonbox-menugen -kg
172 }

  ViewVC Help
Powered by ViewVC 1.1.20