# $Id: exec-clean.pl,v 1.6 2002/07/04 13:18:02 jylefort Exp $ use Irssi 20020121.2020 (); $VERSION = "1.01"; %IRSSI = ( authors => 'Jean-Yves Lefort', contact => 'jylefort\@brutele.be, decadix on IRCNet', name => 'exec-clean', description => 'Adds a setting to automatically terminate a process whose parent window has been closed', license => 'BSD', url => 'http://void.adminz.be/irssi.shtml', changed => '$Date: 2002/07/04 13:18:02 $ ', ); # /set's: # # autokill_orphan_processes # # guess :) # # changes: # # 2002-07-04 release 1.01 # * signal_add's uses a reference instead of a string # # 2002-04-25 release 1.00 # * increased version number # # 2002-01-28 initial release # # todo: # # * kill the process using a better method (TERM -> sleep -> KILL etc) use strict; use Irssi::UI; sub window_destroyed { my ($window) = @_; foreach (Irssi::UI::processes()) { if ($_->{target_win}->{refnum} == $window->{refnum} && Irssi::settings_get_bool("autokill_orphan_processes")) { kill 15, $_->{pid}; return; } } } Irssi::signal_add("window destroyed", \&window_destroyed); Irssi::settings_add_bool("misc", "autokill_orphan_processes", 1); out/'>aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/psutils.rb
blob: da661b843985fb9dac6311dccabf12787056fff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'formula'

class Psutils < Formula
  homepage 'http://knackered.org/angus/psutils/'
  url 'ftp://ftp.knackered.org/pub/psutils/psutils-p17.tar.gz'
  version 'p17'
  sha1 '6f1ecb5846cffb644826a02bd9153fe5d6387a9b'

  def install
    man1.mkpath # This is required, because the makefile expects that its man folder exists
    system "make", "-f", "Makefile.unix",
                         "PERL=/usr/bin/perl",
                         "BINDIR=#{bin}",
                         "INCLUDEDIR=#{share}/psutils",
                         "MANDIR=#{man1}",
                         "install"
  end

  test do
    system "sh -c '#{bin}/showchar Palatino B > test.ps'"
    system "#{bin}/psmerge", "-omulti.ps", "test.ps", "test.ps", "test.ps", "test.ps"
    system "#{bin}/psnup", "-n", "2", "multi.ps", "nup.ps"
    system "#{bin}/psselect", "-p1", "multi.ps", "test2.ps"
  end
end