2012-09-11 12:37:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Inspircd < Formula
|
2013-11-20 16:07:26 +00:00
|
|
|
homepage 'http://www.inspircd.org'
|
2014-04-04 21:04:53 +00:00
|
|
|
url 'https://github.com/inspircd/inspircd/archive/v2.0.16.tar.gz'
|
2014-04-25 12:42:45 +00:00
|
|
|
sha1 '5ea8e81124dc933ba289a4eb5782a66874e5d7e4'
|
|
|
|
revision 1
|
2012-09-11 12:37:05 +00:00
|
|
|
|
2013-11-20 16:07:26 +00:00
|
|
|
head 'https://github.com/inspircd/inspircd.git'
|
2012-09-11 12:37:05 +00:00
|
|
|
|
2013-02-16 13:56:45 +00:00
|
|
|
skip_clean 'data'
|
|
|
|
skip_clean 'logs'
|
|
|
|
|
2012-09-11 12:37:05 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2013-02-16 13:56:45 +00:00
|
|
|
depends_on 'geoip' => :optional
|
|
|
|
depends_on 'gnutls' => :optional
|
|
|
|
depends_on 'libgcrypt' if build.with? 'gnutls'
|
|
|
|
depends_on :mysql => :optional
|
2013-01-26 23:21:48 +00:00
|
|
|
depends_on 'pcre' => :optional
|
2013-11-20 16:07:26 +00:00
|
|
|
depends_on 'postgresql' => :optional
|
2013-02-16 13:56:45 +00:00
|
|
|
depends_on 'sqlite' => :optional
|
2013-01-26 23:21:48 +00:00
|
|
|
depends_on 'tre' => :optional
|
2012-09-11 12:37:05 +00:00
|
|
|
|
2013-02-16 13:56:45 +00:00
|
|
|
option 'without-ldap', 'Build without ldap support'
|
|
|
|
option 'without-openssl', 'Build without openssl support'
|
|
|
|
|
2014-04-25 12:42:45 +00:00
|
|
|
# Fix for runtime linker errors when loading modules compiled with LLVM 3.4
|
|
|
|
patch :p1 do
|
|
|
|
url 'https://github.com/inspircd/inspircd/commit/b65fb065b5a77aeea056f88e1b8d96ec8fbea47c.diff'
|
|
|
|
sha1 '13005aa29dd6ee37a30aca805d99789220884c9c'
|
|
|
|
end
|
|
|
|
|
2012-09-11 12:37:05 +00:00
|
|
|
def install
|
|
|
|
modules = []
|
2013-02-16 13:56:45 +00:00
|
|
|
modules << 'm_geoip.cpp' if build.with? 'geoip'
|
|
|
|
modules << 'm_ssl_gnutls.cpp' if build.with? 'gnutls'
|
|
|
|
modules << 'm_mysql.cpp' if build.with? 'mysql'
|
2014-02-25 07:07:13 +00:00
|
|
|
modules << 'm_ssl_openssl.cpp' if build.with? 'openssl'
|
|
|
|
modules << 'm_ldapauth.cpp' if build.with? 'ldap'
|
|
|
|
modules << 'm_ldapoper.cpp' if build.with? 'ldap'
|
2013-01-26 23:21:48 +00:00
|
|
|
modules << 'm_regex_pcre.cpp' if build.with? 'pcre'
|
2013-11-20 16:07:26 +00:00
|
|
|
modules << 'm_pgsql.cpp' if build.with? 'postgresql'
|
2013-02-16 13:56:45 +00:00
|
|
|
modules << 'm_sqlite3.cpp' if build.with? 'sqlite'
|
2013-01-26 23:21:48 +00:00
|
|
|
modules << 'm_regex_tre.cpp' if build.with? 'tre'
|
2012-09-11 12:37:05 +00:00
|
|
|
|
|
|
|
system './configure', "--enable-extras=#{modules.join(',')}" unless modules.empty?
|
|
|
|
system './configure', "--prefix=#{prefix}", "--with-cc=#{ENV.cc}"
|
|
|
|
system 'make install'
|
|
|
|
|
|
|
|
inreplace "#{prefix}/org.inspircd.plist", 'ircdaemon', ENV['USER']
|
|
|
|
end
|
|
|
|
end
|