Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt

stefanschmidt/pdftk.rb

Last active Apr 11, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.