diff options
| author | Cyril Cohen | 2017-10-23 11:24:50 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-23 11:24:50 +0200 |
| commit | f418fee13c770b27f2bf4fbfdfa2a1179596355e (patch) | |
| tree | bf08806f589e8a4857654becd3a5b8704e5d7736 | |
| parent | 78bfdccb61c4ec4bd0efd01c26e68a530b85e890 (diff) | |
| parent | 33477fadfd9533fac08f888527c7ad3083899af2 (diff) | |
Merge pull request #145 from CohenCyril/new-packager
New packager
| -rwxr-xr-x | etc/utils/packager | 101 | ||||
| -rw-r--r-- | mathcomp/algebra/opam | 2 | ||||
| -rw-r--r-- | mathcomp/character/opam | 2 | ||||
| -rw-r--r-- | mathcomp/field/opam | 2 | ||||
| -rw-r--r-- | mathcomp/fingroup/opam | 2 | ||||
| -rw-r--r-- | mathcomp/odd_order/opam | 2 | ||||
| -rw-r--r-- | mathcomp/real_closed/opam | 2 | ||||
| -rw-r--r-- | mathcomp/solvable/opam | 2 | ||||
| -rw-r--r-- | mathcomp/ssreflect/opam | 4 |
9 files changed, 89 insertions, 30 deletions
diff --git a/etc/utils/packager b/etc/utils/packager index f0c1d5b..d0c4b17 100755 --- a/etc/utils/packager +++ b/etc/utils/packager @@ -1,28 +1,87 @@ #!/bin/bash - set -e set -x -for pkg in ssreflect fingroup algebra field solvable character real_closed odd_order -do -pkgdir="$(git root)/opam/extra-dev/packages/coq-mathcomp-$pkg/coq-mathcomp-$pkg.dev" -mkdir -p $pkgdir -cp $(git root)/mathcomp/$pkg/opam $pkgdir/opam -cp $(git root)/mathcomp/$pkg/descr $pkgdir/descr -sed -r "/^(build|install)/s?make?make \"-C\" \"mathcomp/$pkg\"?" -i $pkgdir/opam -echo "git: \"https://github.com/math-comp/math-comp.git\"" > $pkgdir/url -done +if [ -z $1 ] || [ $1 == "--help" ] || [ $1 == "-h" ] +then cat <<EOF +usage : packager VERSION [BRANCH] [TAG]" +- VERSION is the version number of the package to create, we expect + there is a tag named mathcomp-\$VERSION which archive we can + download from github +- BRANCH is the name of a branch where we can find accurate local opam + files. Actually, this may only matter for the Coq version dependencies + located in the ssreflect package. Default value is "mathcomp-\$VERSION" +- TAG is the name of the tag used to build the archive, this is + particularily useful for generating the package for the odd order + theorem if we want to keep it separate from the rest of mathcomp + e.g. "packager 1.6.1 mathcomp-odd-order.1.6.1 mathcomp-odd-order.1.6.1" + Default value is "mathcomp-\$VERSION" +EOF + exit 0 +else +VERSION=$1 +fi + +if [ -z $2 ] +then BRANCH="mathcomp-$VERSION" +else BRANCH=$2 +fi +# verify whether $BRANCH exists +git rev-parse --verify $BRANCH -for pkg in ssreflect fingroup algebra field solvable character odd_order -do -pkgdir="$(git root)/opam/released/packages/coq-mathcomp-$pkg/coq-mathcomp-$pkg.1.6" -mkdir -p $pkgdir -cp $(git root)/mathcomp/$pkg/opam $pkgdir/opam -cp $(git root)/mathcomp/$pkg/descr $pkgdir/descr -sed -r "/^version/s?dev?1.6?" -i $pkgdir/opam -sed -r "/^depends.*coq-mathcomp.*/s?dev?1.6?" -i $pkgdir/opam -sed -r "/^(build|install)/s?make?make \"-C\" \"mathcomp/$pkg\"?" -i $pkgdir/opam -echo "http: \"http://github.com/math-comp/math-comp/archive/mathcomp-1.6.tar.gz\"" > $pkgdir/url -echo "checksum: \"038ba80c0d6b430428726ae4d00affcf\"" >> $pkgdir/url +if [ -z $3 ] +then TAG="mathcomp-$VERSION" +else TAG=$3 +fi +# verify whether $TAG exists +git rev-parse --verify $TAG +ARCHIVEURL="http://github.com/math-comp/math-comp/archive/$TAG.tar.gz" + +# we build the url file content and the list of packages, and where to put them +if [ $VERSION == "dev" ] +then +# variables useful for package construction + URLLINE="git: \"https://github.com/math-comp/math-comp.git\"" + PKGS=$(sed -r "s/.*mathcomp\.([^\.]*)*.*/\1/" $(git root)/mathcomp/all/all.v \ + | paste -sd " " -) + PKGPREFIX="$(git root)/opam/extra-dev/packages" +else + ARCHIVE=$(mktemp) + git archive --format=tgz --output=$ARCHIVE \ + --prefix=math-comp-$TAG/ $TAG # reproduce github archive + SUM=$(md5sum $ARCHIVE | cut -d " " -f 1) + EXTRACTED=$(mktemp -d) + tar -C $EXTRACTED -zxvf $ARCHIVE +# variables useful for package construction + URLLINE="http: \"$ARCHIVEURL\"" + CHECKSUMLINE="checksum: \"$SUM\"" + PKGS=$(ls -fs -d -1 $EXTRACTED/*/mathcomp/*/ \ + | sed -r "s?.*mathcomp/([^/]+)/?\1?" \ + | paste -sd " " -) + PKGPREFIX="$(git root)/opam/released/packages" +fi + +# for each package, we pick the corresponding opam and descr file and +# rewrite them to adapt them to single package construction and +# version numbers +for pkg in $PKGS +do pkgdir="$PKGPREFIX/coq-mathcomp-$pkg/coq-mathcomp-$pkg.$VERSION" + mkdir -p $pkgdir + if [ $VERSION == "dev" ] + then cp $(git root)/mathcomp/$pkg/opam $pkgdir/opam + cp $(git root)/mathcomp/$pkg/descr $pkgdir/descr + else git show "$BRANCH:mathcomp/$pkg/opam" > $pkgdir/opam + git show "$BRANCH:mathcomp/$pkg/descr" > $pkgdir/descr + sed -r "/^version/s?dev?$VERSION?" -i $pkgdir/opam + sed -r "/^depends.*coq-mathcomp.*/s?dev?$VERSION?" -i $pkgdir/opam + fi + sed -r "/^(build|install)/s?make?make \"-C\" \"mathcomp/$pkg\"?" -i $pkgdir/opam + echo $URLLINE > $pkgdir/url + if [ $VERSION != "dev" ] + then echo $CHECKSUMLINE >> $pkgdir/url + fi done + +# finally test the existence of the archive +wget --spider $ARCHIVEURL diff --git a/mathcomp/algebra/opam b/mathcomp/algebra/opam index a94d17b..59dd47d 100644 --- a/mathcomp/algebra/opam +++ b/mathcomp/algebra/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-algebra" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/character/opam b/mathcomp/character/opam index e7dd3fb..3c94411 100644 --- a/mathcomp/character/opam +++ b/mathcomp/character/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-character" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/field/opam b/mathcomp/field/opam index 912eded..cd09358 100644 --- a/mathcomp/field/opam +++ b/mathcomp/field/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-field" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/fingroup/opam b/mathcomp/fingroup/opam index d378e83..a651a0e 100644 --- a/mathcomp/fingroup/opam +++ b/mathcomp/fingroup/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-fingroup" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/odd_order/opam b/mathcomp/odd_order/opam index 5150001..f745e77 100644 --- a/mathcomp/odd_order/opam +++ b/mathcomp/odd_order/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-odd_order" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/real_closed/opam b/mathcomp/real_closed/opam index d06f2e7..52d18b2 100644 --- a/mathcomp/real_closed/opam +++ b/mathcomp/real_closed/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-real_closed" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/solvable/opam b/mathcomp/solvable/opam index 3e8537c..d978d1c 100644 --- a/mathcomp/solvable/opam +++ b/mathcomp/solvable/opam @@ -3,7 +3,7 @@ name: "coq-mathcomp-solvable" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" diff --git a/mathcomp/ssreflect/opam b/mathcomp/ssreflect/opam index 398d385..7e1b09c 100644 --- a/mathcomp/ssreflect/opam +++ b/mathcomp/ssreflect/opam @@ -3,14 +3,14 @@ name: "coq-mathcomp-ssreflect" version: "dev" maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" -homepage: "http://ssr.msr-inria.inria.fr/" +homepage: "http://math-comp.github.io/math-comp/" bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>" license: "CeCILL-B" build: [ make "-j" "%{jobs}%" ] install: [ make "install" ] remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/mathcomp'" ] -depends: [ "coq" { ((>= "8.4pl4" & < "8.5~") | (>= "8.5" & < "8.8~") | (= "dev"))} ] +depends: [ "coq" { ((>= "8.4pl4" & < "8.8~") | (= "dev"))} ] tags: [ "keyword:small scale reflection" "keyword:mathematical components" "keyword:odd order theorem" ] authors: [ "Jeremy Avigad <>" "Andrea Asperti <>" "Stephane Le Roux <>" "Yves Bertot <>" "Laurence Rideau <>" "Enrico Tassi <>" "Ioana Pasca <>" "Georges Gonthier <>" "Sidi Ould Biha <>" "Cyril Cohen <>" "Francois Garillot <>" "Alexey Solovyev <>" "Russell O'Connor <>" "Laurent Théry <>" "Assia Mahboubi <>" ] |
