/[gentoo-x86]/eclass/rox-0install.eclass
Gentoo

Contents of /eclass/rox-0install.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat Mar 28 22:01:14 2015 UTC (4 years, 5 months ago) by mrueg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Remove rox.eclass rox-0install.eclass.

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/rox-0install.eclass,v 1.5 2015/01/17 20:54:25 mrueg Exp $
4
5 # @DEAD
6 # ROX-0install eclass Version 1
7
8 # Created by Jim Ramsay (lack@gentoo.org) to ease installation of ROX desktop
9 # applications and integrate this with zeroinstall-injector
10 # (http://0install.net)
11
12 # These variables are only used inside functions, and so may be set anywhere in
13 # the ebuild:
14 #
15 # ZEROINSTALL_STRIP_REQUIRES - this flag, if set, will force the local
16 # zeroinstall feed to have all its 'requires' directives stripped out
17 # LOCAL_FEED_SRC - The ebuild-supplied native feed, for those packages which do
18 # not already contain one. By default we check for ${APPNAME}.xml and
19 # ${APPNAME}/${APPNAME}.xml
20
21 # This is an extension of rox.eclass
22 inherit rox
23
24 DEPEND="${DEPEND}
25 >=rox-base/zeroinstall-injector-0.31"
26
27 # Some locations for ZEROINSTALL
28 NATIVE_FEED_DIR="/usr/share/0install.net/native_feeds"
29 ICON_CACHE_DIR="/var/cache/0install.net/interface_icons"
30
31 # Does all the 0install local feed magic you could want:
32 # - Parses the input file to get the interface URI
33 # - Edits the input file and installs it to the final location
34 # - Installs a local feed pointer
35 #
36 # Environment variables:
37 # ZEROINSTALL_STRIP_REQUIRES - If set, strips all 'requires' sections from the XML
38 # on editing. Default: Not set
39 #
40 # 0install_native_feed <src> <destpath>
41 # src - The XML file we will edit, install, and point at
42 # path - The path where the implementation will be installed
43 # IE, the final edited xml will be at <path>/<basename of src>
44 0install_native_feed() {
45 local src=$1 path=$2
46 local feedfile=${src##*/}
47 local dest="${path}/${feedfile}"
48
49 0distutils "${src}" > tmp.native_feed || die "0distutils feed edit failed"
50
51 if [[ ${ZEROINSTALL_STRIP_REQUIRES} ]]; then
52 # Strip out all 'requires' sections
53 sed -i -e '/<requires.*\/>/d' \
54 -e '/<requires.*\>/,/<\/requires>/d' tmp.native_feed
55 fi
56
57 (
58 insinto ${path}
59 newins tmp.native_feed ${feedfile}
60 )
61
62 local feedname
63 feedname=$(0distutils -e "${src}") || die "0distutils URI escape failed"
64 dosym "${dest}" "${NATIVE_FEED_DIR}/${feedname}"
65
66 local cachedname
67 cachedname=$(0distutils -c "${src}") || die "0distutils URI escape failed"
68 dosym "${path}/.DirIcon" "${ICON_CACHE_DIR}/${cachedname}"
69 }
70
71 # Exported functions
72 rox-0install_src_install() {
73 # First do the regular Rox install
74 rox_src_install
75
76 # Now search for the feed, and install it if found.
77 local search_list="${LOCAL_FEED_SRC} ${APPNAME}/${APPNAME}.xml ${APPNAME}.xml"
78 local installed=""
79 for feed in ${search_list}; do
80 if [[ -f "${feed}" ]]; then
81 0install_native_feed "${feed}" "${APPDIR}/${APPNAME}"
82 installed="true"
83 break
84 fi
85 done
86
87 if [[ -z ${installed} ]]; then
88 ewarn "No native feed found - This application will not be found by 0launch."
89 fi
90 }
91
92 EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20