example_formula: document pkgshare

This commit is contained in:
Dominyk Tiller 2015-08-12 16:09:24 +01:00
parent bb4237a230
commit 250e975645

View File

@ -326,16 +326,17 @@ class ExampleFormula < Formula
# Need to install into the bin but the makefile doesn't mkdir -p prefix/bin? # Need to install into the bin but the makefile doesn't mkdir -p prefix/bin?
bin.mkpath bin.mkpath
# A custom directory? # Need a custom directory?
mkdir_p share/"example" (share/"concept").mkpath
# And then move something from the buildpath to that directory? # Installing something into another custom directory?
mv "ducks.txt", share/"example/ducks.txt" (share/"concept2").install "ducks.txt"
# No "make", "install" available? # No "make", "install" available?
bin.install "binary1" bin.install "binary1"
include.install "example.h" include.install "example.h"
lib.install "example.dylib" lib.install "example.dylib"
man1.install "example.1" man1.install "example.1"
man3.install "example.3" man3.install "example.3"
pkgshare.install "examples"
# Maybe you'd like to remove a broken or unnecessary element? # Maybe you'd like to remove a broken or unnecessary element?
# Empty directories will be removed by Homebrew automatically post-install! # Empty directories will be removed by Homebrew automatically post-install!
rm "bin/example" rm "bin/example"
@ -371,6 +372,7 @@ class ExampleFormula < Formula
man8 # man+"man8" man8 # man+"man8"
sbin # prefix+"sbin" sbin # prefix+"sbin"
share # prefix+"share" share # prefix+"share"
pkgshare # prefix+"share"+name
frameworks # prefix+"Frameworks" frameworks # prefix+"Frameworks"
kext_prefix # prefix+"Library/Extensions" kext_prefix # prefix+"Library/Extensions"
# Configuration stuff that will survive formula updates # Configuration stuff that will survive formula updates
@ -397,8 +399,9 @@ class ExampleFormula < Formula
## Caveats ## Caveats
def caveats def caveats; <<-EOS.undent
"Are optional. Something the user should know?" Are optional. Something the user should know?
EOS
end end
def caveats def caveats
@ -411,7 +414,7 @@ class ExampleFormula < Formula
s s
end end
## Test (is optional but makes us happy) ## Test (is required for new formula & makes us happy)
test do test do
# `test do` will create, run in, and delete a temporary directory. # `test do` will create, run in, and delete a temporary directory.
@ -459,7 +462,7 @@ class ExampleFormula < Formula
<string>#{plist_name}</string> <string>#{plist_name}</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>#{bin}/example</string> <string>#{opt_bin}/example</string>
<string>--do-this</string> <string>--do-this</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>