From 857b72166f7c55d8b68ced2639317e4ae383650a Mon Sep 17 00:00:00 2001 From: sthen Date: Tue, 8 Jun 2010 00:03:55 +0000 Subject: [PATCH] import ports/net/mirmon Mirmon helps administrators in keeping an eye on the mirror sites. In a concise graphic format, mirmon shows each site's status history of the last two weeks. It is easy to spot stale or dead mirrors. --- net/mirmon/Makefile | 47 ++++++ net/mirmon/distinfo | 5 + net/mirmon/files/mirmon.conf | 17 +++ net/mirmon/patches/patch-mirmon_pl | 16 ++ net/mirmon/pkg/DESCR | 3 + net/mirmon/pkg/MESSAGE | 8 + net/mirmon/pkg/PLIST | 233 +++++++++++++++++++++++++++++ 7 files changed, 329 insertions(+) create mode 100644 net/mirmon/Makefile create mode 100644 net/mirmon/distinfo create mode 100644 net/mirmon/files/mirmon.conf create mode 100644 net/mirmon/patches/patch-mirmon_pl create mode 100644 net/mirmon/pkg/DESCR create mode 100644 net/mirmon/pkg/MESSAGE create mode 100644 net/mirmon/pkg/PLIST diff --git a/net/mirmon/Makefile b/net/mirmon/Makefile new file mode 100644 index 00000000000..efef0ed6b47 --- /dev/null +++ b/net/mirmon/Makefile @@ -0,0 +1,47 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2010/06/08 00:03:55 sthen Exp $ + +COMMENT= monitors the status of mirrors + +DISTNAME= mirmon-2.3 + +CATEGORIES= net +HOMEPAGE= http://people.cs.uu.nl/henkp/mirmon/ + +MAINTAINER= Stuart Henderson + +# free license, see head of ${WRKSRC}/Mirmon.pm +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= ${HOMEPAGE} + +MODULES= perl +ICONDIR= ${PREFIX}/share/examples/mirmon/icons + +RUN_DEPENDS= ::net/rsync ::net/wget +NO_REGRESS= Yes +PKG_ARCH= * + +do-build: + perl -pi -e 's,/usr/bin/(rsync|wget),${LOCALBASE}/bin/\1,' \ + ${WRKSRC}/[Mm]irmon* ${WRKSRC}/probe + perl -pi -e 's,/etc/mirmon.conf,${SYSCONFDIR}/mirmon.conf,' \ + ${WRKSRC}/[Mm]irmon* + ${SUBST_CMD} -c ${FILESDIR}/mirmon.conf ${WRKBUILD}/mirmon.conf + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/mirmon/ \ + ${PREFIX}/share/examples/mirmon/ ${ICONDIR}/icons/ + ${INSTALL_SCRIPT} ${WRKSRC}/mirmon.pl ${PREFIX}/bin/mirmon + ${INSTALL_SCRIPT} ${WRKSRC}/Mirmon.pm ${PREFIX}/${P5SITE}/ + ${INSTALL_SCRIPT} ${WRKSRC}/probe ${PREFIX}/bin/mirmon-probe + ${INSTALL_MAN} ${WRKSRC}/mirmon.1 ${WRKSRC}/mirmon.pm.1 \ + ${PREFIX}/man/man1 + ${INSTALL_DATA} ${WRKSRC}/RELEASE-NOTES ${PREFIX}/share/doc/mirmon/ + ${INSTALL_DATA} ${WRKSRC}/countries.list ${WRKSRC}/mirmon.conf \ + ${PREFIX}/share/examples/mirmon/ + ${INSTALL_DATA} ${WRKSRC}/icons/* ${ICONDIR}/ + +.include diff --git a/net/mirmon/distinfo b/net/mirmon/distinfo new file mode 100644 index 00000000000..e1a0b4db8d7 --- /dev/null +++ b/net/mirmon/distinfo @@ -0,0 +1,5 @@ +MD5 (mirmon-2.3.tar.gz) = ZyFjz8mEvh8AEz4rxToqsw== +RMD160 (mirmon-2.3.tar.gz) = 06s2pMWGHBJl4rzC+6XlnPYcFfE= +SHA1 (mirmon-2.3.tar.gz) = GAO1WsahmLwh8EEhv+YLYncng1Y= +SHA256 (mirmon-2.3.tar.gz) = 73N06LP3X1H4hxC/IGWFZge+ygFf5frA0MQR4pIHTxg= +SIZE (mirmon-2.3.tar.gz) = 67859 diff --git a/net/mirmon/files/mirmon.conf b/net/mirmon/files/mirmon.conf new file mode 100644 index 00000000000..8389b56d8c8 --- /dev/null +++ b/net/mirmon/files/mirmon.conf @@ -0,0 +1,17 @@ +# Sample mirmon configuration. See mirmon(1). + +project_name SomeProject +project_url http://www.example.org/ +web_page /var/www/htdocs/mirmon/index.html +icons icons/ + +# Create this yourself, simplest format: +# cc http://path/to/mirror +# Where cc=country code +mirror_list /etc/mirmon.list + +probe ${TRUEPREFIX}/bin/mirmon-probe -t %TIMEOUT% %URL%.stamp +# probe ${LOCALBASE}/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME + +state /var/db/mirmon/mirmon.db +countries /var/db/mirmon/countries.list diff --git a/net/mirmon/patches/patch-mirmon_pl b/net/mirmon/patches/patch-mirmon_pl new file mode 100644 index 00000000000..50a99045620 --- /dev/null +++ b/net/mirmon/patches/patch-mirmon_pl @@ -0,0 +1,16 @@ +$OpenBSD: patch-mirmon_pl,v 1.1.1.1 2010/06/08 00:03:55 sthen Exp $ +--- mirmon.pl.orig Wed Mar 17 09:35:27 2010 ++++ mirmon.pl Tue Jun 8 01:02:50 2010 +@@ -59,6 +59,12 @@ Mirmon::verbose ( $opt{v} ) ; + Mirmon::debug ( $opt{d} ) ; + Mirmon::quiet ( $opt{q} ) ; + ++use POSIX qw(setuid setgid getpwnam); ++print "Dropping privileges to _mirmon ...\n" if Mirmon::debug; ++my (undef, undef, $uid, $gid) = POSIX::getpwnam("_mirmon"); ++POSIX::setgid($uid) or die "setgid() to $gid failed, abort\n"; ++POSIX::setuid($uid) or die "setuid() to $uid failed, abort\n"; ++ + my $M = Mirmon -> new ( $opt{c} ) ; + $M -> conf -> timeout ( $opt{t} ) if $opt{t} ; + if ( $get ) { $M -> get_dates ( $get ) ; $M -> put_state ; } diff --git a/net/mirmon/pkg/DESCR b/net/mirmon/pkg/DESCR new file mode 100644 index 00000000000..d434b77486c --- /dev/null +++ b/net/mirmon/pkg/DESCR @@ -0,0 +1,3 @@ +Mirmon helps administrators in keeping an eye on the mirror sites. +In a concise graphic format, mirmon shows each site's status history +of the last two weeks. It is easy to spot stale or dead mirrors. diff --git a/net/mirmon/pkg/MESSAGE b/net/mirmon/pkg/MESSAGE new file mode 100644 index 00000000000..f046127cdd5 --- /dev/null +++ b/net/mirmon/pkg/MESSAGE @@ -0,0 +1,8 @@ +To use this package, refer to mirmon(1), adapt ${SYSCONFDIR}/mirmon.conf +as necessary, and create a file listing the mirrors in the specified +format. + +mirmon should be run from cron, you may add an entry like this to +root's crontab: + +@hourly ${LOCALBASE}/bin/mirmon -u _mirmon -get update diff --git a/net/mirmon/pkg/PLIST b/net/mirmon/pkg/PLIST new file mode 100644 index 00000000000..54aa8a1172f --- /dev/null +++ b/net/mirmon/pkg/PLIST @@ -0,0 +1,233 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2010/06/08 00:03:55 sthen Exp $ +@newgroup _mirmon:651 +@newuser _mirmon:651:_mirmon::mirmon user:/nonexistent:/sbin/nologin +bin/mirmon +bin/mirmon-probe +${P5SITE}/Mirmon.pm +@man man/man1/mirmon.1 +@man man/man1/mirmon.pm.1 +share/doc/mirmon/ +share/doc/mirmon/RELEASE-NOTES +share/examples/mirmon/ +share/examples/mirmon/countries.list +@owner _mirmon +@sample /var/db/mirmon/ +@sample /var/www/htdocs/mirmon/ +@owner +@sample /var/db/mirmon/countries.list +share/examples/mirmon/icons/ +@sample /var/www/htdocs/mirmon/icons/ +share/examples/mirmon/icons/bar.gif +@sample /var/www/htdocs/mirmon/icons/bar.gif +share/examples/mirmon/icons/icons/ +share/examples/mirmon/icons/mirmon.gif +@sample /var/www/htdocs/mirmon/icons/mirmon.gif +share/examples/mirmon/icons/mirmon_b.gif +@sample /var/www/htdocs/mirmon/icons/mirmon_b.gif +share/examples/mirmon/icons/mirmon_f.gif +@sample /var/www/htdocs/mirmon/icons/mirmon_f.gif +share/examples/mirmon/icons/mirmon_s.gif +@sample /var/www/htdocs/mirmon/icons/mirmon_s.gif +share/examples/mirmon/icons/mirmon_z.gif +@sample /var/www/htdocs/mirmon/icons/mirmon_z.gif +share/examples/mirmon/icons/mmb01.gif +@sample /var/www/htdocs/mirmon/icons/mmb01.gif +share/examples/mirmon/icons/mmb02.gif +@sample /var/www/htdocs/mirmon/icons/mmb02.gif +share/examples/mirmon/icons/mmb03.gif +@sample /var/www/htdocs/mirmon/icons/mmb03.gif +share/examples/mirmon/icons/mmb04.gif +@sample /var/www/htdocs/mirmon/icons/mmb04.gif +share/examples/mirmon/icons/mmb05.gif +@sample /var/www/htdocs/mirmon/icons/mmb05.gif +share/examples/mirmon/icons/mmb06.gif +@sample /var/www/htdocs/mirmon/icons/mmb06.gif +share/examples/mirmon/icons/mmb07.gif +@sample /var/www/htdocs/mirmon/icons/mmb07.gif +share/examples/mirmon/icons/mmb08.gif +@sample /var/www/htdocs/mirmon/icons/mmb08.gif +share/examples/mirmon/icons/mmb09.gif +@sample /var/www/htdocs/mirmon/icons/mmb09.gif +share/examples/mirmon/icons/mmb10.gif +@sample /var/www/htdocs/mirmon/icons/mmb10.gif +share/examples/mirmon/icons/mmb11.gif +@sample /var/www/htdocs/mirmon/icons/mmb11.gif +share/examples/mirmon/icons/mmb12.gif +@sample /var/www/htdocs/mirmon/icons/mmb12.gif +share/examples/mirmon/icons/mmb13.gif +@sample /var/www/htdocs/mirmon/icons/mmb13.gif +share/examples/mirmon/icons/mmb14.gif +@sample /var/www/htdocs/mirmon/icons/mmb14.gif +share/examples/mirmon/icons/mmf01.gif +@sample /var/www/htdocs/mirmon/icons/mmf01.gif +share/examples/mirmon/icons/mmf02.gif +@sample /var/www/htdocs/mirmon/icons/mmf02.gif +share/examples/mirmon/icons/mmf03.gif +@sample /var/www/htdocs/mirmon/icons/mmf03.gif +share/examples/mirmon/icons/mmf04.gif +@sample /var/www/htdocs/mirmon/icons/mmf04.gif +share/examples/mirmon/icons/mmf05.gif +@sample /var/www/htdocs/mirmon/icons/mmf05.gif +share/examples/mirmon/icons/mmf06.gif +@sample /var/www/htdocs/mirmon/icons/mmf06.gif +share/examples/mirmon/icons/mmf07.gif +@sample /var/www/htdocs/mirmon/icons/mmf07.gif +share/examples/mirmon/icons/mmf08.gif +@sample /var/www/htdocs/mirmon/icons/mmf08.gif +share/examples/mirmon/icons/mmf09.gif +@sample /var/www/htdocs/mirmon/icons/mmf09.gif +share/examples/mirmon/icons/mmf10.gif +@sample /var/www/htdocs/mirmon/icons/mmf10.gif +share/examples/mirmon/icons/mmf11.gif +@sample /var/www/htdocs/mirmon/icons/mmf11.gif +share/examples/mirmon/icons/mmf12.gif +@sample /var/www/htdocs/mirmon/icons/mmf12.gif +share/examples/mirmon/icons/mmf13.gif +@sample /var/www/htdocs/mirmon/icons/mmf13.gif +share/examples/mirmon/icons/mmf14.gif +@sample /var/www/htdocs/mirmon/icons/mmf14.gif +share/examples/mirmon/icons/mms01.gif +@sample /var/www/htdocs/mirmon/icons/mms01.gif +share/examples/mirmon/icons/mms02.gif +@sample /var/www/htdocs/mirmon/icons/mms02.gif +share/examples/mirmon/icons/mms03.gif +@sample /var/www/htdocs/mirmon/icons/mms03.gif +share/examples/mirmon/icons/mms04.gif +@sample /var/www/htdocs/mirmon/icons/mms04.gif +share/examples/mirmon/icons/mms05.gif +@sample /var/www/htdocs/mirmon/icons/mms05.gif +share/examples/mirmon/icons/mms06.gif +@sample /var/www/htdocs/mirmon/icons/mms06.gif +share/examples/mirmon/icons/mms07.gif +@sample /var/www/htdocs/mirmon/icons/mms07.gif +share/examples/mirmon/icons/mms08.gif +@sample /var/www/htdocs/mirmon/icons/mms08.gif +share/examples/mirmon/icons/mms09.gif +@sample /var/www/htdocs/mirmon/icons/mms09.gif +share/examples/mirmon/icons/mms10.gif +@sample /var/www/htdocs/mirmon/icons/mms10.gif +share/examples/mirmon/icons/mms11.gif +@sample /var/www/htdocs/mirmon/icons/mms11.gif +share/examples/mirmon/icons/mms12.gif +@sample /var/www/htdocs/mirmon/icons/mms12.gif +share/examples/mirmon/icons/mms13.gif +@sample /var/www/htdocs/mirmon/icons/mms13.gif +share/examples/mirmon/icons/mms14.gif +@sample /var/www/htdocs/mirmon/icons/mms14.gif +share/examples/mirmon/icons/mmsb01.gif +@sample /var/www/htdocs/mirmon/icons/mmsb01.gif +share/examples/mirmon/icons/mmsb02.gif +@sample /var/www/htdocs/mirmon/icons/mmsb02.gif +share/examples/mirmon/icons/mmsb03.gif +@sample /var/www/htdocs/mirmon/icons/mmsb03.gif +share/examples/mirmon/icons/mmsb04.gif +@sample /var/www/htdocs/mirmon/icons/mmsb04.gif +share/examples/mirmon/icons/mmsb05.gif +@sample /var/www/htdocs/mirmon/icons/mmsb05.gif +share/examples/mirmon/icons/mmsb06.gif +@sample /var/www/htdocs/mirmon/icons/mmsb06.gif +share/examples/mirmon/icons/mmsb07.gif +@sample /var/www/htdocs/mirmon/icons/mmsb07.gif +share/examples/mirmon/icons/mmsb08.gif +@sample /var/www/htdocs/mirmon/icons/mmsb08.gif +share/examples/mirmon/icons/mmsb09.gif +@sample /var/www/htdocs/mirmon/icons/mmsb09.gif +share/examples/mirmon/icons/mmsb10.gif +@sample /var/www/htdocs/mirmon/icons/mmsb10.gif +share/examples/mirmon/icons/mmsb11.gif +@sample /var/www/htdocs/mirmon/icons/mmsb11.gif +share/examples/mirmon/icons/mmsb12.gif +@sample /var/www/htdocs/mirmon/icons/mmsb12.gif +share/examples/mirmon/icons/mmsb13.gif +@sample /var/www/htdocs/mirmon/icons/mmsb13.gif +share/examples/mirmon/icons/mmsb14.gif +@sample /var/www/htdocs/mirmon/icons/mmsb14.gif +share/examples/mirmon/icons/mmsbf01.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf01.gif +share/examples/mirmon/icons/mmsbf02.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf02.gif +share/examples/mirmon/icons/mmsbf03.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf03.gif +share/examples/mirmon/icons/mmsbf04.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf04.gif +share/examples/mirmon/icons/mmsbf05.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf05.gif +share/examples/mirmon/icons/mmsbf06.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf06.gif +share/examples/mirmon/icons/mmsbf07.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf07.gif +share/examples/mirmon/icons/mmsbf08.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf08.gif +share/examples/mirmon/icons/mmsbf09.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf09.gif +share/examples/mirmon/icons/mmsbf10.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf10.gif +share/examples/mirmon/icons/mmsbf11.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf11.gif +share/examples/mirmon/icons/mmsbf12.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf12.gif +share/examples/mirmon/icons/mmsbf13.gif +@sample /var/www/htdocs/mirmon/icons/mmsbf13.gif +share/examples/mirmon/icons/mmsf01.gif +@sample /var/www/htdocs/mirmon/icons/mmsf01.gif +share/examples/mirmon/icons/mmsf02.gif +@sample /var/www/htdocs/mirmon/icons/mmsf02.gif +share/examples/mirmon/icons/mmsf03.gif +@sample /var/www/htdocs/mirmon/icons/mmsf03.gif +share/examples/mirmon/icons/mmsf04.gif +@sample /var/www/htdocs/mirmon/icons/mmsf04.gif +share/examples/mirmon/icons/mmsf05.gif +@sample /var/www/htdocs/mirmon/icons/mmsf05.gif +share/examples/mirmon/icons/mmsf06.gif +@sample /var/www/htdocs/mirmon/icons/mmsf06.gif +share/examples/mirmon/icons/mmsf07.gif +@sample /var/www/htdocs/mirmon/icons/mmsf07.gif +share/examples/mirmon/icons/mmsf08.gif +@sample /var/www/htdocs/mirmon/icons/mmsf08.gif +share/examples/mirmon/icons/mmsf09.gif +@sample /var/www/htdocs/mirmon/icons/mmsf09.gif +share/examples/mirmon/icons/mmsf10.gif +@sample /var/www/htdocs/mirmon/icons/mmsf10.gif +share/examples/mirmon/icons/mmsf11.gif +@sample /var/www/htdocs/mirmon/icons/mmsf11.gif +share/examples/mirmon/icons/mmsf12.gif +@sample /var/www/htdocs/mirmon/icons/mmsf12.gif +share/examples/mirmon/icons/mmsf13.gif +@sample /var/www/htdocs/mirmon/icons/mmsf13.gif +share/examples/mirmon/icons/mmsf14.gif +@sample /var/www/htdocs/mirmon/icons/mmsf14.gif +share/examples/mirmon/icons/mmz01.gif +@sample /var/www/htdocs/mirmon/icons/mmz01.gif +share/examples/mirmon/icons/mmz02.gif +@sample /var/www/htdocs/mirmon/icons/mmz02.gif +share/examples/mirmon/icons/mmz03.gif +@sample /var/www/htdocs/mirmon/icons/mmz03.gif +share/examples/mirmon/icons/mmz04.gif +@sample /var/www/htdocs/mirmon/icons/mmz04.gif +share/examples/mirmon/icons/mmz05.gif +@sample /var/www/htdocs/mirmon/icons/mmz05.gif +share/examples/mirmon/icons/mmz06.gif +@sample /var/www/htdocs/mirmon/icons/mmz06.gif +share/examples/mirmon/icons/mmz07.gif +@sample /var/www/htdocs/mirmon/icons/mmz07.gif +share/examples/mirmon/icons/mmz08.gif +@sample /var/www/htdocs/mirmon/icons/mmz08.gif +share/examples/mirmon/icons/mmz09.gif +@sample /var/www/htdocs/mirmon/icons/mmz09.gif +share/examples/mirmon/icons/mmz10.gif +@sample /var/www/htdocs/mirmon/icons/mmz10.gif +share/examples/mirmon/icons/mmz11.gif +@sample /var/www/htdocs/mirmon/icons/mmz11.gif +share/examples/mirmon/icons/mmz12.gif +@sample /var/www/htdocs/mirmon/icons/mmz12.gif +share/examples/mirmon/icons/mmz13.gif +@sample /var/www/htdocs/mirmon/icons/mmz13.gif +share/examples/mirmon/icons/mmz14.gif +@sample /var/www/htdocs/mirmon/icons/mmz14.gif +share/examples/mirmon/icons/vbrb.gif +@sample /var/www/htdocs/mirmon/icons/vbrb.gif +share/examples/mirmon/icons/vbrw.gif +@sample /var/www/htdocs/mirmon/icons/vbrw.gif +share/examples/mirmon/mirmon.conf +@sample /etc/mirmon.conf +@extraunexec rm -rf /var/db/mirmon