diff options
author | lioux <lioux@FreeBSD.org> | 2005-10-10 09:57:28 +0800 |
---|---|---|
committer | lioux <lioux@FreeBSD.org> | 2005-10-10 09:57:28 +0800 |
commit | 2985d7fc77e13b961de88780457b9791cb3172ff (patch) | |
tree | 99831bc4f5aec96c8ac95502b10ec0fa8290c290 /net | |
parent | 2379cc2ccae3366729fd1a547b358df9dd682561 (diff) | |
download | freebsd-ports-gnome-2985d7fc77e13b961de88780457b9791cb3172ff.tar.gz freebsd-ports-gnome-2985d7fc77e13b961de88780457b9791cb3172ff.tar.zst freebsd-ports-gnome-2985d7fc77e13b961de88780457b9791cb3172ff.zip |
New port AmphetaDesk version 0.93.1: News, weblog, and RSS aggregator
with a brain
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/amphetadesk/Makefile | 102 | ||||
-rw-r--r-- | net/amphetadesk/distinfo | 2 | ||||
-rw-r--r-- | net/amphetadesk/files/patch-lib::AmphetaDesk::MyChannels.pm | 14 | ||||
-rw-r--r-- | net/amphetadesk/files/patch-lib::AmphetaDesk::OS::Linux.pm | 61 | ||||
-rw-r--r-- | net/amphetadesk/files/patch-lib::AmphetaDesk::Settings.pm | 15 | ||||
-rw-r--r-- | net/amphetadesk/files/patch-lib::AmphetaDesk::Utilities.pm | 29 | ||||
-rw-r--r-- | net/amphetadesk/files/patch-lib::XML::Simple.pm | 36 | ||||
-rw-r--r-- | net/amphetadesk/files/wrapper.sh | 25 | ||||
-rw-r--r-- | net/amphetadesk/pkg-descr | 12 | ||||
-rw-r--r-- | net/amphetadesk/pkg-plist | 56 |
11 files changed, 353 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 90db3327b223..3eaa23e02db9 100644 --- a/net/Makefile +++ b/net/Makefile @@ -17,6 +17,7 @@ SUBDIR += adasockets SUBDIR += aget SUBDIR += aim + SUBDIR += amphetadesk SUBDIR += amsn SUBDIR += amule1 SUBDIR += amule2 diff --git a/net/amphetadesk/Makefile b/net/amphetadesk/Makefile new file mode 100644 index 000000000000..f6e91f0cf722 --- /dev/null +++ b/net/amphetadesk/Makefile @@ -0,0 +1,102 @@ +# New ports collection makefile for: AmphetaDesk +# Date created: Sun Oct 9 18:12:56 UTC 2005 +# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= amphetadesk +PORTVERSION= 0.93.1 +CATEGORIES= net perl5 www +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} +DISTNAME= ${PORTNAME}-src-v${PORTVERSION} + +MAINTAINER= lioux@FreeBSD.org +COMMENT= News, weblog, and RSS aggregator with a brain + +RUN_DEPENDS= \ + ${SITE_PERL}/${PERL_ARCH}/XML/Parser.pm:${PORTSDIR}/textproc/p5-XML-Parser \ + ${SITE_PERL}/Bundle/LWP.pm:${PORTSDIR}/www/p5-libwww + +USE_PERL5_RUN= yes +USE_REINPLACE= yes +NO_BUILD= yes + +.ifndef(NOPORTDOCS) +PORTDOCS= \ + * +.endif + +post-patch: + @${FIND} ${WRKSRC} -type f -print0 | \ + ${XARGS} -0 -x -n 10 \ + ${REINPLACE_CMD} -E \ + -e 's|([[:space:]]+)(AmphetaDesk)|\1AmphetaDesk::\2|g' \ + -e 's|([[:space:]]*)(Text::Template)|\1AmphetaDesk::\2|g' \ + -e 's|([[:space:]]*)(XML::Simple)|\1AmphetaDesk::\2|g' + @${REINPLACE_CMD} -E \ + -e 's|%%DOCSDIR%%|${DOCSDIR}|' \ + -e 's|%%DATADIR%%|${DATADIR}|' \ + ${WRKSRC}/lib/AmphetaDesk/Settings.pm + +post-configure: + @${REINPLACE_CMD} -E \ + -e 's|/usr/bin/perl|${PERL}|' \ + ${WRKSRC}/AmphetaDesk.pl + @${SED} \ + -e "s|%%PREFIX%%|${PREFIX}|" \ + -e 's|%%DATADIR%%|${DATADIR}|' \ + -e "s|%%PERL%%|${PERL}|" \ + ${FILESDIR}/wrapper.sh > \ + ${WRKDIR}/wrapper.sh + +do-install: +## create site_perl +# dirs + @${MKDIR} ${SITE_PERL:S|${LOCALBASE}|${PREFIX}|}/AmphetaDesk + @cd ${WRKSRC}/lib && \ + ${FIND} * -type d ! -empty -print0 | \ + ${XARGS} -0 -x -n 10 -I {} \ + ${MKDIR} ${SITE_PERL:S|${LOCALBASE}|${PREFIX}|}/AmphetaDesk/{} +# files + @cd ${WRKSRC}/lib && \ + ${FIND} * -type f -name "*pm" -print0 | \ + ${XARGS} -0 -x -n 10 -I {} \ + ${INSTALL_DATA} {} ${SITE_PERL:S|${LOCALBASE}|${PREFIX}|}/AmphetaDesk/{} +# script + @${INSTALL_DATA} ${WRKSRC}/AmphetaDesk.pl \ + ${PREFIX}/bin/AmphetaDesk-real + @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \ + ${PREFIX}/bin/AmphetaDesk +## docs +.ifndef(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +.for ext in html txt xml + @${INSTALL_DATA} ${WRKSRC}/docs/*.${ext} ${DOCSDIR} +.endfor + @${MKDIR} ${DOCSDIR}/images +.for ext in gif jpg + @${INSTALL_DATA} ${WRKSRC}/docs/images/*.${ext} \ + ${DOCSDIR}/images +.endfor +.endif +## lists + @${MKDIR} ${DATADIR}/lists + @${INSTALL_DATA} ${WRKSRC}/data/lists/services-channels-recent.xml \ + ${DATADIR}/lists +## templates +# dirs + @cd ${WRKSRC} && \ + ${FIND} templates -type d ! -empty -print0 | \ + ${XARGS} -0 -x -n 10 -I {} \ + ${MKDIR} ${DATADIR}/{} +# files +.for ext in gif html ico png pict + @cd ${WRKSRC} && \ + ${FIND} templates -type f -name "*.${ext}" -print0 | \ + ${XARGS} -0 -x -n 10 -I {} \ + ${INSTALL_DATA} {} ${DATADIR}/{} +.endfor + +.include <bsd.port.mk> diff --git a/net/amphetadesk/distinfo b/net/amphetadesk/distinfo new file mode 100644 index 000000000000..27dbfd01b061 --- /dev/null +++ b/net/amphetadesk/distinfo @@ -0,0 +1,2 @@ +MD5 (amphetadesk-src-v0.93.1.tar.gz) = 1ea3b033381be6e694d78b183821f90b +SIZE (amphetadesk-src-v0.93.1.tar.gz) = 853503 diff --git a/net/amphetadesk/files/patch-lib::AmphetaDesk::MyChannels.pm b/net/amphetadesk/files/patch-lib::AmphetaDesk::MyChannels.pm new file mode 100644 index 000000000000..cb4e1edfed1b --- /dev/null +++ b/net/amphetadesk/files/patch-lib::AmphetaDesk::MyChannels.pm @@ -0,0 +1,14 @@ +--- lib/AmphetaDesk/MyChannels.pm.orig Sun Oct 9 22:43:13 2005 ++++ lib/AmphetaDesk/MyChannels.pm Sun Oct 9 22:47:00 2005 +@@ -359,9 +359,11 @@ + + # count 'em. + my $total_count = count_my_channels; ++ if ($total_count) { + note("There was a total of $total_count subscribed channels."); + note("We dance a drunken jig of epic proportions! " . + "<shake> <jiggle> <keRAASH!>...") if $total_count > 100; ++ } + + # resave the channels list + # with the latest dates. diff --git a/net/amphetadesk/files/patch-lib::AmphetaDesk::OS::Linux.pm b/net/amphetadesk/files/patch-lib::AmphetaDesk::OS::Linux.pm new file mode 100644 index 000000000000..101b5d137522 --- /dev/null +++ b/net/amphetadesk/files/patch-lib::AmphetaDesk::OS::Linux.pm @@ -0,0 +1,61 @@ +--- lib/AmphetaDesk/OS/Linux.pm.orig Sun Oct 9 22:39:00 2005 ++++ lib/AmphetaDesk/OS/Linux.pm Sun Oct 9 22:39:05 2005 +@@ -15,11 +15,25 @@ + use strict; + use AmphetaDesk::Settings; + use AmphetaDesk::Utilities; ++use POSIX ":sys_wait_h"; + require Exporter; + use vars qw( @ISA @EXPORT ); + @ISA = qw( Exporter ); + @EXPORT = qw( gui_init gui_listen gui_note open_url ); + ++# taken from perlipc man page ++sub sigchild { ++ my $child; ++ ++ # If a second child dies while in the signal handler caused by the ++ # first death, we won't get another signal. So must loop here else ++ # we will leave the unreaped child as a zombie. And the next time ++ # two children die we get another zombie. And so on. ++ while (($child = waitpid(-1,WNOHANG)) > 0) {} ++ ++ $SIG{CHLD} = \&sigchild; ++} ++ + ############################################################################### + # gui_init - start the gui and display the window. # + ############################################################################### +@@ -105,8 +119,32 @@ + # construct our url. + my $url = "http://127.0.0.1:" . get_setting("urls_port") . "/index.html"; + ++ # default browser ++ my $browser; ++ + # we spit out our suggestion just to catch all instances. + note("If your browser doesn't load, go to <$url>.", 1); ++ ++ # what browser? ++ if ($ENV{'BROWSER'}) { ++ $browser = $ENV{'BROWSER'}; ++ } else { ++ if (get_setting("user_browser_path")) { ++ $browser = get_setting("user_browser_path"); ++ } ++ } ++ ++ if ($browser) { ++ note("Your environment states that $browser is your default program."); ++ ++ $SIG{CHLD} = \&sigchild; ++ ++ if (fork() == 0) { ++ my @args = ("$browser", "$url"); ++ exec(@args) == 0 ++ or note("The browser <$browser> does not exist. Please select another."); ++ } ++ } + + return 1; + diff --git a/net/amphetadesk/files/patch-lib::AmphetaDesk::Settings.pm b/net/amphetadesk/files/patch-lib::AmphetaDesk::Settings.pm new file mode 100644 index 000000000000..448874708510 --- /dev/null +++ b/net/amphetadesk/files/patch-lib::AmphetaDesk::Settings.pm @@ -0,0 +1,15 @@ +--- lib/AmphetaDesk/Settings.pm.orig Sun Oct 9 20:54:43 2005 ++++ lib/AmphetaDesk/Settings.pm Sun Oct 9 20:56:03 2005 +@@ -105,9 +105,9 @@ + $SETTINGS{app_contact} = "Morbus Iff"; + $SETTINGS{app_email} = "morbus\@disobey.com"; + $SETTINGS{app_os} = $^O; +- $SETTINGS{dir_data} = catdir($Bin, "data"); +- $SETTINGS{dir_docs} = catdir($Bin, "docs"); +- $SETTINGS{dir_templates} = catdir($Bin, "templates", "default"); ++ $SETTINGS{dir_data} = catdir(".", "data"); ++ $SETTINGS{dir_docs} = "%%DOCSDIR%%"; ++ $SETTINGS{dir_templates} = catdir("%%DATADIR%%", "templates", "default"); + $SETTINGS{dir_gui} = catdir($SETTINGS{dir_templates}, "gui"); + $SETTINGS{dir_data_channels} = catdir($SETTINGS{dir_data}, "channels"); + $SETTINGS{dir_data_lists} = catdir($SETTINGS{dir_data}, "lists"); diff --git a/net/amphetadesk/files/patch-lib::AmphetaDesk::Utilities.pm b/net/amphetadesk/files/patch-lib::AmphetaDesk::Utilities.pm new file mode 100644 index 000000000000..efa3380c5d85 --- /dev/null +++ b/net/amphetadesk/files/patch-lib::AmphetaDesk::Utilities.pm @@ -0,0 +1,29 @@ +--- lib/AmphetaDesk/Utilities.pm.orig Sun Oct 9 19:45:59 2005 ++++ lib/AmphetaDesk/Utilities.pm Sun Oct 9 19:51:44 2005 +@@ -112,7 +112,7 @@ + $hour = sprintf "%02.0d", $hour; + + # print the entry to our log file. +- print LOG "[$hour:$min:$sec] $message\n"; ++ print LOG "[$hour:$min:$sec] $message\n" if fileno LOG; + + # and save the message in our response log + # if the message is also being sent to the gui. +@@ -127,7 +127,7 @@ + $os = "MacOS" if $^O =~ /Mac/; + $os = "Windows" if $^O =~ /Win/; + $os = "Linux" unless defined $os; +- my $packname = "AmphetaDesk::OS::"; ++ my $packname = "AmphetaDesk::AmphetaDesk::OS::"; + my $funcname = "::gui_note"; + &{ $packname. $os . $funcname }($message) if $gui; + } +@@ -151,7 +151,7 @@ + $os = "MacOS" if $^O =~ /Mac/; + $os = "Windows" if $^O =~ /Win/; + $os = "Linux" unless defined $os; +- my $packname = "AmphetaDesk::OS::"; ++ my $packname = "AmphetaDesk::AmphetaDesk::OS::"; + my $funcname = "::gui_note"; + &{ $packname. $os . $funcname }($message); + } diff --git a/net/amphetadesk/files/patch-lib::XML::Simple.pm b/net/amphetadesk/files/patch-lib::XML::Simple.pm new file mode 100644 index 000000000000..16b92d8f0192 --- /dev/null +++ b/net/amphetadesk/files/patch-lib::XML::Simple.pm @@ -0,0 +1,36 @@ +--- lib/XML/Simple.pm.orig Sun Oct 9 20:08:35 2005 ++++ lib/XML/Simple.pm Sun Oct 9 20:22:07 2005 +@@ -880,7 +880,7 @@ + $encoded->{$ref} = $ref; + } + else { +- if($named) { ++ if(($named) && ($ref) && ($self) && ($self->escape_value($ref))) { + return(join('', + $indent, '<', $name, '>', + ($self->{opt}->{noescape} ? $ref : $self->escape_value($ref)), +@@ -888,7 +888,11 @@ + )); + } + else { ++ if ($ref) { + return("$ref$nl"); ++ } else { ++ return("$nl"); ++ } + } + } + +@@ -1013,10 +1017,12 @@ + + my($data) = @_; + ++ if (defined($data)) { + $data =~ s/&/&/sg; + $data =~ s/</</sg; + $data =~ s/>/>/sg; + $data =~ s/"/"/sg; ++ } + + return($data); + } diff --git a/net/amphetadesk/files/wrapper.sh b/net/amphetadesk/files/wrapper.sh new file mode 100644 index 000000000000..772a1f6e0440 --- /dev/null +++ b/net/amphetadesk/files/wrapper.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +PREFIX="%%PREFIX%%/bin" +PROGRAM="${0}" +DIRNAME=${HOME}/.amphetadesk +PERL="%%PERL%%" +DATADIR="%%DATADIR%%" + +if [ ! -d ${DIRNAME} ] +then + mkdir -p ${DIRNAME} +fi + +echo " ${*} " | grep " \-createdironly " || +{ + cd ${DIRNAME} && + echo Running under ${DIRNAME} && + mkdir -p data/lists && + ln -sf ${PREFIX}/${PROGRAM##*/}-real ${PROGRAM##*/} && + if [ -d "${DATADIR}/lists" ]; then + cp -n ${DATADIR}/lists/* data/lists + fi && + exec ${PERL} ./${PROGRAM##*/} "${@}" || + echo PROBLEM. Cannot create directory ${DIRNAME}, make sure you have the proper permissions to create it and try again +} diff --git a/net/amphetadesk/pkg-descr b/net/amphetadesk/pkg-descr new file mode 100644 index 000000000000..3f7be128cd2a --- /dev/null +++ b/net/amphetadesk/pkg-descr @@ -0,0 +1,12 @@ +[ excerpt from developer's www site ] + +AmphetaDesk is a free, cross platform, open-sourced, syndicated +news aggregator - it obediently sits on your desktop, downloads the +latest news that interests you, and displays them in a quick and +easy to use (and customizable!) webpage. With thousands of channels +available, AmphetaDesk can shave hours off your day - and you'll +look smart to all your friends! Egotism never had it better! + +WWW: http://www.disobey.com/amphetadesk/ + +-- lioux@FreeBSD.org diff --git a/net/amphetadesk/pkg-plist b/net/amphetadesk/pkg-plist new file mode 100644 index 000000000000..eb62c230ba73 --- /dev/null +++ b/net/amphetadesk/pkg-plist @@ -0,0 +1,56 @@ +bin/AmphetaDesk +bin/AmphetaDesk-real +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Channels.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/ChannelsList.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/MyChannels.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/OS/Linux.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/OS/MacOS.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/OS/MacOSX.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/OS/Windows.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Settings.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Templates.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Utilities.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Versioning.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/WWW.pm +%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/WebServer.pm +%%SITE_PERL%%/AmphetaDesk/Text/Template.pm +%%SITE_PERL%%/AmphetaDesk/Text/Template/Preprocess.pm +%%SITE_PERL%%/AmphetaDesk/XML/Simple.pm +%%DATADIR%%/lists/services-channels-recent.xml +%%DATADIR%%/templates/default/add_a_channel.html +%%DATADIR%%/templates/default/gui/linux_icon.png +%%DATADIR%%/templates/default/gui/linux_logo.png +%%DATADIR%%/templates/default/gui/macos_icon.pict +%%DATADIR%%/templates/default/gui/macos_logo.pict +%%DATADIR%%/templates/default/gui/macosx_icon.png +%%DATADIR%%/templates/default/gui/macosx_logo.png +%%DATADIR%%/templates/default/gui/win_icon.ico +%%DATADIR%%/templates/default/images/bkgrnd.gif +%%DATADIR%%/templates/default/images/delete.gif +%%DATADIR%%/templates/default/images/email.gif +%%DATADIR%%/templates/default/images/globe.gif +%%DATADIR%%/templates/default/images/logo.gif +%%DATADIR%%/templates/default/images/xml.gif +%%DATADIR%%/templates/default/images/xml_radio.gif +%%DATADIR%%/templates/default/index.html +%%DATADIR%%/templates/default/my_channels.html +%%DATADIR%%/templates/default/my_settings.html +%%DATADIR%%/templates/default/popup.html +%%DATADIR%%/templates/default/tpl_footer.html +%%DATADIR%%/templates/default/tpl_header.html +@dirrm %%DATADIR%%/templates/default/images +@dirrm %%DATADIR%%/templates/default/gui +@dirrm %%DATADIR%%/templates/default +@dirrm %%DATADIR%%/templates +@dirrm %%DATADIR%%/lists +@dirrm %%DATADIR%% +@dirrm %%SITE_PERL%%/AmphetaDesk/XML +@dirrm %%SITE_PERL%%/AmphetaDesk/Text/Template +@dirrm %%SITE_PERL%%/AmphetaDesk/Text +@dirrm %%SITE_PERL%%/AmphetaDesk/AmphetaDesk/OS +@dirrm %%SITE_PERL%%/AmphetaDesk/AmphetaDesk +@dirrm %%SITE_PERL%%/AmphetaDesk +@unexec rmdir %D/%%SITE_PERL%% 2>/dev/null || true +@unexec rmdir %D/lib/perl5/site_perl 2>/dev/null || true +@unexec rmdir %D/lib/perl5 2>/dev/null || true |