X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2FR%2Fdebcontrol.R;h=a044f89ca4b041c0a8ed2f375fab9d898ef8bd13;hb=d8a2e28b2f013a8624cb587f09f90120f46f1ce8;hp=84d9933780a35d64795aa15649a9766b82bcea03;hpb=e48407cfb4f4911aaeb8dde94d386cc16a600822;p=cran2deb.git diff --git a/trunk/R/debcontrol.R b/trunk/R/debcontrol.R index 84d9933..a044f89 100644 --- a/trunk/R/debcontrol.R +++ b/trunk/R/debcontrol.R @@ -45,6 +45,9 @@ get_dependencies <- function(pkg,extra_deps) { # append the Debian dependencies depends$build=c(depends$build,'debhelper (>> 4.1.0)','cdbs') + if (file.exists(file.path(patch_dir, pkg$name))) { + depends$build <- c(depends$build,'dpatch') + } if (pkg$archdep) { depends$bin=c(depends$bin,'${shlibs:Depends}') } @@ -77,6 +80,10 @@ sysreqs_as_debian <- function(sysreq_text) { sysreq = gsub('(ht|f)tps?://[[:alnum:]!?*"\'(),%$_@.&+/=-]*','',sysreq) # squish out space sysreq = chomp(gsub('[[:space:]]+',' ',sysreq)) + if (nchar(sysreq) == 0) { + notice('part of the SystemRequirement became nothing') + next + } alias <- db_sysreq_override(sysreq) if (is.null(alias)) { error('do not know what to do with SystemRequirement:',sysreq) @@ -108,45 +115,32 @@ map_aliases_to_debian <- function(aliases) { generate_control <- function(pkg) { # construct control file - control = data.frame() - control[1,'Source'] = pkg$srcname - control[1,'Section'] = 'math' - control[1,'Priority'] = 'optional' - control[1,'Maintainer'] = maintainer - control[1,'Build-Depends'] = paste(pkg$depends$build,collapse=', ') - control[1,'Standards-Version'] = '3.8.0' - - control[2,'Package'] = pkg$debname - control[2,'Architecture'] = 'all' + + control <- data.frame() + control[1,'Source'] <- pkg$srcname + control[1,'Section'] <- 'gnu-r' + control[1,'Priority'] <- 'optional' + control[1,'Maintainer'] <- maintainer + control[1,'Build-Depends'] <- paste(pkg$depends$build, collapse=', ') + control[1,'Standards-Version'] <- '3.8.4' + + control[2,'Package'] <- pkg$debname + control[2,'Architecture'] <- 'all' if (pkg$archdep) { - control[2,'Architecture'] = 'any' + control[2,'Architecture'] <- 'any' } - control[2,'Depends'] = paste(pkg$depends$bin,collapse=', ') - -# # bundles provide virtual packages of their contents -# # unnecessary for now; cran2deb converts R bundles itself -# if (pkg$is_bundle) { -# control[2,'Provides'] = paste( -# lapply(r_bundle_contains(pkg$name) -# ,function(name) return(pkgname_as_debian(paste(name) -# ,repopref=pkg$repo))) -# ,collapse=', ') -# } + control[2,'Depends'] <- paste(pkg$depends$bin,collapse=', ') # generate the description - descr = 'GNU R package "' + descr <- 'GNU R package "' if ('Title' %in% colnames(pkg$description)) { - descr = paste(descr,pkg$description[1,'Title'],sep='') + descr <- paste(descr,pkg$description[1,'Title'],sep='') } else { - descr = paste(descr,pkg$name,sep='') - } - if (pkg$is_bundle) { - long_descr <- pkg$description[1,'BundleDescription'] - } else { - long_descr <- pkg$description[1,'Description'] + descr <- paste(descr,pkg$name,sep='') } + long_descr <- pkg$description[1,'Description'] - if (length(long_descr) < 1) { + if (length(long_descr) < 1 || long_descr == "") { # bypass lintian extended-description-is-empty for which we care not. long_descr <- paste('The author/maintainer of this package' ,'did not care to enter a longer description.') @@ -155,13 +149,20 @@ generate_control <- function(pkg) { # using \n\n.\n\n is not very nice, but is necessary to make sure # the longer description does not begin on the synopsis line --- R's # write.dcf does not appear to have a nicer way of doing this. - descr = paste(descr,'"\n\n', long_descr, sep='') - if ('URL' %in% colnames(pkg$description)) { - descr = paste(descr,'\n\nURL: ',pkg$description[1,'URL'],sep='') + descr <- paste(descr,'"\n\n', long_descr, sep='') + # add some extra nice info about the original R package + for (r_info in c('Author','Maintainer','URL')) { + if (r_info %in% colnames(pkg$description)) { + descr <- paste(descr,'\n\n',r_info,': ',pkg$description[1,r_info],sep='') + } } - control[2,'Description'] = descr + if (Encoding(descr) == "unknown") + Encoding(descr) <- "latin1" # or should it be UTF-8 + + control[2,'Description'] <- descr # Debian policy says 72 char width; indent minimally write.dcf(control,file=pkg$debfile('control.in'),indent=1,width=72) + write.dcf(control,indent=1,width=72) }