Created
April 25, 2017 23:33
-
-
Save lihanli/03ec8f17a6a1ff52e3a149be4cf7f2ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class PkgExtract < CurlDownloadStrategy | |
def stage | |
safe_system '/usr/bin/xar', '-xf', @tarball_path | |
chdir | |
safe_system 'mv *.pkg/Payload Payload.gz' | |
safe_system 'ls | grep -v Payload | xargs rm -r' | |
end | |
end | |
class Pdftk < Formula | |
homepage 'http://www.pdflabs.com/tools/pdftk-server' | |
url 'https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg', | |
:using => PkgExtract | |
sha256 'c33cf95151e477953cd57c1ea9c99ebdc29d75f4c9af0d5f947b385995750b0c' | |
depends_on :macos => :lion | |
def install | |
safe_system "pax --insecure -rz -f Payload.gz -s ',./bin,#{bin},' -s ',./man,#{man},' -s ',./lib,#{lib},' -s ',./license_gpl_pdftk,#{prefix}/LICENSE,' -s ',./,#{prefix}/README/,'" | |
end | |
test do | |
system "#{bin}/pdftk --version" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tarball_path
in line 5 is not available anymore. Works by substitutingcached_location
: