Знающие люди, проверьте пожалуйста ebuild. Правильно ли я их написал?
S-anches 15 марта, 2009 - 14:22
# Copyright 1999-2009 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils webapp depend.php
DESCRIPTION="Automated payment system SUB Billing"
SRC_URI="http://www.subbilling.info/files/${P}.tar.gz"
HOMEPAGE="http://www.subbilling.info/"
KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86 x86-fbsd"
LICENSE="GPL-2"
IUSE=""
DEPEND=""
RDEPEND=">=virtual/mysql-5.0"
need_httpd_cgi
need_php_httpd
S="${WORKDIR}"/${P}
pkg_setup() {
webapp_pkg_setup
if ! PHPCHECKNODIE="yes" require_php_with_use session unicode calendar \
|| ! PHPCHECKNODIE="yes" require_php_with_any_use mysql mysqli ; then
eerror
eerror "${PHP_PKG} needs to be re-installed with all of the following"
eerror "USE flags enabled:"
eerror
eerror "session unicode calendar"
eerror
eerror "as well as any of the following USE flags enabled:"
eerror
eerror "mysql or mysqli if using dev-lang/php-5"
eerror
die "Re-install ${PHP_PKG}"
fi
}
src_unpack() {
unpack ${A}
cd "${S}"
}
src_install() {
webapp_src_preinst
insinto "${MY_HTDOCSDIR}"
doins -r .
webapp_postinst_txt en "${FILESDIR}"/postinstall-en-0.32.txt
webapp_postinst_txt ru "${FILESDIR}"/postinstall-ru-0.32.txt
webapp_src_install
}
Есть ли какие то ошибки, недостатки?
Заранее спасибо.
И второй.
# Copyright 1999-2009 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
DESCRIPTION="Automated payment system SUB Billing"
SRC_URI="http://www.subbilling.info/files/${P}.tar.gz"
HOMEPAGE="http://www.subbilling.info/"
KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86 x86-fbsd"
SLOT="0"
LICENSE="GPL-2"
IUSE=""
DEPEND=""
RDEPEND="net-analyzer/ipcad
dev-lang/perl
net-firewall/iptables
www-servers/apache
dev-lang/php
dev-db/mysql
dev-perl/DBD-mysql
sys-apps/iproute2
net-analyzer/subbilling-www"
src_unpack() {
unpack ${A}
cd "${S}/scripts"
epatch "${FILESDIR}/subbilling_flow.patch"
epatch "${FILESDIR}/subbilling_periodic.patch"
epatch "${FILESDIR}/subbilling_sessions.patch"
cd "${S}/scripts/inc"
epatch "${FILESDIR}/common.inc.patch"
epatch "${FILESDIR}/functions.inc.patch"
mv ${S}/scripts/inc ${S}/scripts/subbilling
cd "${S}"
}
src_install() {
dodoc Documentation/*
dosbin scripts/*
insinto /usr/lib/subbilling
doins scripts/subbilling/*
insinto /etc
insopts -m0600
newins etc/subbilling.conf subbilling.conf
newinitd "${FILESDIR}"/subbilling.init subbilling
}
»
- Для комментирования войдите или зарегистрируйтесь

Рекомендации
В обои добавь "EAPI=2", после чего можешь отказать от конструкции
if ! PHPCHECKNODIE="yes" require_php_with_use session unicode calendar \ || ! PHPCHECKNODIE="yes" require_php_with_any_use mysql mysqli ; thenВ пользу
RDEPEND=">=virtual/mysql-5.0 dev-lang/php[session,unicode,calendar] "И тд.
Кейворды всегда надо ставить только те, на которых тебе известно, что утилита работает, плюс надо маскировать в обязательном порядке.
В первом src_unpack() вроде как вообще не нужен. Во втором куча лишних телодвижений по патчу файлов. Конструкции
cd "foobar"вообще не нужны. Нужно делать диффы от корня проекта, чтобы получаемые патчи налагались сразу к дереву каталогов.newinitd "${FILESDIR}"/subbilling.init subbillingЕсли есть initd, должен быть по идее и confd.
Прогони ebuild через repoman, он укажет тебе на много возможных ошибок.
Не грусти, товарищ! Всё хорошо, beautiful good!
Создал патч относительно
Создал патч относительно директории. Вот такой вот он:
diff -Naur subbilling-0.32/scripts/inc/common.inc.pl subbilling/scripts/inc/common.inc.pl --- subbilling-0.32/scripts/inc/common.inc.pl 2009-03-15 19:03:48.000000000 +0700 +++ subbilling/scripts/inc/common.inc.pl 2009-03-15 19:03:17.000000000 +0700 @@ -2,7 +2,7 @@ use DynaLoader; use DBI; -require '/usr/lib/subbilling/functions.inc.pl'; +require 'inc/functions.inc.pl'; %config = read_config(); diff -Naur subbilling-0.32/scripts/inc/functions.inc.pl subbilling/scripts/inc/functions.inc.pl --- subbilling-0.32/scripts/inc/functions.inc.pl 2009-03-15 19:04:00.000000000 +0700 +++ subbilling/scripts/inc/functions.inc.pl 2009-03-15 19:03:17.000000000 +0700 @@ -47,7 +47,7 @@ sub read_config { my %config = (); - open CONF, "< /etc/subbilling.conf"; + open CONF, "< $FindBin::Bin/subbilling.conf"; while (<CONF>) { if (m/^([^#].*?)\s+(.*?)$/) { $config{$1} = $2; diff -Naur subbilling-0.32/scripts/subbilling_flow.pl subbilling/scripts/subbilling_flow.pl --- subbilling-0.32/scripts/subbilling_flow.pl 2009-03-15 19:04:17.000000000 +0700 +++ subbilling/scripts/subbilling_flow.pl 2009-03-15 19:03:17.000000000 +0700 @@ -6,7 +6,7 @@ use IO::Socket::INET; use Time::Local; -require '/usr/lib/subbilling/common.inc.pl'; +require 'inc/common.inc.pl'; my $receive_port = 9996 ; my $packet = undef ; .........И конечно же он не применяется. Хотя например у ipcad такой же патч, где сравниваются директория ipcad-3.7 и ipcad.
Не понимаю...
Ещё страннее. Сделал ещё раз патч точно так-же, заработал...
Переделал ebuild по вашим
Переделал ebuild по вашим заметкам, и ошибкам repoman, вот что получилось:
sanches@sanches ~/svn/subbilling/branches/gentoo-ebuild $ cat net-analyzer/subbilling/subbilling-0.32.ebuild # Copyright 1999-2009 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Automated payment system SUB Billing" SRC_URI="http://www.subbilling.info/files/${P}.tar.gz" HOMEPAGE="http://www.subbilling.info/" KEYWORDS="x86" SLOT="0" LICENSE="GPL-2" IUSE="" EAPI=2 DEPEND="" RDEPEND="net-analyzer/ipcad dev-lang/perl net-firewall/iptables www-servers/apache dev-lang/php dev-db/mysql dev-perl/DBD-mysql sys-apps/iproute2 net-analyzer/subbilling-www" src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}/${P}-gentoo.patch" cd "${S}" } src_install() { dodoc Documentation/* dosbin scripts/* insinto /usr/lib/subbilling doins scripts/inc/* insinto /etc insopts -m0600 newins etc/subbilling.conf subbilling.conf newinitd "${FILESDIR}"/subbilling.init subbilling }sanches@sanches ~/svn/subbilling/branches/gentoo-ebuild $ cat net-analyzer/subbilling-www/subbilling-www-0.32.ebuild # Copyright 1999-2009 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils webapp depend.php DESCRIPTION="Web interface for SUB Billing" SRC_URI="http://www.subbilling.info/files/${P}.tar.gz" HOMEPAGE="http://www.subbilling.info/" KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc x86 ~x86-fbsd" LICENSE="GPL-2" IUSE="" EAPI=2 DEPEND="" RDEPEND=">=virtual/mysql-5.0 dev-lang/php[session,unicode,calendar]" need_httpd_cgi need_php_httpd S="${WORKDIR}"/${P} pkg_setup() { webapp_pkg_setup } src_install() { webapp_src_preinst insinto "${MY_HTDOCSDIR}" doins -r . webapp_postinst_txt en "${FILESDIR}"/postinstall-en-0.32.txt webapp_postinst_txt ru "${FILESDIR}"/postinstall-ru-0.32.txt webapp_src_install }А как можно добавить ebuild в основную ветку портежей? Какие действия для этого необходимы?
Создать баг на
Создать баг на bugs.gentoo.org с названием типа "New ebuild blahblah", и рассказать, что хочешь.
А по русски там кто ни будь
А по русски там кто ни будь говорит? :)
Я с английсим не очень дружу.
Может лучше к alexxy обратиться?
ответит то же самое ;) Вообще
ответит то же самое ;) Вообще смотрите http://www.gentoo.ru/node/11137
его возьмут в дерево если
его возьмут в дерево если комуто захочется с ним возится. но в любом случае он будет хотябы там. гораздо реальнее сунуть его в sunrise
Почему бы мне с ним не
Почему бы мне с ним не повозиться? Или там возятся только те, кто включен в develop команду?
самому в sunrise
самому в sunrise