libnids: use new dsl
This commit is contained in:
parent
8145014720
commit
83c906fabb
1 changed files with 8 additions and 20 deletions
|
@ -1,33 +1,21 @@
|
||||||
require 'formula'
|
require 'formula'
|
||||||
|
|
||||||
def use_libnet?
|
|
||||||
not ARGV.include? '--disable-libnet'
|
|
||||||
end
|
|
||||||
|
|
||||||
def use_glib?
|
|
||||||
not ARGV.include? '--disable-libglib'
|
|
||||||
end
|
|
||||||
|
|
||||||
class Libnids < Formula
|
class Libnids < Formula
|
||||||
url 'http://downloads.sourceforge.net/project/libnids/libnids/1.24/libnids-1.24.tar.gz'
|
|
||||||
homepage 'http://libnids.sourceforge.net/'
|
homepage 'http://libnids.sourceforge.net/'
|
||||||
|
url 'http://downloads.sourceforge.net/project/libnids/libnids/1.24/libnids-1.24.tar.gz'
|
||||||
md5 '72d37c79c85615ffe158aa524d649610'
|
md5 '72d37c79c85615ffe158aa524d649610'
|
||||||
|
|
||||||
depends_on 'libnet' if use_libnet?
|
option "disable-libnet", "Don't include code requiring libnet"
|
||||||
depends_on 'glib' if use_glib?
|
option "disable-libglib", "Don't use glib2 for multiprocessing support"
|
||||||
depends_on 'pkg-config' => :build
|
|
||||||
|
|
||||||
def options
|
depends_on 'pkg-config' => :build
|
||||||
[
|
depends_on 'libnet' => :recommended unless build.include? "disable-libnet"
|
||||||
["--disable-libnet", "Don't include code requiring libnet"],
|
depends_on 'glib' => :recommended unless build.include? "disable-libglib"
|
||||||
["--disable-libglib", "Don't use glib2 for multiprocessing support"]
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
def install
|
||||||
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
||||||
args << "--disable-libnet" unless use_libnet?
|
args << "--disable-libnet" if build.include? "disable-libnet"
|
||||||
args << "--disable-libglib" unless use_glib?
|
args << "--disable-libglib" if build.include? "disable-libglib"
|
||||||
|
|
||||||
system "./configure", *args
|
system "./configure", *args
|
||||||
system "make install"
|
system "make install"
|
||||||
|
|
Loading…
Reference in a new issue