M net-im/pyaim-t/Manifes...
Lars Strojny authored 17 years ago
|
1) # Copyright 1999-2006 Gentoo Foundation
2) # Distributed under the terms of the GNU General Public License v2
3) # $Header: $
4)
5) #
6) # Original Author: Lars Strojny <lars@strojny.net>
7) # Purpose: Providing macros to handle installation and setup of the py-transport
8) # family
9) #
10)
|
D net-im/pyicq-t/files/p...
Lars Strojny authored 17 years ago
|
11)
12) PYTRANSPORT_LIB_DIR=${PYTRANSPORT_LIB_DIR:=tools data src}
13)
|
M net-im/pyaim-t/Manifes...
Lars Strojny authored 17 years ago
|
14) inherit eutils python
15)
16) ECLASS="pytransport"
17) INHERITED="$INHERITED $ECLASS"
18)
19) EXPORT_FUNCTIONS src_install src_unpack pkg_postinst
20)
21) MY_PN=${PN/-svn/}
22) MY_PV=${PV}
23) MY_P=${MY_PN}-${MY_PV}
24)
25)
26) LICENSE="GPL-2"
27)
28)
29)
30) pytransport_is_subversion() {
31) [[ "${PN}" =~ "^py[a-z]+-t-svn$" ]] && return 0 || return 1
32) }
33)
34)
35) pytransport_is_subversion && S=${WORKDIR}/${PN}
36)
37)
38)
39) if pytransport_is_subversion; then
40) inherit subversion
|
D net-im/pyicq-t/files/p...
Lars Strojny authored 17 years ago
|
41) [ -z "${ESVN_REPO_URI}" ] && ESVN_REPO_URI="svn://svn.blathersource.org/${MY_PN}/trunk"
|
M net-im/pyaim-t/Manifes...
Lars Strojny authored 17 years ago
|
42) SRC_URI=""
43) else
44) SRC_URI="http://www.blathersource.org/download.php/${PN}/${MY_P}.tar.gz"
45) fi
46)
|
M eclass/pytransport.ecl...
Lars Strojny authored 17 years ago
|
47) HOMEPAGE="http://${MY_PN}.blathersource.org/"
|
M net-im/pyaim-t/Manifes...
Lars Strojny authored 17 years ago
|
48)
49) DEPEND=">=net-im/jabber-base-0.0
50) >=dev-lang/python-2.3"
51)
52) RDEPEND=">=dev-python/twisted-1.3.0
53) >=dev-python/twisted-words-0.1.0
54) >=dev-python/twisted-xish-0.1.0
55) >=dev-python/twisted-web-0.5.0
56) >=dev-python/nevow-0.4.1
57) >=dev-python/imaging-1.1"
58)
59)
60)
61)
62)
63) # Create the minimal token name from the package name
64) #
65) # Example: pyicq-t-svn
66) #
67) pytransport_get_human_name() {
68) echo "${MY_PN}" \
69) | sed -e "s:^py\([a-z]*\)-t$:\1:g" \
70) | tr [:lower:] [:upper:]
71) }
72)
73)
74)
75) #
76) # Guess the script name
77) #
78) pytransport_get_script_name() {
79) echo "Py$(pytransport_get_human_name ${PN})t.py"
80) }
81)
82)
83) pytransport_adjust_configfile() {
84) local configfile="$1"
85) dosed \
86) "s:<spooldir>[^\<]*</spooldir>:<spooldir>/var/spool/jabber/</spooldir>:" \
87) "${configfile}" || die "Could not sed ${configfile}"
88) dosed \
89) "s:<pid>[^\<]*</pid>:<pid>/var/run/jabber/${PN}.pid</pid>:" \
90) "${configfile}" || die "Could not sed ${configfile}"
91) return 0
92) }
93)
94) pytransport_get_python_version() {
95) [ -z "${PYVER}" ] && python_version
96) echo "${PYVER}"
97) }
98)
99) pytransport_install_libs() {
100) insinto /usr/lib/python$(pytransport_get_python_version)/site-packages/${PN}/
|
D net-im/pyicq-t/files/p...
Lars Strojny authored 17 years ago
|
101) doins -r ${PYTRANSPORT_LIB_DIR} || \
102) die "Could not install library"
|
M net-im/pyaim-t/Manifes...
Lars Strojny authored 17 years ago
|
103) newins $(pytransport_get_script_name) ${PN}.py || \
104) die "Could not find initial .py-scripts"
105) return 0
106) }
107)
108) PYTRANSPORT_CONFIG=config_example.xml
109)
110) pytransport_install_config() {
111) insinto /etc/jabber
112) newins "${PYTRANSPORT_CONFIG}" ${PN}.xml
113) fperms 600 /etc/jabber/${PN}.xml || die "Could not adjust perms"
114) fowners jabber:jabber /etc/jabber/${PN}.xml || die "Could not adjust perms"
115) return 0
116) }
117)
118) pytransport_generate_initd() {
119) pytransport_is_subversion && local suffix=" (Subversion)"
|
M eclass/pytransport.ecl...
Lars Strojny authored 17 years ago
|
120) echo "#!/sbin/runscript
121)
122)
123) depend() {
|