Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active April 11, 2016 16:10
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 stefanschmidt/7474bb19eb4ae682ffc6efb857825bad to your computer and use it in GitHub Desktop.
Save stefanschmidt/7474bb19eb4ae682ffc6efb857825bad to your computer and use it in GitHub Desktop.
PDFtk Homebrew formula for OS X 10.10 Yosemite
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
sha1 '68361f759a658636a3d147504d90197c688bf209'
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