2295c1c62798e4bbff1efe1b83376002c9df2b44
Lars Strojny 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) 
Lars Strojny 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) 
Lars Strojny 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
Lars Strojny Fixing SVN URI

Lars Strojny authored 17 years ago

41) 	[ -z "${ESVN_REPO_URI}" ] && ESVN_REPO_URI="http://svn.blathersource.org/${MY_PN}/trunk"
Lars Strojny 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) 
Lars Strojny M eclass/pytransport.ecl...

Lars Strojny authored 17 years ago

47) HOMEPAGE="http://${MY_PN}.blathersource.org/"
Lars Strojny 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
Lars Strojny Upgrade to ejabberd-1.1.3

Lars Strojny authored 17 years ago

54) 	<dev-python/twisted-words-0.4
Lars Strojny M net-im/pyaim-t/Manifes...

Lars Strojny authored 17 years ago

55) 	>=dev-python/twisted-xish-0.1.0
Lars Strojny Upgrade to ejabberd-1.1.3

Lars Strojny authored 17 years ago

56) 	=dev-python/twisted-web-0.5*
Lars Strojny M net-im/pyaim-t/Manifes...

Lars Strojny authored 17 years ago

57) 	>=dev-python/nevow-0.4.1
Lars Strojny Upgrade to ejabberd-1.1.3

Lars Strojny authored 17 years ago

58) 	<dev-python/nevow-0.8
Lars Strojny M net-im/pyaim-t/Manifes...

Lars Strojny authored 17 years ago

59) 	>=dev-python/imaging-1.1"
60) 
Bernd Wurst eigenes duplicity ebuild ni...

Bernd Wurst authored 17 years ago

61) PYTRANSPORT_CONFIG=config_example.xml
Lars Strojny M net-im/pyaim-t/Manifes...

Lars Strojny authored 17 years ago

62) 
63) 
64) 
65) 
66) # Create the minimal token name from the package name
67) #
68) # Example: pyicq-t-svn
69) #
70) pytransport_get_human_name() {
71) 	echo "${MY_PN}" \
72) 		| sed -e "s:^py\([a-z]*\)-t$:\1:g" \
73) 		| tr [:lower:] [:upper:]
74) }
75) 
76) 
77) 
78) #
79) # Guess the script name
80) #
81) pytransport_get_script_name() {
82) 	echo "Py$(pytransport_get_human_name ${PN})t.py"
83) }
84) 
85) 
86) pytransport_adjust_configfile() {
87) 	local configfile="$1"
88) 	dosed \
89) 		"s:<spooldir>[^\<]*</spooldir>:<spooldir>/var/spool/jabber/</spooldir>:" \
90) 		"${configfile}" || die "Could not sed ${configfile}"
91) 	dosed \
92) 		"s:<pid>[^\<]*</pid>:<pid>/var/run/jabber/${PN}.pid</pid>:" \
93) 		"${configfile}" || die "Could not sed ${configfile}"
94) 	return 0
95) }
96) 
97) pytransport_get_python_version() {
98) 	[ -z "${PYVER}" ] && python_version
99) 	echo "${PYVER}"
100) }
101) 
102) pytransport_install_libs() {
103) 	insinto /usr/lib/python$(pytransport_get_python_version)/site-packages/${PN}/
Lars Strojny D net-im/pyicq-t/files/p...

Lars Strojny authored 17 years ago

104) 	doins -r ${PYTRANSPORT_LIB_DIR} || \
105) 		die "Could not install library"
Lars Strojny M net-im/pyaim-t/Manifes...

Lars Strojny authored 17 years ago

106) 	newins $(pytransport_get_script_name) ${PN}.py || \
107) 		die "Could not find initial .py-scripts"
108) 	return 0
109) }
110) 
111) 
112) pytransport_install_config() {
113) 	insinto /etc/jabber
114) 	newins "${PYTRANSPORT_CONFIG}" ${PN}.xml
115) 	fperms 600 /etc/jabber/${PN}.xml || die "Could not adjust perms"
116) 	fowners jabber:jabber /etc/jabber/${PN}.xml || die "Could not adjust perms"
117) 	return 0
118) }
119) 
120) pytransport_generate_initd() {
121) 	pytransport_is_subversion && local suffix=" (Subversion)"
Lars Strojny M eclass/pytransport.ecl...

Lars Strojny authored 17 years ago

122) 	echo "#!/sbin/runscript
123) 
124) 
125) depend() {