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

Contents of /trunk/prefix/eclass/rox.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: 3815 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/rox.eclass,v 1.11 2005/12/09 21:16:46 svyatogor Exp $
4
5 # ROX eclass Version 2
6
7 # This eclass was created by Sergey Kuleshov (svyatogor@gentoo.org) and
8 # Alexander Simonov (devil@gentoo.org.ua) to ease installation of ROX desktop
9 # applications. Enhancements and python additions by Peter Hyman.
10
11 # APPNAME - the actual name of the application as the app folder is named
12 # ROX_VER - the minimum version of rox filer required. Default is 2.1.0
13 # ROX_LIB_VER - version of rox-lib required if any
14 # ROX_CLIB_VER - version of rox-clib required if any
15 # SET_PERM - specifies if permisions for arch specific files need to be set
16 # *** not needed anymore ***
17 # note: user no longer has to set SET_PERM in ebuild files since the eclass
18 # will now detect when it has to chmod on-the-fly
19 # *** new ***
20 # KEEP_SRC - this flag, if set, will not remove the source directory
21 # but will do a make clean in it. This is useful if users wish to
22 # preserve the source code for anything
23
24 # For examples refer to ebuilds in rox-extra/
25
26 # need python to byte compile modules, if any
27 inherit python
28
29 if [ -z "${ROX_VER}" ]; then
30 ROX_VER="2.1.0"
31 fi
32
33 DEPEND="${DEPEND}
34 >=rox-base/rox-${ROX_VER}"
35
36 if [ -n "${ROX_LIB_VER}" ]; then
37 DEPEND="${DEPEND}
38 >=rox-base/rox-lib-${ROX_LIB_VER}"
39 fi
40
41 if [ -n "${ROX_CLIB_VER}" ]; then
42 DEPEND="${DEPEND}
43 >=rox-base/rox-clib-${ROX_CLIB_VER}"
44 fi
45
46
47 rox_src_compile() {
48 cd ${APPNAME}
49 #Some packages need to be compiled.
50 chmod 755 ./AppRun
51 if [ -d "src/" ]; then
52 ./AppRun --compile || die "Failed to compile the package"
53 if [ -n ${KEEP_SRC} ]; then
54 ( cd src
55 make clean
56 )
57 else
58 rm -rf src
59 fi
60 # set permissions flag here!
61 SET_PERM=true
62 fi
63 }
64
65 rox_src_install() {
66 if [ -d ${APPNAME}/Help/ ]; then
67 for i in ${APPNAME}/Help/*; do
68 dodoc "${i}"
69 done
70 fi
71 insinto /usr/lib/rox
72 doins -r ${APPNAME}
73
74 #set correct permissions on files, in case they are wrong
75 #include all subdirectories in search, just in case
76 find ${D}/usr/lib/rox/${APPNAME} -name 'AppRun' | xargs chmod 755 >/dev/null 2>&1
77 find ${D}/usr/lib/rox/${APPNAME} -name 'AppletRun' | xargs chmod 755 >/dev/null 2>&1
78
79 # set permissions for programs where we have libdir script
80 if [ -f ${D}/usr/lib/rox/${APPNAME}/libdir ]; then
81 chmod 755 ${D}/usr/lib/rox/${APPNAME}/libdir
82 fi
83
84 # set permissions for programs where we have rox_run script (all who using rox-clib )
85 if [ -f ${D}/usr/lib/rox/${APPNAME}/rox_run ]; then
86 chmod 755 ${D}/usr/lib/rox/${APPNAME}/rox_run
87 fi
88
89 # some programs have choice_install script
90 if [ -f ${D}/usr/lib/rox/${APPNAME}/choice_install ]; then
91 chmod 755 ${D}/usr/lib/rox/${APPNAME}/choice_install
92 fi
93
94 # set permissions on all binares files for compiled programs per arch
95 if [ -n "${SET_PERM}" ]; then
96 ARCH="`uname -m`"
97 case ${ARCH} in
98 i?86) ARCH=ix86 ;;
99 esac
100 PLATFORM="`uname -s`-${ARCH}"
101 chmod -R 755 ${D}/usr/lib/rox/${APPNAME}/${PLATFORM}
102 fi
103
104 #create a script in bin to run the application from command line
105 dodir /usr/bin/
106 cat >${D}/usr/bin/${APPNAME} <<EOF
107 #!/bin/sh
108 exec /usr/lib/rox/${APPNAME}/AppRun "\$@"
109 EOF
110 chmod 755 ${D}/usr/bin/${APPNAME}
111
112 #now compile any and all python files
113 python_mod_optimize ${D}/usr/lib/rox/${APPNAME} >/dev/null 2>&1
114 }
115
116 rox_pkg_postinst() {
117 einfo "${APPNAME} has been installed into /usr/lib/rox"
118 einfo "You can run it by typing ${APPNAME} at the command line."
119 einfo "Or, you can run it by pointing the ROX file manager to the"
120 einfo "install location -- /usr/lib/rox/${APPNAME} -- and click"
121 einfo "on ${APPNAME}'s icon, drag it to a panel, desktop, etc."
122 }
123
124 EXPORT_FUNCTIONS src_compile src_install pkg_postinst

  ViewVC Help
Powered by ViewVC 1.1.20