Skip to content

Instantly share code, notes, and snippets.

@dpo
Created March 29, 2012 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpo/2242944 to your computer and use it in GitHub Desktop.
Save dpo/2242944 to your computer and use it in GitHub Desktop.
require 'formula'
class ASLDownloadStrategy < NoUnzipCurlDownloadStrategy
def _fetch
# The Netlib FTP server is picky about the password
# used for anonymous access; an @-terminated string isn't enough.
curl '-u', 'anonymous:stout@homebrew.com', @url,
'--output', @tarball_path
end
def stage
safe_system '/usr/bin/tar', 'xf', @tarball_path
chdir
end
end
class Asl < Formula
url 'ftp://www.netlib.org/ampl/solvers.tar', :using => ASLDownloadStrategy
md5 'f5575ca83e374ba13df9fa8a26ec4b62'
version '20120323'
homepage 'http://www.ampl.com/hooking.html'
def install
system 'make', '-f', 'makefile.u', "CC=#{ENV.cc}", "CFLAGS='-DNON_STIO -I.'"
system 'mv', 'amplsolver.a', 'libasl.a'
lib.install('libasl.a')
(include+'asl').install Dir['*.h']
(include+'asl').install Dir['*.hd']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment