bcrypt - use inreplace and optimize CC/CFLAGS
This commit is contained in:
parent
f6cab77e47
commit
fb397833f7
1 changed files with 8 additions and 22 deletions
|
@ -5,29 +5,15 @@ class Bcrypt <Formula
|
|||
homepage 'http://bcrypt.sourceforge.net'
|
||||
md5 '8ce2873836ccd433329c8df0e37e298c'
|
||||
|
||||
def patches
|
||||
DATA
|
||||
end
|
||||
|
||||
def install
|
||||
inreplace "Makefile" do |s|
|
||||
s.change_make_var! "CC", ENV.cc
|
||||
s.change_make_var! "CFLAGS", ENV['CFLAGS']
|
||||
s.change_make_var! "LDFLAGS", "-lz"
|
||||
end
|
||||
|
||||
system "make"
|
||||
system "make install"
|
||||
bin.install "bcrypt"
|
||||
man1.install gzip("bcrypt.1")
|
||||
end
|
||||
|
||||
end
|
||||
__END__
|
||||
diff --git a/Makefile b/Makefile
|
||||
index b84da0f..96d07e2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -3,8 +3,8 @@ CC = gcc
|
||||
CFLAGS = -O2 -Wall
|
||||
COMPILE = ${CC} ${CFLAGS}
|
||||
OBJS = main.o blowfish.o rwfile.o keys.o wrapbf.o endian.o wrapzl.o
|
||||
-LDFLAGS = -L/usr/local/lib -lz
|
||||
-PREFIX = /usr/local
|
||||
+LDFLAGS = -L`brew --prefix`/lib -lz
|
||||
+PREFIX = `brew --prefix`/Cellar/bcrypt/1.1
|
||||
|
||||
bcrypt: ${OBJS} Makefile
|
||||
${COMPILE} -o bcrypt ${OBJS} ${LDFLAGS}
|
||||
|
|
Loading…
Reference in a new issue