diff --git a/README.md b/README.md index 2117bbebb6..07548f8955 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +# Chocolatey Packages + +~~~ + + +[![](https://ci.appveyor.com/api/projects/status/9ipva7kgjigug2rn?svg=true)](https://ci.appveyor.com/project/YOUR_GITHUB_USERNAME_HERE/chocolatey-packages) +[Update status](https://gist.github.com/YOUR_GITHUB_USERNAME_HERE/YOUR_GIST_ID) + + +~~~ + ## Chocolatey Packages Template This contains Chocolatey packages, both manually and automatically maintained. @@ -29,13 +40,17 @@ For setting up your own automatic package repository, please see [Automatic Pack #### AU -* PowerShell v3+. +* PowerShell v4+. It will be v3+ once [au #17](https://github.com/majkinetor/au/issues/17) is implemented. * The [AU module](https://chocolatey.org/packages/au). * Ruby (and the gist gem) for publishing GitHub Gists. ### Getting started -1. Head into the `setup` folder and perform the proper steps for your choice of setup. +1. Fork this repository and rename it to `chocolatey-packages` (on GitHub - go into Settings, Repository name and rename). +1. Clone the repository locally. +1. Head into the `setup` folder and perform the proper steps for your choice of setup (or both if you plan to use both methods). +1. Edit this README. Update the badges at the top. + ### Recommendation on Auto Packaging diff --git a/appveyor.yml b/appveyor.yml index f080a58373..01f9f4692f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,10 +16,10 @@ environment: au_force: false # Github credentials - used to save result to gist and to commit pushed packages to the git repository - github_user: YOUR_USER_NAME_HERE + github_user: YOUR_GITHUB_USERNAME_HERE github_pass: secure: YOUR_PASSWORD_OR_2FA_AUTH_TOKEN_HERE_ENCRYPTED_STRING #https://ci.appveyor.com/tools/encrypt - github_user_repo: 'YOUR_REPO_USERNAME/YOUR_REPO_REPOSITORY_NAME' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template' + github_user_repo: 'YOUR_GITHUB_USERNAME_HERE/chocolatey-packages' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template' # Email credentials - for error notifications mail_user: YOUR_EMAIL_ACCOUNT diff --git a/au/New-Package.ps1 b/au/New-Package.ps1 deleted file mode 100644 index e65778ca7c..0000000000 --- a/au/New-Package.ps1 +++ /dev/null @@ -1,57 +0,0 @@ -param($Name, $Type) - -<# -.SYNOPSIS - Create a new package from the template - -.DESCRIPTION - This function creates a new package by using the directory _template which contains desired package basic settings. -#> -function New-Package{ - [CmdletBinding()] - param( - #Package name - [string] $Name, - - #Type of the package - [ValidateSet('Portable', 'Installer')] - [string] $Type='Installer', - - #Github repository in the form username/repository - [string] $GithubRepository - ) - - if ($Name -eq $null) { throw "Name can't be empty" } - if (Test-Path $Name) { throw "Package with that name already exists" } - if (!(Test-Path _template)) { throw "Template for the packages not found" } - cp _template $Name -Recurse - - $nuspec = gc "$Name\template.nuspec" - rm "$Name\template.nuspec" - - Write-Verbose 'Fixing nuspec' - $nuspec = $nuspec -replace '.+', "$Name" - $nuspec = $nuspec -replace '.+', "https://cdn.rawgit.com/$GithubRepository/master/$Name/icon.png" - $nuspec = $nuspec -replace '.+', "https://github.com/$GithubRepository/tree/master/$Name" - $nuspec | Out-File -Encoding UTF8 "$Name\$Name.nuspec" - - switch ($Type) - { - 'Installer' { - Write-Verbose 'Using installer template' - rm "$Name\tools\chocolateyInstallZip.ps1" - mv "$Name\tools\chocolateyInstallExe.ps1" "$Name\tools\chocolateyInstall.ps1" - } - 'Portable' { - Write-Verbose 'Using portable template' - rm "$Name\tools\chocolateyInstallExe.ps1" - mv "$Name\tools\chocolateyInstallZip.ps1" "$Name\tools\chocolateyInstall.ps1" - } - } - - Write-Verbose 'Fixing chocolateyInstall.ps1' - $installer = gc "$Name\tools\chocolateyInstall.ps1" - $installer -replace "(^[$]packageName\s*=\s*)('.*')", "`$1'$($Name)'" | sc "$Name\tools\chocolateyInstall.ps1" -} - -New-Package $Name $Type -GithubRepository majkinetor/chocolatey -Verbose diff --git a/automatic/html-tidy/html-tidy.nuspec b/automatic/html-tidy/html-tidy.nuspec new file mode 100644 index 0000000000..67ed1c6b2a --- /dev/null +++ b/automatic/html-tidy/html-tidy.nuspec @@ -0,0 +1,32 @@ + + + + + + html-tidy + HTML Tidy with HTML5 support + 5.2.0.20160708 + HTACG + Miodrag Milić + Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards + +Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards. + + http://www.html-tidy.org/ + x-platform xml html tidy html5 + HTACG + https://github.com/htacg/tidy-html5/blob/master/README/LICENSE.md + false + + + http://www.html-tidy.org/documentation + https://github.com/htacg/tidy-html5/issues + https://github.com/htacg/tidy-html5 + https://github.com/majkinetor/chocolatey/tree/master/html-tidy + + + + + diff --git a/automatic/html-tidy/tools/chocolateyInstall.ps1 b/automatic/html-tidy/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000000..36b1cfaa70 --- /dev/null +++ b/automatic/html-tidy/tools/chocolateyInstall.ps1 @@ -0,0 +1,19 @@ +$ErrorActionPreference = 'Stop' + +$packageName = 'html-tidy' +$url32 = 'https://github.com/htacg/tidy-html5/releases/download/5.2.0/tidy-5.2.0-win32.zip' +$url64 = 'https://github.com/htacg/tidy-html5/releases/download/5.2.0/tidy-5.2.0-win64.zip' +$checksum32 = '94D653498B4F93B14F12A55CA06154E19C540C9B276E5D163F1CF84FA078F97A' +$checksum64 = 'DD9FD814CC44BC2FFA9B9E547B1A6CBB42B6BE7B9358542D3EE7F6E10B676423' + +$packageArgs = @{ + packageName = $packageName + url = $url32 + url64Bit = $url64 + checksum = $checksum32 + checksum64 = $checksum64 + checksumType = 'sha256' + checksumType64 = 'sha256' + unzipLocation = Split-Path $MyInvocation.MyCommand.Definition +} +Install-ChocolateyZipPackage @packageArgs diff --git a/automatic/html-tidy/update.ps1 b/automatic/html-tidy/update.ps1 new file mode 100644 index 0000000000..c85905b21a --- /dev/null +++ b/automatic/html-tidy/update.ps1 @@ -0,0 +1,31 @@ +import-module au + +$releases = 'https://github.com/htacg/tidy-html5/releases' + +function global:au_SearchReplace { + @{ + 'tools\chocolateyInstall.ps1' = @{ + "(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'" + "(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'" + "(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'" + "(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'" + } + } +} + +function global:au_GetLatest { + $download_page = Invoke-WebRequest -Uri $releases + + #tidy-5.1.25-win64.zip + $re = "tidy-.+-win(32|64).zip" + $url = $download_page.links | ? href -match $re | select -First 2 -expand href + + $version = $url[0] -split '-' | select -Last 1 -Skip 1 + $url32 = 'https://github.com' + $url[0] + $url64 = 'https://github.com' + $url[1] + + $Latest = @{ URL32 = $url32; URL64 = $url64; Version = $version } + return $Latest +} + +update diff --git a/automatic/nexus-oss/nexus-oss.nuspec b/automatic/nexus-oss/nexus-oss.nuspec new file mode 100644 index 0000000000..554a2a6bc6 --- /dev/null +++ b/automatic/nexus-oss/nexus-oss.nuspec @@ -0,0 +1,41 @@ + + + + + + nexus-oss + Nexus Repository Manager OSS + 2.12.0 + Sonatype + Miodrag Milić + Repository to manage software components required for development, deployment, and provisioning + Nexus Repository Manager OSS manage software components required for development, deployment, and provisioning. If you develop software, the repository manager can help you share those components with other developers and end users. It greatly simplifies the maintenance of your own internal repositories and access to external repositories. With Nexus Repository Manager and Nexus Repository Manager OSS you can completely control access to, and deployment of, every component in your organization from a single location. + +### Package + +Package installer will install the nexus and start the service. The following parameters are available: + +* `/InstallDir` +Installation directory, by default `/InstallDir: c:\nexus` + +![screenshot](https://cdn.rawgit.com/majkinetor/chocolatey/master/nexus-oss/screenshot.png) + + http://www.sonatype.org/nexus/ + admin repository maven nuget docker package + Sonatype + https://www.eclipse.org/legal/epl-v10.html + false + https://cdn.rawgit.com/majkinetor/chocolatey/master/nexus-oss/icon.png + + + + https://support.sonatype.com/hc/en-us/articles/213464368-Sonatype-Nexus-Release-Notes-Index + https://books.sonatype.com/nexus-book/reference/index.html + https://goo.gl/292OFI + https://github.com/sonatype/nexus-public + https://github.com/majkinetor/chocolatey/tree/master/nexus-oss + + + + + diff --git a/automatic/nexus-oss/screenshot.png b/automatic/nexus-oss/screenshot.png new file mode 100644 index 0000000000..b79f34bf70 Binary files /dev/null and b/automatic/nexus-oss/screenshot.png differ diff --git a/automatic/nexus-oss/tools/chocolateyInstall.ps1 b/automatic/nexus-oss/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000000..0bceb6d0e6 --- /dev/null +++ b/automatic/nexus-oss/tools/chocolateyInstall.ps1 @@ -0,0 +1,55 @@ +$ErrorActionPreference = 'Stop' + +$packageName = 'nexus-oss' +$url = 'https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.13.0-01-bundle.zip' +$checksum = '76E2A2904FF0341A5FB646F615E3724F6C54E8A71759A7F8F06F702339D0767B' +$installDir = 'c:\nexus' + +$packageArgs = @{ + packageName = $packageName + url = $url + url64Bit = $url #url includes both 32-bit and 64-bit + checksum = $checksum + checksum64 = $checksum + checksumType = 'sha256' + checksumType64 = 'sha256' + unzipLocation = $installDir +} + +if ($Env:ChocolateyPackageParameters -match '/InstallDir:\s*(.+)') { + $installDir = $Matches[1] + if ($installDir.StartsWith("'") -or $installDir.StartsWith('"')){ $installDir = $installDir -replace '^.|.$' } + $parent = Split-Path $installDir + mkdir -force $parent -ea 0 | out-null +} + +if (gcm nexus -ea 0) { + Write-Host "Detected existing installation, uninstalling service" + 0 | nexus stop + 0 | nexus uninstall +} + +Write-Host "Installing to '$installDir'" +Install-ChocolateyZipPackage @packageArgs + +$nexusDir = ls $installDir\nexus-* | sort -Descending | select -First 1 +$nexus = "$nexusDir\bin\nexus.bat" +if (!(Test-Path $nexus)) { throw "Can not find nexus.bat" } +Install-BinFile nexus $nexus + +0 | nexus install +0 | nexus start + +$s = gsv nexus-webapp -ea 0 +if (!$s) { throw "Nexus service 'nexus-webapp' is not installed" } +if ($s.Status -ne 'Running') { Write-Warning "Nexus service 'nexus-webapp' is installed but not running" } + +$ok = $false +try { + $request = [System.Net.HttpWebRequest]::Create("http://localhost:8081/nexus") + $response = $request.GetResponse() + $ok = $response.StatusCode -eq 'OK' +} catch {} + +if (!$ok) { Write-Warning "Nexus should be available at http://localhost:8081/nexus but can't be reached" } +else { Write-Host "Nexus is available at http://localhost:8081/nexus" } diff --git a/automatic/nexus-oss/update.ps1 b/automatic/nexus-oss/update.ps1 new file mode 100644 index 0000000000..c4d1ddd580 --- /dev/null +++ b/automatic/nexus-oss/update.ps1 @@ -0,0 +1,29 @@ +import-module au + +$url = 'http://www.sonatype.org/downloads/nexus-latest-bundle.zip' + +function global:au_SearchReplace { + @{ + 'tools\chocolateyInstall.ps1' = @{ + "(^[$]url\s*=\s*)('.*')" = "`$1'$($Latest.URL)'" + "(^[$]checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'" + } + } +} + +function global:au_GetLatest { + while($true) { + $request = [System.Net.WebRequest]::Create($url) + $request.AllowAutoRedirect=$false + $response=$request.GetResponse() + $location = $response.GetResponseHeader('Location') + if (!$location -or ($location -eq $url)) { break } + $url = $location + } + + $version = ($url -split '-|\.' | select -Last 4 -skip 2) -join '.' + $Latest = @{ URL = $url; Version = $version } + return $Latest +} + +update -NoCheckUrl -ChecksumFor 32 diff --git a/icons/nexus-oss.png b/icons/nexus-oss.png new file mode 100644 index 0000000000..1fea371a68 Binary files /dev/null and b/icons/nexus-oss.png differ diff --git a/setup/au_setup.ps1 b/setup/au_setup.ps1 index d57ee55e0b..69af9165ec 100644 --- a/setup/au_setup.ps1 +++ b/setup/au_setup.ps1 @@ -11,9 +11,9 @@ `$env:au_force = 'false' # Github credentials - used to save result to gist and to commit pushed packages to the git repository -`$env:github_user = 'YOUR_USER_NAME_HERE' +`$env:github_user = 'YOUR_GITHUB_USERNAME_HERE' `$env:github_pass = 'YOUR_PASSWORD_OR_2FA_AUTH_TOKEN_HERE' -`$env:github_user_repo= 'username/repository' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template' +`$env:github_user_repo= 'YOUR_GITHUB_USERNAME_HERE/chocolatey-packages' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template' # Email credentials - for error notifications `$env:mail_user = 'YOUR_EMAIL_ACCOUNT'