/[gentoo-x86]/eclass/zproduct.eclass
Gentoo

Contents of /eclass/zproduct.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Thu Jun 26 15:52:05 2003 UTC (17 years, 1 month ago) by kutsuya
Branch: MAIN
Branch point for: RELEASE-1_4
Changes since 1.6: +23 -61 lines
Removed dottxt_protect(), dottxt_unprotect(), and $DOTTXT_PROTECT.
Rewrote do_docs in zproduct_src_install to use $MYDOC for nonstandard
doc names.

1 kutsuya 1.1 # Copyright 2003 Gentoo Technologies, Inc.
2     # Distributed under the terms of the GNU General Public License v2
3     # Author: Jason Shoemaker <kutsuya@gentoo.org>
4 kutsuya 1.5 # $Header: $
5 kutsuya 1.1
6     # This eclass is designed to streamline the construction of
7     # ebuilds for new zope products
8    
9     ECLASS=zproduct
10     INHERITED="${INHERITED} ${ECLASS}"
11 kutsuya 1.6 EXPORT_FUNCTIONS src_install pkg_prerm pkg_postinst pkg_config
12 kutsuya 1.1
13 vapier 1.4 DESCRIPTION="This is a zope product"
14 kutsuya 1.1 HOMEPAGE=""
15     SRC_URI=""
16     DEPEND=""
17 kutsuya 1.5 RDEPEND=">=net-zope/zope-2.6.0-r2
18 kutsuya 1.3 app-admin/zprod-manager"
19 kutsuya 1.1 IUSE=""
20     SLOT="0"
21 kutsuya 1.7 KEYWORDS="x86 ppc"
22 kutsuya 1.1 S=${WORKDIR}
23    
24 kutsuya 1.3 ZI_DIR="${ROOT}/var/lib/zope/"
25     ZP_DIR="${ROOT}/usr/share/zproduct"
26 kutsuya 1.1 DOT_ZFOLDER_FPATH="${ZP_DIR}/${PF}/.zfolder.lst"
27 kutsuya 1.3
28 kutsuya 1.1 zproduct_src_install()
29     {
30     ## Assume that folders or files that shouldn't be installed
31 kutsuya 1.3 # in the zproduct directory have been already been removed.
32 kutsuya 1.1 ## Assume $S set to the parent directory of the zproduct(s).
33    
34     debug-print-function ${FUNCNAME} ${*}
35     [ -n "${ZPROD_LIST}" ] || die "ZPROD_LIST isn't defined."
36     [ -z "${1}" ] && zproduct_src_install all
37    
38     # set defaults
39     into ${ZP_DIR}
40     dodir ${ZP_DIR}/${PF}
41    
42     while [ -n "$1" ] ; do
43     case ${1} in
44     do_zpfolders)
45     ## Create .zfolders.lst from $ZPROD_LIST.
46     debug-print-section do_zpfolders
47     for N in ${ZPROD_LIST} ; do
48     echo ${N} >> ${D}/${DOT_ZFOLDER_FPATH}
49     done ;;
50     do_docs)
51     #*Moves txt docs
52     debug-print-section do_docs
53 kutsuya 1.7 docs_move
54     for ZPROD in ${ZPROD_LIST} ; do
55     docs_move ${ZPROD}/
56 kutsuya 1.1 done ;;
57     do_install)
58     debug-print-section do_install
59     # Copy everything that's left to ${D}${ZP_DIR}
60     cp -a ${S}/* ${D}/${ZP_DIR}/${PF} ;;
61    
62     all)
63     debug-print-section all
64     zproduct_src_install do_zpfolders do_docs do_install ;;
65     esac
66     shift
67     done
68     debug-print "${FUNCNAME}: result is ${RESULT}"
69     }
70    
71 kutsuya 1.7 docs_move()
72     {
73     # if $1 == "/", then this breaks.
74     if [ -n "$1" ] ; then
75     docinto $1
76     else
77     docinto /
78     fi
79     dodoc $1HISTORY.txt $1README{.txt,} $1INSTALL{.txt,} > /dev/null
80     dodoc $1AUTHORS $1COPYING $1CREDITS.txt $1TODO{.txt,} > /dev/null
81     dodoc $1LICENSE{.GPL,.txt,} $1CHANGES{.txt,} > /dev/null
82     dodoc $1DEPENDENCIES.txt $1FAQ.txt $1UPGRADE.txt > /dev/null
83     for item in ${MYDOC} ; do
84     dodoc ${1}${item} > /dev/null
85     done
86     }
87    
88 kutsuya 1.1 zproduct_pkg_postinst()
89     {
90     #*check for multiple zinstances, if several display install help msg.
91    
92     #*Use zprod-update to install this zproduct to the default zinstance.
93     debug-print-function ${FUNCNAME} ${*}
94     chown -R zope:root ${ZP_DIR}/${PF}
95 kutsuya 1.3 einfo ">>> Installing ${PF} into the \"$(zope-config --zidef-get)\" zinstance..."
96     ${ROOT}/usr/sbin/zprod-manager add ${ZP_DIR}/${PF}
97 kutsuya 1.1 }
98 kutsuya 1.7
99     # This function is deprecated! Still used, until a new system developed.
100 kutsuya 1.1
101     zproduct_pkg_prerm()
102     {
103     # remove this zproduct from all zinstances.
104     # process zinstance.lst and proceed with zprod-update del
105     debug-print-function ${FUNCNAME} ${*}
106     ewarn "Uninstalling from all zinstances..."
107     ZINST_LST=$(ls /var/lib/zope/)
108     if [ "${ZINST_LST}" ] ; then
109     for N in ${ZINST_LST} ; do
110 kutsuya 1.3 ${ROOT}/usr/sbin/zprod-manager del ${ZP_DIR}/${PF} ${ZI_DIR}${N}
111 kutsuya 1.1 done
112     fi
113     }
114    
115     # Add this zproduct to the top zinstance.
116    
117     zproduct_pkg_config()
118     {
119     einfo "To add zproducts to other zinstances execute:"
120 kutsuya 1.3 einfo "\tzprod-manager add"
121 kutsuya 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20