diff --git a/Makefile b/Makefile index 4aa77c967..48f250250 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ configure: .PHONY: aws-ec2 aws-ec2: ./aws_gen.native --is-ec2 -i input/ec2/latest/service-2.json -r input/ec2/overrides.json -e input/errors.json -o libraries - cd libraries/ec2 && oasis setup && bash ../../src/mk_opam + cd libraries/ec2 && oasis setup && bash ../../scripts/mk_opam # NOTE: This does not include aws-ec2, which is special-cased. LIBRARIES := \ @@ -60,7 +60,7 @@ LIBRARIES := \ .PHONY: $(LIBRARIES) $(LIBRARIES): aws-%: ./aws_gen.native -i input/$*/latest/service-2.json -r input/$*/overrides.json -e input/errors.json -o libraries - cd libraries/$* && oasis setup && bash ../../src/mk_opam + cd libraries/$* && oasis setup && bash ../../scripts/mk_opam gen: all aws-ec2 $(LIBRARIES) diff --git a/libraries/autoscaling/opam/opam b/libraries/autoscaling/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/autoscaling/opam/opam +++ b/libraries/autoscaling/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/cloudformation/opam/opam b/libraries/cloudformation/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/cloudformation/opam/opam +++ b/libraries/cloudformation/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/cloudtrail/opam/opam b/libraries/cloudtrail/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/cloudtrail/opam/opam +++ b/libraries/cloudtrail/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/ec2/opam/opam b/libraries/ec2/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/ec2/opam/opam +++ b/libraries/ec2/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/elasticache/opam/opam b/libraries/elasticache/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/elasticache/opam/opam +++ b/libraries/elasticache/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/elasticloadbalancing/opam/opam b/libraries/elasticloadbalancing/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/elasticloadbalancing/opam/opam +++ b/libraries/elasticloadbalancing/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/rds/opam/opam b/libraries/rds/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/rds/opam/opam +++ b/libraries/rds/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/sdb/opam/opam b/libraries/sdb/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/sdb/opam/opam +++ b/libraries/sdb/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/ssm/opam/opam b/libraries/ssm/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/ssm/opam/opam +++ b/libraries/ssm/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/sts/opam/opam b/libraries/sts/opam/opam index 010ed45be..ae0b11407 100644 --- a/libraries/sts/opam/opam +++ b/libraries/sts/opam/opam @@ -1,8 +1,9 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/opam/opam b/opam/opam index 6bc8f92ae..a9ba20b02 100644 --- a/opam/opam +++ b/opam/opam @@ -4,6 +4,7 @@ authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix diff --git a/src/mk_opam b/scripts/mk_opam similarity index 85% rename from src/mk_opam rename to scripts/mk_opam index d047cb3f3..ebdff1a56 100644 --- a/src/mk_opam +++ b/scripts/mk_opam @@ -3,9 +3,10 @@ mkdir -p opam cat < opam/opam opam-version: "1.2" maintainer: "$(oasis query maintainers)" -authors: [ $(oasis query authors | sed 's/, /", "/') ] +authors: [ "$(oasis query authors | sed 's/, /" "/')" ] license: "$(oasis query license)" homepage: "$(oasis query homepage)" +dev-repo: "$(oasis query homepage).git" bug-reports: "$(oasis query homepage)/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/scripts/publish b/scripts/publish new file mode 100755 index 000000000..84f1cf7e5 --- /dev/null +++ b/scripts/publish @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# Copyright (c) 2016 Inhabited Type LLC. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the author nor the names of his contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +AWS_RELEASE=aws-$(oasis query version) + +function publish() +{ + local service=$(oasis query name) + local version=$(oasis query version) + local release=$service-${version} + local uri="https://github.com/inhabitedtype/ocaml-aws/releases/download/$AWS_RELEASE/$release.tar.gz" + echo "== $release" + local dir=${release/-/.} + mkdir -p $dir + cp -r opam/* $dir + rm $dir/findlib + echo "archive:\"$uri\"" > $dir/url + echo "checksum:\"$(curl -L $uri | md5)\"" >> $dir/url + opam publish submit --name=seliopou $dir +} + +function publish_libs() { + for lib in $(ls libraries); do + if [[ -d libraries/$lib ]]; then + pushd libraries/$lib > /dev/null + publish + popd > /dev/null + fi + done +} + +case $1 in + "top") publish;; + "libs") publish_libs;; + *) echo "usage: publish [top|libs]"; exit 1;; +esac diff --git a/release b/scripts/release similarity index 87% rename from release rename to scripts/release index bda1ae76a..3cf501ee1 100755 --- a/release +++ b/scripts/release @@ -30,19 +30,21 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +AWS_RELEASE=aws-$(oasis query version) + function release_service() { local service=$(oasis query name) local version=$(oasis query version) local release=$service-${version} - local aws_release=$1 + local AWS_RELEASE=$1 echo "== $release" make distclean > /dev/null - rm ${release}.tar.gz + rm -f *.tar.gz ln -s . $release tar czf ${release}.tar.gz --exclude=${release}/${release} ${release}/* rm ${release} if [[ -n ${COOKIE_JAR+x} ]]; then - git upload-release -c ${COOKIE_JAR} inhabitedtype ocaml-aws ${aws_release} ${release}.tar.gz + git upload-release -c ${COOKIE_JAR} inhabitedtype ocaml-aws ${AWS_RELEASE} ${release}.tar.gz fi } @@ -51,7 +53,7 @@ function release_top() { local release=aws-${version} echo "== $release" make distclean > /dev/null - rm ${release}.tar.gz + rm -f *.tar.gz ln -s . $release tar czf ${release}.tar.gz --exclude=libraries/** --exclude=input/** --exclude=.git/** --exclude=${release}/${release} ${release}/* rm ${release} @@ -60,16 +62,19 @@ function release_top() { fi } -function release() { - release_top - local aws_release=aws-$(oasis query version) +function release_libs() { for lib in $(ls libraries); do if [[ -d libraries/$lib ]]; then pushd libraries/$lib > /dev/null - release_service $aws_release + release_service $AWS_RELEASE popd > /dev/null fi done } -release +case $1 in + "top") release_top;; + "libs") release_libs;; + "all") release_top; release_libs;; + *) echo "usage: release [top|libs|all]"; exit 1;; +esac