From 3d7b4df8b3b5dcb81e55b30999fdc394132df2be Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Thu, 22 Mar 2012 19:02:32 +0000 Subject: Initial import. Ebuild by me. Package-Manager: portage-2.2.0_alpha93/cvs/Linux x86_64 --- www-misc/urlwatch/ChangeLog | 10 ++ www-misc/urlwatch/Manifest | 19 ++++ www-misc/urlwatch/files/urlwatch-xmpp.patch | 138 ++++++++++++++++++++++++++++ www-misc/urlwatch/metadata.xml | 8 ++ www-misc/urlwatch/urlwatch-1.14.ebuild | 37 ++++++++ 5 files changed, 212 insertions(+) create mode 100644 www-misc/urlwatch/ChangeLog create mode 100644 www-misc/urlwatch/Manifest create mode 100644 www-misc/urlwatch/files/urlwatch-xmpp.patch create mode 100644 www-misc/urlwatch/metadata.xml create mode 100644 www-misc/urlwatch/urlwatch-1.14.ebuild (limited to 'www-misc') diff --git a/www-misc/urlwatch/ChangeLog b/www-misc/urlwatch/ChangeLog new file mode 100644 index 000000000000..839ff19c4b20 --- /dev/null +++ b/www-misc/urlwatch/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for www-misc/urlwatch +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/www-misc/urlwatch/ChangeLog,v 1.1 2012/03/22 19:02:31 radhermit Exp $ + +*urlwatch-1.14 (22 Mar 2012) + + 22 Mar 2012; Tim Harder +urlwatch-1.14.ebuild, + +files/urlwatch-xmpp.patch, +metadata.xml: + Initial import. Ebuild by me. + diff --git a/www-misc/urlwatch/Manifest b/www-misc/urlwatch/Manifest new file mode 100644 index 000000000000..0303dc92bd30 --- /dev/null +++ b/www-misc/urlwatch/Manifest @@ -0,0 +1,19 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA512 + +AUX urlwatch-xmpp.patch 5701 RMD160 ecbb72ec1fa8007e1c0bb559d932f37884eeb55c SHA1 0927638a0e6cc4bd4c03f26f1a4f48016289caed SHA256 bbafcdd10005b1611074c839ce3cc206d3fe8ab0f790e50e063f327d6acf2013 +DIST urlwatch-1.14.tar.gz 12969 RMD160 3e16c94007873d9872853ca17ba9c2c21d9ed88f SHA1 22899950f211b414f2153ebfb320c545986b6198 SHA256 00095dd0e2b09ab8b5ed4b5ae615c8e80484075219f8c81e05afd5777bb1a7ab +EBUILD urlwatch-1.14.ebuild 1086 RMD160 4bfa9328b4ce7d100aa5fabe7a54d1e93bf196b4 SHA1 20e9ba5f1ba5eada6c47f30eafcace3471f23884 SHA256 b28f42d06771432cb7cdeda62940974b5a068d6b5480b3b9f85af740fb29f6bd +MISC ChangeLog 390 RMD160 56aaaa69f251c30bb9f8f9d27c405a06dd6d6421 SHA1 6529725d6468a2c3eece482a26a7533f684e799f SHA256 a9dbf92d7328b7d39a5b08793e6ce25758157db690f324e7e5cc2cf66b251c9c +MISC metadata.xml 232 RMD160 9725fc18735b1d8d4079f25759ee0823a0c6795d SHA1 ec75efe30e67f74a4f315324afc75ed2a8d30bb4 SHA256 a778e40f66cb2fa35529e4f45cb8356c8b1b109163cd939396f02e8ea6aa5f1a +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iQEcBAEBCgAGBQJPa3dQAAoJEEqz6FtPBkyjgRUIAIKU9a/vWxLeb6klxbmwgje1 +EgxO7l9GhI7gX9XU6KBDh30gDbf/lgc6K37V1pJmr0qt5TOulHo6gg6gntMr2hNK +ksMVVb3/YEhzlF2qazmYyLcb0MUNW0Qxz+0dvac9sVJrnFO0QKiFAYg7iiiD1P1y +udvs8ihQXiL8vbsyO90ukawegi3ZUXxc5fyeTQU9bDCuhKBg7hwqP0Yxvf2J0PP+ +98NV3thMruJKOfkIHNm9JRvT9TXg6kviY5yfdlmnfzaqglDrKC7fjrXaOd8yK4Qj +oDDF93rp4Oh4nZsvWjr2zGnwQ/QWyh5m3oJE9vnWUY2M3neSNu+R5X0c5i84STs= +=/uZN +-----END PGP SIGNATURE----- diff --git a/www-misc/urlwatch/files/urlwatch-xmpp.patch b/www-misc/urlwatch/files/urlwatch-xmpp.patch new file mode 100644 index 000000000000..6de100c06893 --- /dev/null +++ b/www-misc/urlwatch/files/urlwatch-xmpp.patch @@ -0,0 +1,138 @@ +From 96024c866daeeb9e6bdbde27cbed7f9f65f1bf24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20D=C3=BCll=20(akurei)?= +Date: Sat, 20 Feb 2010 00:15:58 +0100 +Subject: [PATCH] Added xmpp functionality to v1.9 + +--- + urlwatch | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 73 insertions(+), 3 deletions(-) + +diff --git a/urlwatch b/urlwatch +index a59aeea..cffc5a7 100755 +--- a/urlwatch ++++ b/urlwatch +@@ -55,6 +55,7 @@ urls_txt = os.path.join(urlwatch_dir, 'urls.txt') + cache_dir = os.path.join(urlwatch_dir, 'cache') + scripts_dir = os.path.join(urlwatch_dir, 'lib') + hooks_py = os.path.join(scripts_dir, 'hooks.py') ++xmpp_txt = os.path.join(urlwatch_dir, 'xmpp.txt') + + # Check if we are installed in the system already + (prefix, bindir) = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0]))) +@@ -136,8 +137,10 @@ if __name__ == '__main__': + parser.add_option('', '--urls', dest='urls', metavar='FILE', help='Read URLs from the specified file') + parser.add_option('', '--hooks', dest='hooks', metavar='FILE', help='Use specified file as hooks.py module') + parser.add_option('-e', '--display-errors', action='store_true', dest='display_errors', help='Include HTTP errors (404, etc..) in the output') ++ parser.add_option('-x', '--xmpp', action='store_true', dest='xmpp', help='Send a message to XMPP clients') ++ parser.add_option('', '--xmpp-file', dest='xmpp_file', metavar='FILE', help='Read XMPP login data and recipients from [FILE] instead') + +- parser.set_defaults(verbose=False, display_errors=False) ++ parser.set_defaults(verbose=False, display_errors=False, xmpp=False) + + (options, args) = parser.parse_args(sys.argv) + +@@ -171,6 +174,9 @@ if __name__ == '__main__': + log.error('%s is not a file' % options.hooks) + print 'Error: %s is not a file' % options.hooks + sys.exit(1) ++ ++ if options.xmpp_file: ++ options.xmpp = True + + # Created all needed folders + for needed_dir in (urlwatch_dir, cache_dir, scripts_dir): +@@ -196,6 +202,52 @@ if __name__ == '__main__': + if not options.hooks and os.path.exists(hooks_py_example) and not os.path.exists(hooks_py_fn): + shutil.copy(hooks_py_example, hooks_py_fn) + sys.exit(1) ++ ++ if options.xmpp: ++ try: ++ import xmpp ++ except ImportError: ++ log.error('python-xmpp not installed') ++ print 'Error: You need python-xmpp installed to use the -x switch' ++ sys.exit(1) ++ ++ if options.xmpp_file: ++ if os.path.isfile(options.xmpp_file): ++ xmpp_txt = options.xmpp_file ++ log.info('using %s as xmpp.txt' % xmpp_txt) ++ else: ++ log.error('no such file: %s' % options.xmpp_file) ++ print 'Error: There is no such file: %s' % options.xmpp_file ++ sys.exit(1) ++ ++ try: ++ xmpp_filehandle = open(xmpp_txt, 'r') ++ except IOError: ++ log.error('No xmpp.txt file') ++ print 'Error: You need to create a xmpp.txt file first.' ++ print '' ++ print 'Place it in %s' % os.path.dirname(xmpp_txt) ++ print '' ++ print '' ++ print 'Syntax is:' ++ print '' ++ print '\tsender-username@server.tld senderpassword' ++ print '\tfirst-recipient@jabberserver1.tld' ++ print '\tsecond-recipient@jabberserver2.tld' ++ print '\tthird-recipient@foobarserver.tld' ++ print '\t...' ++ print '' ++ sys.exit(1) ++ ++ xmpp_lines = xmpp_filehandle.readlines() ++ xmpp_filehandle.close() ++ for i in xrange(len(xmpp_lines)): ++ xmpp_lines[i] = xmpp_lines[i].strip("\n") ++ (xmpp_from, xmpp_pass) = xmpp_lines[0].split(' ') ++ xmpp_to = [] ++ for i in xrange(1, len(xmpp_lines)): ++ xmpp_to.append(xmpp_lines[i]) ++ log.info('using %s to send status messages to %s' % (xmpp_from, xmpp_to)) + + headers = { + 'User-agent': user_agent, +@@ -285,18 +337,36 @@ if __name__ == '__main__': + end = datetime.datetime.now() + + # Output everything +- if len(summary) > 1: ++ if len(summary) > 0: + log.info('printing summary with %d items' % len(summary)) + print '-'*line_length + print 'summary: %d changes' % (len(summary),) + print '' ++ msg = '' + for id, line in enumerate(summary): + print '%02d. %s' % (id+1, line) ++ msg += "\n" + '%02d. %s' % (id+1, line) + print '-'*line_length + print '\n\n\n' ++ ++ if (options.xmpp): ++ try: ++ (xmpp_user, xmpp_server) = xmpp_from.split('@') ++ client = xmpp.Client(xmpp_server) ++ client.connect(server=(xmpp_server,5223)) ++ client.auth(xmpp_user, xmpp_pass, 'urlwatch') ++ client.sendInitPresence() ++ for to in xmpp_to: ++ message = xmpp.Message(to, msg) ++ message.setAttr('type', 'chat') ++ client.send(message) ++ except: ++ log.error('Could not send message to %s' % xmpp_to) ++ print 'Error: Could not send message to %s' % xmpp_to ++ + else: + log.info('summary is too short - not printing') +- if len(details) > 1: ++ if len(details) > 1 and not options.xmpp: + log.info('printing details with %d items' % len(details)) + print '\n'.join(details) + print '-- ' +-- +1.7.0 + diff --git a/www-misc/urlwatch/metadata.xml b/www-misc/urlwatch/metadata.xml new file mode 100644 index 000000000000..157326a7e891 --- /dev/null +++ b/www-misc/urlwatch/metadata.xml @@ -0,0 +1,8 @@ + + + + + radhermit@gentoo.org + Tim Harder + + diff --git a/www-misc/urlwatch/urlwatch-1.14.ebuild b/www-misc/urlwatch/urlwatch-1.14.ebuild new file mode 100644 index 000000000000..1d2d1a257d12 --- /dev/null +++ b/www-misc/urlwatch/urlwatch-1.14.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-misc/urlwatch/urlwatch-1.14.ebuild,v 1.1 2012/03/22 19:02:31 radhermit Exp $ + +EAPI="4" +PYTHON_DEPEND="2:2.5 3:3.2" +SUPPORT_PYTHON_ABIS="1" +DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1" + +inherit distutils eutils + +DESCRIPTION="A tool for monitoring webpages for updates" +HOMEPAGE="http://thp.io/2008/urlwatch/ http://pypi.python.org/pypi/urlwatch" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="xmpp" + +RDEPEND="xmpp? ( dev-python/xmpppy ) + || ( >=dev-lang/python-3.2 dev-python/futures )" +DEPEND="${RDEPEND}" + +src_prepare() { + use xmpp && epatch "${FILESDIR}"/${PN}-xmpp.patch + sed -i -e "s/^os.unlink/#\0/" setup.py || die + + distutils_src_prepare + + 2to3_conversion() { + [[ "${PYTHON_ABI}" == 2.* ]] && return + 2to3-${PYTHON_ABI} -nw --no-diffs urlwatch lib/urlwatch/*.py \ + examples/hooks.py.example setup.py || die "2to3 failed" + } + python_execute_function -s 2to3_conversion +} -- cgit v1.2.3-65-gdbad