From 4f4cd07a9ef72c53bbfa53eda835f19dc9f9ad72 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 25 Jan 2017 18:39:48 +0100 Subject: Initial commit --- .Rbuildignore | 5 ++ .gitignore | 3 + ChangeLog | 5 ++ DESCRIPTION | 16 ++++++ GNUmakefile | 54 ++++++++++++++++++ NAMESPACE | 4 ++ R/install_PELMO.R | 36 ++++++++++++ README.md | 15 +++++ docs/authors.html | 97 ++++++++++++++++++++++++++++++++ docs/index.html | 86 +++++++++++++++++++++++++++++ docs/jquery.sticky-kit.min.js | 9 +++ docs/link.svg | 12 ++++ docs/pkgdown.css | 113 ++++++++++++++++++++++++++++++++++++++ docs/pkgdown.js | 8 +++ docs/reference/index.html | 107 ++++++++++++++++++++++++++++++++++++ docs/reference/install_PELMO.html | 108 ++++++++++++++++++++++++++++++++++++ man/install_PELMO.Rd | 14 +++++ 17 files changed, 692 insertions(+) create mode 100644 .Rbuildignore create mode 100644 .gitignore create mode 100644 ChangeLog create mode 100644 DESCRIPTION create mode 100644 GNUmakefile create mode 100644 NAMESPACE create mode 100644 R/install_PELMO.R create mode 100644 README.md create mode 100644 docs/authors.html create mode 100644 docs/index.html create mode 100644 docs/jquery.sticky-kit.min.js create mode 100644 docs/link.svg create mode 100644 docs/pkgdown.css create mode 100644 docs/pkgdown.js create mode 100644 docs/reference/index.html create mode 100644 docs/reference/install_PELMO.html create mode 100644 man/install_PELMO.Rd diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..29a18d6 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,5 @@ +^PELMO_installeR_.*.tar.gz +^GNUmakefile$ +^build.log$ +^test.log$ +^docs$ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eee8d8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*\.log +PELMO.installeR*\.tar.gz +PELMO.installeR\.Rcheck diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..bd68b6b --- /dev/null +++ b/ChangeLog @@ -0,0 +1,5 @@ +commit 147cba00160380874987a00b417eac5bea562010 +Author: Johannes Ranke +Date: 2017-01-25 18:39:48 +0100 + + Initial commit diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..1089b66 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,16 @@ +Package: PELMO.installeR +Type: Package +Title: Install FOCUS PELMO into an R library location +Version: 0.1-1 +Date: 2017-01-25 +Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de", + role = c("aut", "cre", "cph")) +Description: The only function in this package downloads 'FOCUS PELMO' from the + official website and installs it into the installation directory of this package. +SystemRequirements: wine +OS_type: unix +Imports: clipr +License: GPL +LazyLoad: yes +LazyData: yes +RoxygenNote: 5.0.1.9000 diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..36cb038 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,54 @@ +PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION) +PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION) +TGZ := $(PKGNAME)_$(PKGVERS).tar.gz +R_HOME ?= $(shell R RHOME) +DATE := $(shell date +%Y-%m-%d) + +.PHONY: check + +pkgfiles = DESCRIPTION \ + .Rbuildignore \ + docs/* \ + docs/reference/* \ + R/* + +roxygen: + @echo "Roxygenizing package..." + "$(R_HOME)/bin/Rscript" -e 'library(devtools); document()' + @echo "DONE." + +pd: roxygen + @echo "Building static documentation..." + "$(R_HOME)/bin/Rscript" -e 'pkgdown::build_site()' + @echo "DONE." + +$(TGZ): $(pkgfiles) + sed -i -e "s/Date:.*/Date: $(DATE)/" DESCRIPTION + @echo "Roxygenizing package..." + "$(R_HOME)/bin/Rscript" -e 'library(devtools); document()' + @echo "Building package..." + git log --no-merges -M --date=iso > ChangeLog + "$(R_HOME)/bin/R" CMD build . > build.log 2>&1 + @echo "DONE." + +build: $(TGZ) + +check: build + @echo "Running CRAN check..." + "$(R_HOME)/bin/R" CMD check --as-cran $(TGZ) + @echo "DONE." + +install: build + @echo "Installing package..." + "$(R_HOME)/bin/R" CMD INSTALL --no-multiarch $(TGZ) + @echo "DONE." + +drat: build + "$(R_HOME)/bin/Rscript" -e "drat::insertPackage('$(TGZ)', commit = TRUE)" + +winbuilder: build + date + @echo "Uploading to R-release on win-builder" + curl -T $(TGZ) ftp://anonymous@win-builder.r-project.org/R-release/ + @echo "Uploading to R-devel on win-builder" + curl -T $(TGZ) ftp://anonymous@win-builder.r-project.org/R-devel/ diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..46b7303 --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,4 @@ +# Generated by roxygen2: do not edit by hand + +export(install_PELMO) +importFrom(clipr,write_clip) diff --git a/R/install_PELMO.R b/R/install_PELMO.R new file mode 100644 index 0000000..02b1064 --- /dev/null +++ b/R/install_PELMO.R @@ -0,0 +1,36 @@ +#' Download FOCUS PELMO from the official site and unzip into the package installation directory +#' +#' @importFrom clipr write_clip +#' @param version The FOCUS PELMO version to install +#' @export +install_PELMO <- function(version = "5.5.3", local_zip = NULL) { + pkg_dir <- system.file(package = "PELMO.installeR") + setup_dir <- file.path(pkg_dir, paste0("PELMO_", gsub("\\.", "", version), "_setup")) + if (!dir.exists(setup_dir)) dir.create(setup_dir) + + if (is.null(local_zip)) { + PELMO_file <- paste0("FOCUS_PELMO_", gsub("\\.", "_", version), ".zip") + PELMO_url <- paste0("http://esdac.jrc.ec.europa.eu/public_path/projects_data/focus/gw/software/", + PELMO_file) + PELMO_zip <- tempfile(fileext=".zip") + download.file(PELMO_url, PELMO_zip) + } else { + if (file.exists(local_zip)) { + PELMO_zip <- local_zip + } else { + stop(local_zip, " does not exist") + } + } + + unzip(PELMO_zip, exdir = setup_dir, junkpaths = TRUE) + oldwd <- setwd(setup_dir) + message("The FOCUS PELMO installer will now start.") + message("Please select the following directory in the installation process:") + PELMO_dest_dir <- paste0("Z:", gsub("/", "\\\\", pkg_dir), + "\\FOCUSPELMO.", gsub("\\.", "", version)) + message(PELMO_dest_dir) + message("This is now being pasted to the system clipboard") + write_clip(PELMO_dest_dir) + system("wine setup.exe") + setwd(oldwd) +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..eee6b0c --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# PELMO.installeR + +The R package **PELMO.installeR** provides a way to install +[FOCUS PELMO](http://esdac.jrc.ec.europa.eu/projects/pelmo) +in a standardised way on unix system for use with +[wine](https://www.winehq.org). + +## Note + +If you (re)install this package, you will have to +[(re)install PELMO](http://jranke.github.io/PELMO.installeR/reference/install_PELMO.html) afterwards. + +## Use + +Please refer to the [reference](http://jranke.github.io/PELMO.installeR/reference/index.html). diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..e8abd36 --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,97 @@ + + + + + + + + +Authors • PELMO.installeR + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
    +
  • +

    Johannes Ranke. Author, maintainer, copyright holder. +

    +
  • +
+ +
+ +
+ + +
+ + +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..6aaaed4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,86 @@ + + + + + + + +Install FOCUS PELMO into an R library location • PELMO.installeR + + + + + + +
+
+ + + +
+
+
+ +

The R package PELMO.installeR provides a way to install FOCUS PELMO in a standardised way on unix system for use with wine.

+
+

+ Note

+

If you (re)install this package, you will have to (re)install PELMO afterwards.

+
+
+

+ Use

+

Please refer to the reference.

+
+
+
+ + +
+ + +
+ +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/jquery.sticky-kit.min.js b/docs/jquery.sticky-kit.min.js new file mode 100644 index 0000000..e2a3c6d --- /dev/null +++ b/docs/jquery.sticky-kit.min.js @@ -0,0 +1,9 @@ +/* + Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net +*/ +(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); +if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, +u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), +a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", +y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..fd7b0ba --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,113 @@ +/* Sticker footer */ +body > .container { + display: flex; + padding-top: 60px; + min-height: calc(100vh); + flex-direction: column; +} + +body > .container .row { + flex: 1; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Section anchors ---------------------------------*/ + +.hasAnchor { + margin-left: -30px; +} + +a.anchor { + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -60px; +} + +/* Sidebar --------------------------*/ + +#sidebar { + margin-top: 30px; +} +#sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#sidebar h2:first-child { + margin-top: 0; +} + +#sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +code { + background-color: #f7f7f7; + color: #333; +} +code a { + color: #375f84; +} + +.warning { color: red; } +.message { font-weight: bolder; } +.error { color: red; font-weight: bolder; } + +.fl,.number {color:rgb(21,20,181);} +.fu,.functioncall {color:#264D66 ;} +.ch,.st,.string {color:#375D81 ;} +.kw,.keyword {color:black;} +.argument {color:#264D66 ;} +.co,.comment {color: #777;} +.formalargs {color: #264D66;} +.eqformalargs {color:#264D66;} +.slot {font-style:italic;} +.symbol {color:black ;} +.prompt {color:black ;} + +pre img { + background-color: #fff; + display: block; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..c8b38c4 --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,8 @@ +$(function() { + $("#sidebar").stick_in_parent({offset_top: 40}); + $('body').scrollspy({ + target: '#sidebar', + offset: 60 + }); + +}); diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..6410de9 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,107 @@ + + + + + + + + +Function reference • PELMO.installeR + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + + +
+ + +
+ +
+ + +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/reference/install_PELMO.html b/docs/reference/install_PELMO.html new file mode 100644 index 0000000..621a2d4 --- /dev/null +++ b/docs/reference/install_PELMO.html @@ -0,0 +1,108 @@ + + + + + + + + +Download FOCUS PELMO from the official site and unzip into the package installation directory — install_PELMO • PELMO.installeR + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + + +

Download FOCUS PELMO from the official site and unzip into the package installation directory

+ + +
install_PELMO(version = "5.5.3", local_zip = NULL)
+ +

Arguments

+
+
version
+
The FOCUS PELMO version to install
+
+ + +
+ +
+ + +
+ + + diff --git a/man/install_PELMO.Rd b/man/install_PELMO.Rd new file mode 100644 index 0000000..1bca1bb --- /dev/null +++ b/man/install_PELMO.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/install_PELMO.R +\name{install_PELMO} +\alias{install_PELMO} +\title{Download FOCUS PELMO from the official site and unzip into the package installation directory} +\usage{ +install_PELMO(version = "5.5.3", local_zip = NULL) +} +\arguments{ +\item{version}{The FOCUS PELMO version to install} +} +\description{ +Download FOCUS PELMO from the official site and unzip into the package installation directory +} -- cgit v1.2.1