Creating a webserver CRAN repository - troubleshooting the directory structure
packaging, r
Solution
After some searching I found that:
- The package should be built not by `R CMD BUILD` but by `R CMD INSTALL --build`
Instead of using contriburl it seems to work with repos:
install.packages("Gmisc", repos=c("http://ftp.sunet.se/pub/lang/CRAN", "http://cran.gforge.se"), dependencies=TRUE)
Problem
I'm trying to figure out how to create a http CRAN-repository. I've tried to follow the local CRAN repository without no real success. Basically I have my local repository set up like this (I'm not sure the source catalog makes sens but I added it just in case): ``` library(tools) reposRoot <- "C:\\Software\\repository" r_ver <- "2.15" contribPaths <- c(source = "src\\contrib", windows = "bin\\windows\\contrib") write_PACKAGES(paste(reposRoot, contribPaths["windows"], r_ver, sep="\\"), type="win.binary", unpacked=FALSE, latestOnly=FALSE, verbose=TRUE) write_PACKAGES(paste(reposRoot, contribPaths["source"], r_ver, sep="\\"), type="source", unpacked=FALSE, latestOnly=FALSE, verbose=TRUE) ``` I've then uploaded the repository to my webserver: cran.gforge.se but when I try find the packages I get: ``` > available.packages(contriburl="http://cran.gforge.se") Warning: unable to access index for repository http://cran.gforge.se Package Version Priority Depends Imports LinkingTo Suggests Enhances OS_type License Archs File Repository ``` So my conclusion is that it can't find the repository but the strange part is when I try: ``` > available.packages(contriburl="http://cran.gforge.se/bin/windows/contrib/2.15") Package Version Priority Depends Imports Gmisc "Gmisc" "0.2" NA "grid, testthat, miscTools, rms, Hmisc, survival, cmprsk" NA LinkingTo Suggests Enhances OS_type License Archs File Gmisc NA NA NA NA "GPL (>= 2)" NA NA Repository Gmisc "http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib" ``` It actually finds my beautiful package but the path is all mixed-up. If I try to run an install I get this: ``` > install.packages("Gmisc", contriburl="http://cran.gforge.se/") Installing package(s) into ‘C:/Users/max/R/win-library/2.15’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘Gmisc’ is not available (for R version 2.15.0) > install.packages("Gmisc", contriburl="http://cran.gforge.se/bin/windows/contrib/2.15") Installing package(s) into ‘C:/Users/max/R/win-library/2.15’ (as ‘lib’ is unspecified) trying URL 'http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib/Gmisc_0.2.zip' Warning in install.packages : cannot open: HTTP status was '500 Internal Server Error' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib/Gmisc_0.2.zip' Warning in install.packages : download of package ‘Gmisc’ failed ``` I've looked for any help in the manual and SONIVIS wiki but I must be blind... please guide me :-S