summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2009-11-26 09:20:29 +0000
committerPeter Volkov <pva@gentoo.org>2009-11-26 09:20:29 +0000
commit48cc99a1f9ea7852548442882d3a360b47eea0e8 (patch)
treede59b9b88e5536ec88495881998c789fc574ca57 /net-misc
parentsys-kernel/gentoo-sources: 2.6.27.39 merged in. (diff)
downloadpva-48cc99a1f9ea7852548442882d3a360b47eea0e8.tar.gz
pva-48cc99a1f9ea7852548442882d3a360b47eea0e8.tar.bz2
pva-48cc99a1f9ea7852548442882d3a360b47eea0e8.zip
Added net-misc/utm5: cleaned ebuild and probably I'll push init scripts here soon too.
svn path=/; revision=334
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/utm5/ChangeLog25
-rw-r--r--net-misc/utm5/Manifest10
-rwxr-xr-xnet-misc/utm5/files/utm5_core59
-rwxr-xr-xnet-misc/utm5/files/utm5_radius16
-rwxr-xr-xnet-misc/utm5/files/utm5_rfw74
-rw-r--r--net-misc/utm5/files/utm5_rfw.conf13
-rw-r--r--net-misc/utm5/metadata.xml8
-rw-r--r--net-misc/utm5/utm5-2.1.004.ebuild100
-rw-r--r--net-misc/utm5/utm5-2.1.007.ebuild102
9 files changed, 407 insertions, 0 deletions
diff --git a/net-misc/utm5/ChangeLog b/net-misc/utm5/ChangeLog
new file mode 100644
index 0000000..61d960f
--- /dev/null
+++ b/net-misc/utm5/ChangeLog
@@ -0,0 +1,25 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+*utm5-2.1.007 (26 Oct 2009)
+
+ 26 Oct 2009; Peter Volkov <pva@gentoo.org> +utm5-2.1.004.ebuild,
+ +utm5-2.1.007.ebuild:
+ I'm tired to update ebuild every time I download it from NetUP. Thus I've
+ decided to push it into overlay and maintain here. Version bump. Misc
+ cleanups, added amd64 support.
+
+*utm5-1.10.009 (07 Mar 2005)
+
+ 07 Mar 2005; Peter Volkov <pva@gentoo.org> utm5-1.10.009.ebuild:
+
+ The begining.
+
+ Added initial ChangeLog which should be updated whenever the package is
+ updated in any way. This changelog is targetted to users. This means that
+ the comments should well explained and written in clean English. The
+ details about writing correct changelogs are explained in the
+ skel.ChangeLog file which you can find in the root directory of the
+ portage repository.
+
diff --git a/net-misc/utm5/Manifest b/net-misc/utm5/Manifest
new file mode 100644
index 0000000..235f225
--- /dev/null
+++ b/net-misc/utm5/Manifest
@@ -0,0 +1,10 @@
+AUX utm5_core 1652 RMD160 ed93602288653a19bd29cdf6c05ac9b303009546 SHA1 17d84a786fabfa7faf402d1a2ad7bb5e56fa6900 SHA256 82501c5564e0cbd8ca19866504751aff1ac512d16023377ed7cfe06b48c45849
+AUX utm5_radius 423 RMD160 2abfbba6d09773ef9bc2a2545b52997897739074 SHA1 be20f3ab10fd160c04ad669f8085a02f6f92bb92 SHA256 b752190f0b7670eef82c5040181fb103a2584e65ce9761de058ba8789458ff4c
+AUX utm5_rfw 2032 RMD160 d24533c766209dca02ce3f7b094df68dfebd0648 SHA1 8630e3fa6feef9e22b2090e101aec746a00d7668 SHA256 8a3b20793f29533ba0d3bab35c017ca7b5fd2cde6e2e20d8ac256a9d11e2c045
+AUX utm5_rfw.conf 457 RMD160 6bf2d9cd9977f6631c8216149cdbb0fab83eb2db SHA1 c1d0709c6febde513bf40af3c303ecca3e2ba501 SHA256 196ed4f742e41500d6d9db0f55e69dffbf502a682bd1601fa9e107d9d3f69b69
+DIST utm5-2.1.004.tar.bz2 6296254 RMD160 40d37ce8d1eaa1abd12a2015f302ddf1f099b1fb SHA1 402ae097af7856de01a27cca4a23b2e561a25dfd SHA256 e853ba43d9d38908ecfacf90d98e928cc30459e2617437302995eeab5d65b913
+DIST utm5-2.1.007.tar.bz2 7605323 RMD160 70dfb2aba1d839ade9c94300fe5a782a16a32558 SHA1 c32054b335996e13ade2ef4c2fb185878f97011d SHA256 c135177e1f7a34d2d7ba4646ec55200d33ddbd3e3bcc3db20d938dfeae24368e
+EBUILD utm5-2.1.004.ebuild 2562 RMD160 87d4466715ebd8d91deb0bc27d1cf36fe8b44efd SHA1 2baf3877d147cc47966362212d41bd8d74832cae SHA256 9a653cda892b3e0015db97d494df595a5b4ce32910d19ad8b9190fa0485f3142
+EBUILD utm5-2.1.007.ebuild 2613 RMD160 6c1b6ed30ad71b6a2d182321826229c98ee2cfbe SHA1 9c80b37a8cdef32451c29aecb5a51b6ecd4303ae SHA256 11ae7c0fc46675dc7d72b9116d9f0b7f542a2dcfb754be21d836abb9d8c9bf66
+MISC ChangeLog 926 RMD160 c6b03153558de72099e62f34397006d001c8ed14 SHA1 accd3b10376732cff3d679ab2f4e1741e745a67f SHA256 f534ab4df1e8e1384df05c16d4a024b0ebbd0464b24e96c5a811b7ae51fab672
+MISC metadata.xml 219 RMD160 ba14592eb1ec5f3754c794c3354ae6d4e4db1df7 SHA1 21736ab271e064bb64e9b13de2d8157f01b1ce83 SHA256 b317a4acf9c356c321b0675dcbd3e28bcf48244a3e52bcea2185bda5360c3a8a
diff --git a/net-misc/utm5/files/utm5_core b/net-misc/utm5/files/utm5_core
new file mode 100755
index 0000000..4fd4944
--- /dev/null
+++ b/net-misc/utm5/files/utm5_core
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+check_db_is_running() {
+ if ! `/etc/init.d/mysql status 2>/dev/null | grep "started" > /dev/null 2>&1 ` ; then
+ if ! `/etc/init.d/postgresql status 2>/dev/null | grep "started" > /dev/null 2>&1` ; then
+ ewarn "You have not started neither mysql nor postgresql!"
+ eerror "Please start anything."
+ return 1
+ fi
+ fi
+}
+
+depend() {
+ after mysql postgresql
+}
+
+start() {
+ check_db_is_running || return 1
+ ebegin "Starting utm5_core"
+ start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/safe_utm5_core.pid \
+ --background --exec /netup/utm5/bin/safe_utm5_core -- start
+ eend $?
+
+ einfo "Waiting for 20 seconds, while core can serve our requests."
+ echo -n " "
+ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+ sleep 1
+ echo -n "$i "
+ done
+ echo
+}
+
+stop() {
+ ebegin "Stopping safe_utm5_core"
+ start-stop-daemon --stop --quiet --signal 9 --pidfile /var/run/safe_utm5_core.pid
+ eend $?
+
+ ebegin "Stopping utm5_core"
+ killall -s USR1 utm5_core
+
+ # Now we need to check that the processes are really stoped.
+ for i in 1 2 3 4 5 ; do
+ sleep 2
+ my_status=`ps aux | grep -v "grep utm5_core" | grep -v "stop" | grep utm5_core >/dev/null 2>&1; echo $?`
+ if [ "$my_status" = "1" ] ;then
+ echo -n "All process dead..."
+ break;
+ fi
+ done
+ my_status=`ps aux | grep -v "grep utm5_core" | grep -v "stop" | grep utm5_core >/dev/null 2>&1; echo $?`
+ if [ $my_status = "0" ] ; then
+ echo -n "Wated for 10 sec and no result... Killing!"
+ killall -9 utm5_core
+ fi
+ eend 0
+}
diff --git a/net-misc/utm5/files/utm5_radius b/net-misc/utm5/files/utm5_radius
new file mode 100755
index 0000000..cbcca1b
--- /dev/null
+++ b/net-misc/utm5/files/utm5_radius
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+start() {
+ ebegin "Starting utm5_radius"
+ start-stop-daemon --start --quiet --background --exec /netup/utm5/bin/safe_utm5_radius -- start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping utm5_radius"
+ start-stop-daemon --start --quiet --exec /netup/utm5/bin/safe_utm5_radius -- stop
+ eend $?
+}
diff --git a/net-misc/utm5/files/utm5_rfw b/net-misc/utm5/files/utm5_rfw
new file mode 100755
index 0000000..0dd0457
--- /dev/null
+++ b/net-misc/utm5/files/utm5_rfw
@@ -0,0 +1,74 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+checkconfig() {
+ if [ ! -f /etc/conf.d/utm5_rfw.conf ] ; then
+ eerror "You will need an /etc/conf.d/utm5_rfw.conf."
+ return 1
+ fi
+
+ . /etc/conf.d/utm5_rfw.conf
+
+ # Checking for valid shell for supplied user.
+ SHELL=`grep ^$USERNAME: /etc/passwd | awk -F : '{print $7}'`
+ if [ -z "$SHELL" ] ; then
+ eerror "Supply user with valid shell in /etc/conf.d/utm5_rfw.conf."
+ return 1
+ fi
+
+ # This is durty and assumes that shell is in /bin directory. But in most cases this is true.
+ shell_exist=false
+ rm -f /tmp/tmp.shells ; grep "^/bin/" /etc/shells > /tmp/tmp.shells
+
+ while read shell
+ do
+ if [ "$shell" = "$SHELL" ] ; then
+ shell_exist=true
+ fi
+ done < /tmp/tmp.shells
+
+ if [ "$shell_exist" = "false" ] ; then
+ eerror "Supply user with a valid shell in /etc/conf.d/utm5_rfw.conf."
+ return 1
+ fi
+
+ if [ "$shell_exist" = "true" ] ; then
+ return 0
+ fi
+
+ eerror Init script error? Please submit a report at support@netup.ru.
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting utm5_rfw"
+ . /etc/conf.d/utm5_rfw.conf
+
+ if [ -z "$GROUPNAME" ] ; then
+ GROUPID=`grep ^$USERNAME: /etc/passwd | awk -F : '{print $4}'`
+ GROUPNAME=`grep :$GROUPID: /etc/group | awk -F : '{print $1}'`
+ fi
+
+ LOG_FILENAME=`grep "log_file_main" /etc/utm5/rfw5.cfg | grep "=" | awk -F= '{print $2}'`
+ if [ ! -f $LOG_FILENAME ] ; then
+ mkdir -p `dirname $LOG_FILENAME`
+ touch $LOG_FILENAME
+ chown $USERNAME:$GROUPNAME $LOG_FILENAME
+ fi
+
+ # Checking the possibility to write in log file.
+ if ! `/bin/su $USERNAME -c "/bin/echo \">>>\" \`date\` Starting utm5_rfw. >> $LOG_FILENAME"`
+ then
+ eerror "Can not write into $LOG_FILENAME. Please check permitions."
+ fi
+ /bin/su $USERNAME -c "/bin/nohup /netup/utm5/bin/utm5_rfw $ARGS /etc/utm5/rfw5.cfg >> $LOG_FILENAME 2>&1 &"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping utm5_rfw"
+ killall -s 9 utm5_rfw
+ eend $?
+}
diff --git a/net-misc/utm5/files/utm5_rfw.conf b/net-misc/utm5/files/utm5_rfw.conf
new file mode 100644
index 0000000..69b9709
--- /dev/null
+++ b/net-misc/utm5/files/utm5_rfw.conf
@@ -0,0 +1,13 @@
+# This is configuration file for /etc/init.d/utm5_rfw.
+
+# Username we should start service from. If you do not know what to do just issue the commands:
+# groupadd rfw
+# useradd -g rfw rfw
+USERNAME="rfw"
+# Name of group, log file will be owned by. If not specified, will be primary group for rfw user.
+# GROUPNAME="users"
+
+# You may add here additional parameters.
+# For example -f will issue rules for Connected users with the start of utm5_rfw.
+ARGS="-f"
+
diff --git a/net-misc/utm5/metadata.xml b/net-misc/utm5/metadata.xml
new file mode 100644
index 0000000..31703fd
--- /dev/null
+++ b/net-misc/utm5/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+ <email>pva@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/net-misc/utm5/utm5-2.1.004.ebuild b/net-misc/utm5/utm5-2.1.004.ebuild
new file mode 100644
index 0000000..0fbba9f
--- /dev/null
+++ b/net-misc/utm5/utm5-2.1.004.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+DESCRIPTION="NetUP UTM - universal billing system for Internet Service Providers."
+HOMEPAGE="www.netup.ru"
+SRC_URI="${P}.tar.bz2"
+
+LICENSE="NETUP"
+SLOT="0"
+KEYWORDS="x86 amd64"
+IUSE=""
+
+RESTRICT="fetch binchecks"
+
+RDEPEND="
+ x86? ( dev-libs/openssl
+ sys-libs/zlib
+ dev-libs/libxslt )
+ amd64? ( app-emulation/emul-linux-x86-baselibs )
+ app-admin/sudo
+ dev-perl/DBD-mysql
+ || ( dev-db/mysql
+ dev-db/postgresql )"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ elog "Please download ${A} from:"
+ elog "http://www.netup.ru/"
+ elog "and move it to ${DISTDIR}"
+}
+
+pkg_setup() {
+ local stop_process=""
+ for process in utm5_radius utm5_rfw utm5_core; do
+ if $(pgrep ${process} >/dev/null 2>&1); then
+ stop_process+="${process} "
+ fi
+ done
+
+ if [[ -n ${stop_process} ]]; then
+ ewarn "You did not stop ${process}."
+ ewarn "Please stop all process with ${process} in"
+ ewarn "their names and then try again."
+ die "Processes are not stoped."
+ fi
+}
+
+src_install() {
+ for conf in {utm5,radius5,rfw5,web5}.cfg; do
+ insinto /etc/utm5/
+ doins netup/utm5/${conf} || die
+ dosym /etc/utm5/${conf} /netup/utm5/${conf}
+ rm netup/utm5/${conf}
+ done
+
+ dodir /netup
+ cp -a netup "${D}" || die
+ cp -a var "${D}" || die
+
+ doinitd "${FILESDIR}/utm5_core" "${FILESDIR}/utm5_radius" "${FILESDIR}/utm5_rfw" || die
+ doconfd "${FILESDIR}/utm5_rfw.conf" || die
+
+ keepdir /netup/utm5/backup
+ keepdir /netup/utm5/db
+ keepdir /netup/utm5/log
+}
+
+pkg_preinst() {
+ if [[ ! -x /netup/utm5/bin/utm5_core ]] ; then
+ elog "If this is your first instalation of utm5 please run:"
+ elog "mysqladmin create UTM5"
+ elog "mysql UTM5 < /netup/utm5/UTM5_MYSQL.sql"
+ elog "mysql UTM5 < your_reg_file.sql"
+ elog "to initialise mysql database. Or"
+ elog "createdb -U postgres UTM5"
+ elog "psql UTM5 < /netup/utm5/UTM5_MYSQL.sql"
+ elog "psql UTM5 < your_reg_file.sql"
+ elog "to initialise postgresql database."
+ else
+ elog "Now, please, update your database with command"
+ elog "mysql -f UTM5 < /netup/utm5/UTM5_MYSQL_update.sql"
+ elog "if you are using mysql database or"
+ elog "psql -f /netup/utm5/UTM5_PG_update.sql UTM5"
+ elog "if you are using postgresql."
+ elog ""
+ elog "Please note. You need to use updated UTM5_Admin.jar also."
+ fi
+}
+
+pkg_postinst() {
+ echo
+ elog "To start utm5_core automaticaly during booting you need to run:"
+ elog "rc-update add utm5_core default"
+ echo
+ ewarn "Note: Configuration files are in /etc/utm5."
+ echo
+ elog "Thank you for choosing utm5."
+}
diff --git a/net-misc/utm5/utm5-2.1.007.ebuild b/net-misc/utm5/utm5-2.1.007.ebuild
new file mode 100644
index 0000000..4091be2
--- /dev/null
+++ b/net-misc/utm5/utm5-2.1.007.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+DESCRIPTION="NetUP UTM - universal billing system for Internet Service Providers."
+HOMEPAGE="www.netup.ru"
+SRC_URI="${P}.tar.bz2"
+
+LICENSE="NETUP"
+SLOT="0"
+KEYWORDS="x86 amd64"
+IUSE=""
+
+RESTRICT="fetch binchecks"
+
+RDEPEND="
+ x86? ( dev-libs/openssl
+ sys-libs/zlib
+ dev-libs/libxslt )
+ amd64? ( app-emulation/emul-linux-x86-baselibs )
+ app-admin/sudo
+ dev-perl/DBD-mysql
+ || ( dev-db/mysql
+ dev-db/postgresql )"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ elog "Please download ${A} from:"
+ elog "http://www.netup.ru/"
+ elog "and move it to ${DISTDIR}"
+}
+
+pkg_setup() {
+ local stop_process=""
+ for process in utm5_radius utm5_rfw utm5_core; do
+ if $(pgrep ${process} >/dev/null 2>&1); then
+ stop_process+="${process} "
+ fi
+ done
+
+ if [[ -n ${stop_process} ]]; then
+ ewarn "You did not stop ${process}."
+ ewarn "Please stop all process with ${process} in"
+ ewarn "their names and then try again."
+ die "Processes are not stoped."
+ fi
+}
+
+src_install() {
+ for conf in {utm5,radius5,rfw5,web5}.cfg; do
+ insinto /etc/utm5/
+ doins netup/utm5/${conf} || die
+ dosym /etc/utm5/${conf} /netup/utm5/${conf}
+ rm netup/utm5/${conf}
+ done
+
+ dodir /netup
+ cp -a netup "${D}" || die
+
+ doinitd "${FILESDIR}/utm5_core" "${FILESDIR}/utm5_radius" "${FILESDIR}/utm5_rfw" || die
+ doconfd "${FILESDIR}/utm5_rfw.conf" || die
+
+ dodir /var/www/netup
+ cp -a usr/local/apache/ "${D}"/var/www/netup || die
+
+ keepdir /netup/utm5/backup
+ keepdir /netup/utm5/db
+ keepdir /netup/utm5/log
+}
+
+pkg_preinst() {
+ if [[ ! -x /netup/utm5/bin/utm5_core ]] ; then
+ elog "If this is your first instalation of utm5 please run:"
+ elog "mysqladmin create UTM5"
+ elog "mysql UTM5 < /netup/utm5/UTM5_MYSQL.sql"
+ elog "mysql UTM5 < your_reg_file.sql"
+ elog "to initialise mysql database. Or"
+ elog "createdb -U postgres UTM5"
+ elog "psql UTM5 < /netup/utm5/UTM5_MYSQL.sql"
+ elog "psql UTM5 < your_reg_file.sql"
+ elog "to initialise postgresql database."
+ else
+ elog "Now, please, update your database with command"
+ elog "mysql -f UTM5 < /netup/utm5/UTM5_MYSQL_update.sql"
+ elog "if you are using mysql database or"
+ elog "psql -f /netup/utm5/UTM5_PG_update.sql UTM5"
+ elog "if you are using postgresql."
+ elog ""
+ elog "Please note. You need to use updated UTM5_Admin.jar also."
+ fi
+}
+
+pkg_postinst() {
+ echo
+ elog "To start utm5_core automaticaly during booting you need to run:"
+ elog "rc-update add utm5_core default"
+ echo
+ ewarn "Note: Configuration files are in /etc/utm5."
+ echo
+ elog "Thank you for choosing utm5."
+}