Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Converted phantomjs to automatic package #69

Merged
merged 1 commit into from

2 participants

@TomOne

No description provided.

@ferventcoder ferventcoder merged commit 7a3a87e into ferventcoder:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2014
  1. converted phantomjs to automatic package

    TomOne authored
This page is out of date. Refresh to see the latest.
View
121 PhantomJS/PhantomJS.ketarin.xml
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='utf-8'?>
+<Jobs>
+ <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="f395278b-9890-4834-89bf-7ef2fe4e6f9c">
+ <SourceTemplate><![CDATA[<?xml version="1.0" encoding="utf-8"?>
+<Jobs>
+ <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="0fb30714-8ed0-4611-8f1b-cb8fec9dae91">
+ <WebsiteUrl />
+ <UserAgent>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19</UserAgent>
+ <UserNotes />
+ <LastFileSize>384846</LastFileSize>
+ <LastFileDate>2012-05-23T02:09:37.7748325</LastFileDate>
+ <IgnoreFileInformation>false</IgnoreFileInformation>
+ <DownloadBeta>Default</DownloadBeta>
+ <DownloadDate xsi:nil="true" />
+ <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
+ <VariableChangeIndicator />
+ <CanBeShared>true</CanBeShared>
+ <ShareApplication>false</ShareApplication>
+ <ExclusiveDownload>false</ExclusiveDownload>
+ <HttpReferer />
+ <SetupInstructions />
+ <Variables>
+ <item>
+ <key>
+ <string>version</string>
+ </key>
+ <value>
+ <UrlVariable>
+ <RegexRightToLeft>false</RegexRightToLeft>
+ <VariableType>StartEnd</VariableType>
+ <Regex />
+ <Url><placeholder name="Url with version information" value="http://phantomjs.org/download.html" /></Url>
+ <StartText>&lt;TABLE cellspacing ="1" cellpadding ="6" border = "0"&gt;
+ &lt;TR&gt;
+ &lt;TH class="Title" align="center" width=90&gt;7-Zip </StartText>
+ <EndText>&lt;BR&gt;</EndText>
+ <TextualContent />
+ <Name>version</Name>
+ </UrlVariable>
+ </value>
+ </item>
+ <item>
+ <key>
+ <string>url64</string>
+ </key>
+ <value>
+ <UrlVariable>
+ <RegexRightToLeft>false</RegexRightToLeft>
+ <VariableType>Textual</VariableType>
+ <Regex />
+ <TextualContent>""</TextualContent>
+ <Name>url64</Name>
+ </UrlVariable>
+ </value>
+ </item>
+ </Variables>
+ <ExecuteCommand />
+ <ExecutePreCommand />
+ <ExecuteCommandType>Batch</ExecuteCommandType>
+ <ExecutePreCommandType>Batch</ExecutePreCommandType>
+ <Category />
+ <SourceType>FixedUrl</SourceType>
+ <DeletePreviousFile>true</DeletePreviousFile>
+ <Enabled>true</Enabled>
+ <FileHippoId />
+ <LastUpdated>2012-05-23T02:09:37.7748325</LastUpdated>
+ <TargetPath>C:\Chocolatey\_work\</TargetPath>
+ <FixedDownloadUrl><placeholder name="Download Url - Optional" value="https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-{version}-windows.zip" /></FixedDownloadUrl>
+ <Name><placeholder name="Name" value="PhantomJS" /></Name>
+ </ApplicationJob>
+</Jobs>]]></SourceTemplate>
+ <WebsiteUrl />
+ <UserAgent>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19</UserAgent>
+ <UserNotes />
+ <LastFileSize>6987189</LastFileSize>
+ <LastFileDate>2014-01-27T18:29:49+01:00</LastFileDate>
+ <IgnoreFileInformation>false</IgnoreFileInformation>
+ <DownloadBeta>Default</DownloadBeta>
+ <DownloadDate xsi:nil="true" />
+ <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
+ <VariableChangeIndicator />
+ <CanBeShared>true</CanBeShared>
+ <ShareApplication>false</ShareApplication>
+ <ExclusiveDownload>false</ExclusiveDownload>
+ <HttpReferer />
+ <SetupInstructions />
+ <Variables>
+ <item>
+ <key>
+ <string>version</string>
+ </key>
+ <value>
+ <UrlVariable>
+ <RegexRightToLeft>false</RegexRightToLeft>
+ <VariableType>StartEnd</VariableType>
+ <Regex />
+ <Url>http://phantomjs.org/download.html</Url>
+ <StartText>windows.zip"&gt;phantomjs-</StartText>
+ <EndText>-windows.zip</EndText>
+ <TextualContent />
+ <Name>version</Name>
+ </UrlVariable>
+ </value>
+ </item>
+ </Variables>
+ <ExecuteCommand />
+ <ExecutePreCommand />
+ <ExecuteCommandType>Batch</ExecuteCommandType>
+ <ExecutePreCommandType>Batch</ExecutePreCommandType>
+ <Category />
+ <SourceType>FixedUrl</SourceType>
+ <PreviousLocation>C:\Chocolatey\_work\phantomjs-1.9.7-windows.zip</PreviousLocation>
+ <DeletePreviousFile>true</DeletePreviousFile>
+ <Enabled>true</Enabled>
+ <FileHippoId />
+ <LastUpdated>2014-02-27T23:05:46.7774934+01:00</LastUpdated>
+ <TargetPath>C:\Chocolatey\_work\</TargetPath>
+ <FixedDownloadUrl>https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-{version}-windows.zip</FixedDownloadUrl>
+ <Name>PhantomJS</Name>
+ </ApplicationJob>
+</Jobs>
View
26 PhantomJS/PhantomJS.nuspec
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <metadata>
+ <id>{{PackageName}}</id>
+ <title>PhantomJS</title>
+ <version>{{PackageVersion}}</version>
+ <authors>Ariya Hidayat, PhantomJS Committers</authors>
+ <owners>Ethan Brown, Rob Reynolds</owners>
+ <summary>PhantomJS – Headless WebKit</summary>
+ <description>Full web stack
+No browser required
+
+PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
+PhantomJS is created by Ariya Hidayat.
+ </description>
+ <projectUrl>http://phantomjs.org/</projectUrl>
+ <tags>PhantomJS javascript webkit web browser testing</tags>
+ <licenseUrl>https://github.com/ariya/phantomjs/blob/master/LICENSE.BSD</licenseUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <iconUrl>https://raw.github.com/ferventcoder/chocolateyautomaticpackages/master/PhantomJS/PhantomJS.png</iconUrl>
+ <releaseNotes>https://github.com/ariya/phantomjs/blob/master/ChangeLog</releaseNotes>
+ </metadata>
+ <files>
+ <file src="tools\**" target="tools" />
+ </files>
+</package>
View
35 PhantomJS/tools/Get-BinRoot.ps1
@@ -0,0 +1,35 @@
+function Get-BinRoot {
+
+ # Since CamelCase was decided upon when $env:ChocolateyInstall was first invented, whe should stick to this convention and use $env:ChocolateyBinRoot.
+ # I propose:
+ # 1) all occurances of $env:chocolatey_bin_root be replaced with $env:ChocolateyBinRoot;
+ # 2) Make the new Chocolatey Installer for new users explicitly set (if not exists) $env:ChocolateyInstall and $env:ChocolateyBinRoot as environment variables so users will smile and understand;
+ # 3) Make new Chocolatey convert old $env:chocolatey_bin_root to $env:ChocolateyBinRoot
+
+ # For now, check old var first
+ if($env:ChocolateyBinRoot -eq $null) { # If no value
+ if($env:chocolatey_bin_root -eq $null) { # Try old var
+ $binRoot = "$env:ChocolateyInstall\bin"
+ }
+ else {
+ $env:ChocolateyBinRoot = $env:chocolatey_bin_root
+ }
+ }
+
+ # My ChocolateyBinRoot is C:\Common\bin, but looking at other packages, not everyone assumes ChocolateyBinRoot is prepended with a drive letter.
+ if (-not($env:ChocolateyBinRoot -imatch "^\w:")) {
+ # Add drive letter
+ $binRoot = join-path $env:systemdrive $env:ChocolateyBinRoot
+ }
+ else {
+ $binRoot = $env:ChocolateyBinRoot
+ }
+
+ # Now that we figured out the binRoot, let's store it as per proposal #3 line #7
+ if(-not($env:ChocolateyBinRoot -eq $binRoot)) {
+ [Environment]::SetEnvironmentVariable("ChocolateyBinRoot", "$binRoot", "User")
+ # Note that user variables pose a problem when there are two admins on one computer. But this is what was decided upon.
+ }
+
+ return $binRoot
+}
View
29 PhantomJS/tools/chocolateyInstall.ps1
@@ -0,0 +1,29 @@
+try {
+ $package = '{{PackageName}}'
+ $version = '{{PackageVersion}}'
+
+ $installDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
+ if (!(Get-Command Get-BinRoot -errorAction SilentlyContinue))
+ {
+ Import-Module "$($installDir)\Get-BinRoot.ps1"
+ }
+
+
+ # Get $binRoot until we implement YAML configuration
+ $binRoot = Get-BinRoot
+
+ $installDir = Join-Path $binRoot $package
+ Write-Host "Adding `'$installDir`' to the path and the current shell path"
+ Install-ChocolateyPath "$installDir"
+ $env:Path = "$($env:Path);$installDir"
+ $zipUrl = '{{DownloadUrl}}'
+
+ Install-ChocolateyZipPackage $package "$zipUrl" "$installDir"
+
+ Copy-Item "$($installDir)\phantomjs-$version-windows\*" "$installDir" -Force -Recurse
+
+ Write-ChocolateySuccess $package
+} catch {
+ Write-ChocolateyFailure $package "$($_.Exception.Message)"
+ throw
+}
Something went wrong with that request. Please try again.