aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/noc
diff options
context:
space:
mode:
authorbeech <beech@FreeBSD.org>2011-05-12 01:15:54 +0800
committerbeech <beech@FreeBSD.org>2011-05-12 01:15:54 +0800
commit714830b9a7d90104dfb52ae7228a490a7f8f04e6 (patch)
tree70478b57b6296637304c944e92b985effec48bce /net-mgmt/noc
parent406f50f473e72e711197d03fc0e49319e4461ead (diff)
downloadfreebsd-ports-gnome-714830b9a7d90104dfb52ae7228a490a7f8f04e6.tar.gz
freebsd-ports-gnome-714830b9a7d90104dfb52ae7228a490a7f8f04e6.tar.zst
freebsd-ports-gnome-714830b9a7d90104dfb52ae7228a490a7f8f04e6.zip
-Update to 0.6.4
-Changes in port: -Change depends of django to django-1.3.x version only -Add options for make 'noc' with GMPY and PEP8 modules -Remove creating user anf group from pkg-install script and use bsd.port.mk mechanism. -Autogenerate PLIST file from MANIFEST file in distribution. PR: ports/156809 Submitted by: Stanislav A Svirid <count@211.ru> (maintainer) Approved by: itetcu (mentor)(implicit)
Diffstat (limited to 'net-mgmt/noc')
-rw-r--r--net-mgmt/noc/Makefile74
-rw-r--r--net-mgmt/noc/distinfo4
-rw-r--r--net-mgmt/noc/files/extra-patch-0.6.4.rst12
-rw-r--r--net-mgmt/noc/files/extra-patch-sa_sae.py21
-rw-r--r--net-mgmt/noc/files/patch-main_management_commands_sync-doc.py29
-rw-r--r--net-mgmt/noc/files/patch-scripts_post-install2
-rw-r--r--net-mgmt/noc/files/patch-scripts_sync-contrib26
-rw-r--r--net-mgmt/noc/files/pkg-install.in62
-rw-r--r--net-mgmt/noc/files/pkg-message.in6
9 files changed, 111 insertions, 125 deletions
diff --git a/net-mgmt/noc/Makefile b/net-mgmt/noc/Makefile
index be62515f6b31..c7fd0cbc0cbb 100644
--- a/net-mgmt/noc/Makefile
+++ b/net-mgmt/noc/Makefile
@@ -6,19 +6,21 @@
#
PORTNAME= noc
-PORTVERSION= 0.6.2
+PORTVERSION= 0.6.4
CATEGORIES= net-mgmt python
-MASTER_SITES= http://redmine.nocproject.org/attachments/download/104/
-DISTNAME= noc-${PORTVERSION}
+MASTER_SITES= http://redmine.nocproject.org/attachments/download/137/
MAINTAINER= count@211.ru
COMMENT= Operation Support System (OSS) for the Telco, SP and Enterprise NOC
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-sa_sae.py
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-0.6.4.rst
+
LIB_DEPENDS= smi.2:${PORTSDIR}/net-mgmt/libsmi
BUILD_DEPENDS= easy_install:${PORTSDIR}/devel/py-setuptools \
${PYTHON_PKGNAMEPREFIX}sphinx>0:${PORTSDIR}/textproc/py-sphinx \
${PYTHON_PKGNAMEPREFIX}flup>0:${PORTSDIR}/www/py-flup
-RUN_DEPENDS= django-admin.py:${PORTSDIR}/www/py-django \
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django>=1.3<1.4:${PORTSDIR}/www/py-django \
${PYTHON_PKGNAMEPREFIX}django-tagging>0:${PORTSDIR}/www/py-django-tagging \
${PYTHON_PKGNAMEPREFIX}south>0:${PORTSDIR}/databases/py-south \
${PYTHON_PKGNAMEPREFIX}coverage>0:${PORTSDIR}/devel/py-coverage \
@@ -28,27 +30,37 @@ RUN_DEPENDS= django-admin.py:${PORTSDIR}/www/py-django \
${PYTHON_PKGNAMEPREFIX}creole>0:${PORTSDIR}/textproc/py-creole \
${PYTHON_PKGNAMEPREFIX}webob>0:${PORTSDIR}/www/py-webob \
${PYTHON_PKGNAMEPREFIX}WebTest>0:${PORTSDIR}/www/py-WebTest \
- ${PYTHON_PKGNAMEPREFIX}netifaces>0:${PORTSDIR}/net/py-netifaces
+ ${PYTHON_PKGNAMEPREFIX}netifaces>0:${PORTSDIR}/net/py-netifaces \
+ ${PYTHON_SITELIBDIR}/Crypto/__init__.py:${PORTSDIR}/security/py-pycrypto
+
+OPTIONS= GMPY "Enable use GMP library in SSH" on \
+ PEP8 "Intsall pep8 for checking source" off
USE_PYTHON= 2.6+
USE_PYDISTUTILS= yes
PYDISTUTILS_EGGINFODIR= ${NOCDIR}
-CONFLICTS= noc-devel-[0-9].*
-
LICENSE= BSD
-NOCUSER?= noc
-NOCGROUP?= noc
+NOCUSER= noc
+NOCGROUP= noc
NOCDIR?= ${PREFIX}/noc
NOCDBDIR?= /var/db/noc
LOCALSTATE_DIR?=/var/run/noc
-NOCUID= 182
-NOCGID= ${NOCUID}
+USERS= ${NOCUSER}
+GROUPS= ${NOCGROUP}
.include <bsd.port.pre.mk>
+.if defined(WITH_GMPY)
+RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/gmpy.so:${PORTSDIR}/math/py-gmpy
+.endif
+
+.if defined(WITH_PEP8)
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pep8>0:${PORTSDIR}/devel/pep8
+.endif
+
PLIST_SUB= NOCDIR=${NOCDIR} \
NOCDBDIR=${NOCDBDIR} \
NOCUSER=${NOCUSER} \
@@ -58,6 +70,13 @@ PLIST_SUB= NOCDIR=${NOCDIR} \
LOCALSTATE_DIR=${LOCALSTATE_DIR} \
PYTHONBASE=${PYTHONBASE}
+PLIST_REINPLACE+= noc_static noc_etc noc
+PLIST_REINPLACE_NOC= s@dirrm noc$$@dirrmtry noc@
+PLIST_REINPLACE_NOC_STATIC= s@dirrm noc/static@dirrmtry noc/static@
+PLIST_REINPLACE_NOC_ETC= s@dirrm noc/etc@dirrmtry noc/etc@
+
+PLIST= ${WRKDIR}/.PLIST.noc
+
SUB_FILES= pkg-install \
pkg-deinstall \
pkg-message
@@ -73,8 +92,9 @@ NOC_CONF_FILES= etc/noc-activator.defaults \
etc/noc-fcgi.defaults \
etc/noc-launcher.defaults \
etc/noc-notifier.defaults \
- etc/noc-sae.defaults \
etc/noc-probe.defaults \
+ etc/noc-sae.defaults \
+ etc/noc-scheduler.defaults \
etc/noc.defaults
post-extract:
@@ -90,14 +110,40 @@ post-patch:
${REINPLACE_CMD} -e "s@^\(repo *=\).*@\1 ${NOCDBDIR}/repo@" -e "s@^\(backup_dir *=\).*@\1 ${NOCDBDIR}/backup@" etc/noc.defaults; \
${REINPLACE_CMD} -e "s@^\(PREFIX=\"\).*@\1${NOCDIR}\"@" setup.py; \
_sed_script=`${MKTEMP} tmp.XXXXXX`; \
- for cmd in telnet ssh rsync pg_dump tar gzip smidump smilint fping dig gpg; do \
- ${ECHO} "s@^\\($${cmd} *\\)=.*\$$@\\1 = "`${WHICH} $${cmd}`'@' >> $${_sed_script} ; \
+ for cmd in ssh rsync pg_dump tar gzip smidump smilint fping dig gpg; do \
+ ${ECHO_CMD} "s@^\\($${cmd} *\\)=.*\$$@\\1 = "`${WHICH} $${cmd}`'@' >> $${_sed_script} ; \
done; \
${REINPLACE_CMD} -f $${_sed_script} ${NOC_CONF_FILES}; \
${RM} $${_sed_script}; )
pre-install:
@${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL
+ @>${PLIST}
+.for f in ${NOC_CONF_FILES}
+ @${ECHO_CMD} "@unexec if cmp -s %D/noc/${f} %D/noc/${f:R}.conf; then rm -f %D/noc/${f:R}.conf; fi" >> ${PLIST}
+.endfor
+ @(${CAT} ${WRKSRC}/MANIFEST | ${SED} -e '/^.hg/d; s@^@noc\/@;' \
+ -e '/.py$$/ {p; s/.py$$/.pyc/p; s/.pyc$$/.pyo/;} ' | \
+ ${EGREP} -v 'noc/(scripts/|setup|share/docs/).*\.py[co]' | \
+ ${SORT} >> ${PLIST} )
+ @${ECHO_CMD} "@dirrmtry ${NOCDIR:S%^${PREFIX}/%%}/local" >> ${PLIST}
+ @${ECHO_CMD} "@dirrmtry ${NOCDIR:S%^${PREFIX}/%%}/static/doc" >> ${PLIST}
+ @(_sed_script=`${MKTEMP} ${WRKDIR}/tmp.XXXXXX`; \
+ ${ECHO_CMD} "/^.hg/d" >> $${_sed_script} ;\
+ ${ECHO_CMD} "s@^@noc\/@" >> $${_sed_script} ;\
+ ${ECHO_CMD} ":u" >> $${_sed_script} ;\
+ ${ECHO_CMD} '/\// { s/^[^@]/@dirrm &/; s@/[^/]*$$@@; p; }' >> $${_sed_script} ;\
+ ${ECHO_CMD} "tu" >> $${_sed_script} ;\
+ ${ECHO_CMD} "d" >> $${_sed_script} ;\
+ ${CAT} ${WRKSRC}/MANIFEST | ${SED} -f $${_sed_script} | ${SORT} -r -u >> ${PLIST} ;\
+ ${RM} $${_sed_script}; \
+ )
+ @${ECHO_CMD} "@cwd ${NOCDBDIR}" >> ${PLIST}
+ @${ECHO_CMD} "@dirrmtry repo" >> ${PLIST}
+ @${ECHO_CMD} "@dirrmtry backup" >> ${PLIST}
+ @${ECHO_CMD} "@unexec rmdir ${NOCDBDIR} 2>/dev/null || true" >> ${PLIST}
+ @${ECHO_CMD} "@cwd /" >> ${PLIST}
+ @${ECHO_CMD} "@dirrmtry ${LOCALSTATE_DIR}" >> ${PLIST}
post-install:
@${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL
diff --git a/net-mgmt/noc/distinfo b/net-mgmt/noc/distinfo
index 4eb415249472..7ef436583e5a 100644
--- a/net-mgmt/noc/distinfo
+++ b/net-mgmt/noc/distinfo
@@ -1,2 +1,2 @@
-SHA256 (noc-0.6.2.tar.gz) = 700cff7cec20f572484033afb458ebfd6885f5adb1e940ddd7046135424f8027
-SIZE (noc-0.6.2.tar.gz) = 12981116
+SHA256 (noc-0.6.4.tar.gz) = 54f14b48bc478ad15c3a2c0d9d1256a1f21661adbc6ded0a3b8689fdfdb7ba84
+SIZE (noc-0.6.4.tar.gz) = 14993060
diff --git a/net-mgmt/noc/files/extra-patch-0.6.4.rst b/net-mgmt/noc/files/extra-patch-0.6.4.rst
new file mode 100644
index 000000000000..b8dd32204dbb
--- /dev/null
+++ b/net-mgmt/noc/files/extra-patch-0.6.4.rst
@@ -0,0 +1,12 @@
+diff -r 6a42abeb3317 -r 88d6b37d594a share/docs/en/nocbook/releasenotes/0.6.4.rst
+--- share/docs/en/nocbook/releasenotes/0.6.4.rst.orig
++++ share/docs/en/nocbook/releasenotes/0.6.4.rst
+@@ -142,7 +142,7 @@
+ Event filters are refreshed on object's address changed
+ -------------------------------------------------------
+ Event filters are reloaded immediately when managed object's addresses
+-are changed, reducing amount of _Invalid event filter_ events
++are changed, reducing amount of Invalid event filter events
+
+ Bugfixes
+ --------
diff --git a/net-mgmt/noc/files/extra-patch-sa_sae.py b/net-mgmt/noc/files/extra-patch-sa_sae.py
new file mode 100644
index 000000000000..b01562778a3d
--- /dev/null
+++ b/net-mgmt/noc/files/extra-patch-sa_sae.py
@@ -0,0 +1,21 @@
+diff -r 8b9fbf3bcff6 -r 302bc22ed16c sa/sae.py
+--- sa/sae.py.orig
++++ sa/sae.py
+@@ -548,7 +548,8 @@
+ Launch a script
+ """
+ def script_callback(transaction, response=None, error=None):
+- stream.current_scripts -= 1
++ if stream is not None:
++ stream.current_scripts -= 1
+ if object.profile_name != "NOC.SAE":
+ try:
+ self.object_scripts[object.id] -= 1
+@@ -564,6 +565,7 @@
+ callback(result=result)
+
+ logging.info("script %s(%s)" % (script_name, object))
++ stream = None
+ if object.profile_name != "NOC.SAE":
+ # Validate activator is present
+ try:
diff --git a/net-mgmt/noc/files/patch-main_management_commands_sync-doc.py b/net-mgmt/noc/files/patch-main_management_commands_sync-doc.py
index 210c99edea29..e69de29bb2d1 100644
--- a/net-mgmt/noc/files/patch-main_management_commands_sync-doc.py
+++ b/net-mgmt/noc/files/patch-main_management_commands_sync-doc.py
@@ -1,29 +0,0 @@
---- main/management/commands/sync-doc.py.orig 2011-01-31 16:14:43.000000000 +0600
-+++ main/management/commands/sync-doc.py 2011-01-31 16:17:57.000000000 +0600
-@@ -43,10 +43,6 @@ class Command(BaseCommand):
- return rewrite_when_differ(db_path,out.getvalue())
-
- def handle(self, *args, **options):
-- # Prepare paths
-- sphinx_build=os.path.abspath(os.path.join("contrib","bin","sphinx-build"))
-- if not os.path.exists(sphinx_build):
-- raise CommandError("%s not found. Please rebuild contrib/"%sphinx_build)
- #
- se_db_updated=self.update_se_db()
- # Prepare options
-@@ -56,6 +52,8 @@ class Command(BaseCommand):
- # Prepare environment
- env=os.environ.copy()
- env["PYTHONPATH"]=":".join(sys.path)
-+ # add path from contrib
-+ env["PATH"]=os.path.abspath(os.path.join("contrib","bin"))+":"+env["PATH"]
- # Rebuild all documentation
- for conf in glob.glob("share/docs/*/*/conf.py"):
- d,f=os.path.split(conf)
-@@ -69,5 +67,5 @@ class Command(BaseCommand):
- os.makedirs(p)
- except OSError:
- raise CommandError("Unable to create directory: %s"%p)
-- cmd=[sphinx_build]+opts+["-b","html","-d",doctrees,"-D","latex_paper_size=a4",".",html]
-+ cmd=["sphinx-build"]+opts+["-b","html","-d",doctrees,"-D","latex_paper_size=a4",".",html]
- subprocess.call(cmd,cwd=d,env=env)
diff --git a/net-mgmt/noc/files/patch-scripts_post-install b/net-mgmt/noc/files/patch-scripts_post-install
index 793e4169596f..8c8f0576686e 100644
--- a/net-mgmt/noc/files/patch-scripts_post-install
+++ b/net-mgmt/noc/files/patch-scripts_post-install
@@ -12,7 +12,7 @@
@@ -15,7 +15,7 @@ cd $PREFIX
sed_script=`mktemp tmp.XXXXXX`
rm $sed_script
- for cmd in telnet ssh rsync pg_dump tar gzip smidump smilint fping dig gpg; do
+ for cmd in ssh rsync pg_dump tar gzip smidump smilint fping dig gpg; do
- echo 's@^\\($cmd *\\)=.*\$@\\1 = '`which $cmd`'@' >> $sed_script
+ echo "s@^\\($cmd *\\)=.*\$@\\1 = "`which $cmd`'@' >> $sed_script
done
diff --git a/net-mgmt/noc/files/patch-scripts_sync-contrib b/net-mgmt/noc/files/patch-scripts_sync-contrib
index c34ec9edacfc..1197c7ebd939 100644
--- a/net-mgmt/noc/files/patch-scripts_sync-contrib
+++ b/net-mgmt/noc/files/patch-scripts_sync-contrib
@@ -1,13 +1,15 @@
---- scripts/sync-contrib.orig 2011-01-31 16:18:59.000000000 +0600
-+++ scripts/sync-contrib 2011-01-31 16:23:13.000000000 +0600
-@@ -107,6 +107,10 @@ class Installer(object):
- return self.install("protobuf")
-
- if __name__=="__main__":
-+ # Always return 0 on FreeBSD
-+ if os.uname()[0] == 'FreeBSD':
-+ sys.exit(0);
+--- scripts/sync-contrib.orig 2011-03-30 12:36:05.000000000 +0700
++++ scripts/sync-contrib 2011-04-06 11:38:22.000000000 +0700
+@@ -45,6 +45,12 @@ class Installer(object):
+ ## Syncronize contrib apps
+ ##
+ def sync(self):
++ # Always return 0 on FreeBSD
++ if os.uname()[0] == 'FreeBSD':
++ if not self.check_only:
++ print "FreeBSD: Using apps from ports"
++ return True
+
- check_only=False
- optlist,optargs=getopt.getopt(sys.argv[1:],"c")
- for k,v in optlist:
+ if not self.check_only:
+ print "Syncronizing contrib apps"
+ sv=[]
diff --git a/net-mgmt/noc/files/pkg-install.in b/net-mgmt/noc/files/pkg-install.in
index 97a11b95b411..f6861235d59a 100644
--- a/net-mgmt/noc/files/pkg-install.in
+++ b/net-mgmt/noc/files/pkg-install.in
@@ -11,69 +11,7 @@ NOCUID=%%NOCUID%%
NOCGID=%%NOCGID%%
LOCALSTATE_DIR=%%LOCALSTATE_DIR%%
-ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- if [ "x${answer}" = "x" ]; then
- answer=${default}
- fi
- echo ${answer}
-}
-
-yesno() {
- local default question answer
-
- question=$1
- default=$2
- while :; do
- answer=$(ask "${question}" "${default}")
- case "${answer}" in
- [Yy][Ee][Ss]|[Yy])
- return 0
- ;;
- [Nn][Oo]|[Nn])
- return 1
- ;;
- esac
- echo "Please answer yes or no."
- done
-}
-
if [ "$2" = "PRE-INSTALL" ]; then
- if /usr/sbin/pw group show "${NOCGROUP}" 2>&1 >/dev/null; then
- echo "You already have a \"${NOCGROUP}\" group, so I will use it."
- else
- echo "You need a \"${NOCGROUP}\" group."
- if yesno "Would you like me to create it" "YES"; then
- /usr/sbin/pw groupadd "${NOCGROUP}" -g "${NOCGID}" -h - || \
- /usr/sbin/pw groupadd "${NOCGROUP}" -h - || exit
- echo "Done."
- else
- echo "Please create the \"${NOCGROUP}\" group manually and try again."
- exit 1
- fi
- fi
-
- if /usr/sbin/pw user show "${NOCUSER}" 2>&1 >/dev/null; then
- echo "You already have a \"${NOCUSER}\" user, so I will use it."
- else
- echo "You need a \"${NOCUSER}\" user."
- if yesno "Would you like me to create it" "YES"; then
- /usr/sbin/pw useradd "${NOCUSER}" -u "${NOCUID}" -g "${NOCGROUP}" -h - -d "${NOCDIR}" \
- -c "NOC pseudo-user" || \
- /usr/sbin/pw useradd "${NOCUSER}" -g "${NOCGROUP}" -h - -d "${NOCDIR}" \
- -c "NOC pseudo-user" || exit
- else
- echo "Please create the \"${NOCUSER}\" user manually and try again."
- exit 1
- fi
- fi
-
if ! [ -x ${NOCDIR} ] ; then
mkdir -p ${NOCDIR};
chown ${NOCUSER}:${NOCGROUP} ${NOCDIR}
diff --git a/net-mgmt/noc/files/pkg-message.in b/net-mgmt/noc/files/pkg-message.in
index 8da17e05daaf..db0bee0655f7 100644
--- a/net-mgmt/noc/files/pkg-message.in
+++ b/net-mgmt/noc/files/pkg-message.in
@@ -4,16 +4,12 @@
noc_enable="YES"
- Configuration defaults are available in %%NOCDIR%%/etc as *.defaults
- files. Copy them to *.cfg files where required and
- edit to suit your needs.
-
Don't forget create DB in postgresql (see Documentation for NOC).
and run createlang after createdb:
createlang plpgsql noc
After create db (or if you updating from previous version) please
- don't forget run following commnds under user '%%NOCUSER%%':
+ run following commnds under user '%%NOCUSER%%':
cd %%NOCDIR%%
./scripts/post-update