From 54fc89546f03aa5efc1afcd27b4d1c0b23817a5f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 7 Aug 2014 13:24:31 -0400 Subject: [PATCH] RF: absorb neurodebian-repository into neurodebian package (and rename debconf variables as well) --- debian/TODO | 10 +++--- debian/changelog | 2 +- debian/control | 23 +++---------- debian/neurodebian-repository.postinst | 32 ------------------- ...n-repository.config => neurodebian.config} | 26 +++++++-------- ...repository.install => neurodebian.install} | 0 debian/neurodebian.postinst | 32 +++++++++++++++++++ ...n-repository.postrm => neurodebian.postrm} | 0 ...sitory.templates => neurodebian.templates} | 22 ++++++------- .../test_neurodebian-repository-deployment | 10 +++--- 10 files changed, 71 insertions(+), 86 deletions(-) delete mode 100755 debian/neurodebian-repository.postinst rename debian/{neurodebian-repository.config => neurodebian.config} (71%) rename debian/{neurodebian-repository.install => neurodebian.install} (100%) create mode 100755 debian/neurodebian.postinst rename debian/{neurodebian-repository.postrm => neurodebian.postrm} (100%) rename debian/{neurodebian-repository.templates => neurodebian.templates} (86%) diff --git a/debian/TODO b/debian/TODO index 33dfa55..0e69205 100644 --- a/debian/TODO +++ b/debian/TODO @@ -19,13 +19,13 @@ set -ex apt_file=/etc/apt/sources.list.d/local.list # clean up from a previous test -dpkg --purge neurodebian-repository neurodebian-keyring || : -echo PURGE | debconf-communicate neurodebian-repository || : +dpkg --purge neurodebian neurodebian-keyring || : +echo PURGE | debconf-communicate neurodebian || : rm -rf /tmp/apt $apt_file; mkdir -p /tmp/apt; cd /tmp/apt; rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget; -wget http://www.onerussian.com/tmp/neurodebian-repository_0.33~a1_all.deb; +wget http://www.onerussian.com/tmp/neurodebian_0.33~a1_all.deb; wget http://www.onerussian.com/tmp/neurodebian-keyring_0.33~a1_all.deb; # generate APT repo @@ -33,7 +33,7 @@ apt-get install -y dpkg-dev ; dpkg-scanpackages . /dev/null > Packages # Add it to the list of available echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update # Install the beast -apt-get install -y --allow-unauthenticated neurodebian-repository +apt-get install -y --allow-unauthenticated neurodebian # Verify that it has correct entries release=$(grep -v '^[\s#]*$' /etc/apt/sources.list | head -1 | awk '{print $3;}') @@ -41,7 +41,7 @@ grep -E "^deb\s+http.* $release main\s*\$" /etc/apt/sources.list.d/neurodebian.s grep -E '^deb\s+http.* data main\s*$' /etc/apt/sources.list.d/neurodebian.sources.list # May be even retrospect stored debconf configuration apt-get install debconf-utils -debconf-get-selections | grep neurodebian-repository/release.*select.*auto +debconf-get-selections | grep neurodebian/release.*select.*auto # And apt-get must be working apt-get update # Make sure it is active diff --git a/debian/changelog b/debian/changelog index 6f7f9ee..319f133 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ neurodebian (0.33~a1) unstable; urgency=medium * New "upstream" release * New features: - - neurodebian and neurodebian-repository packages to provide 1-click + - neurodebian and neurodebian packages to provide 1-click NeuroDebian deployment on Debian/Ubuntu boxesw -- Yaroslav Halchenko Mon, 28 Jul 2014 20:03:12 -0400 diff --git a/debian/control b/debian/control index 74bbc2b..3783534 100644 --- a/debian/control +++ b/debian/control @@ -12,31 +12,16 @@ XS-DM-Upload-Allowed: yes Package: neurodebian Architecture: all -Depends: ${misc:Depends}, neurodebian-repository -Recommends: neurodebian-desktop, neurodebian-popularity-contest +Pre-depends: python-minimal, wget +Depends: neurodebian-keyring, ${misc:Depends} +Recommends: netselect +Suggests: neurodebian-desktop, neurodebian-popularity-contest Description: turnkey platform for the neuroscience The NeuroDebian project integrates and maintain a variety of neuroscience-oriented (such as AFNI, FSL, PsychoPy, etc.) and many generic computational (such as condor, pandas, etc.) software projects within Debian. . - This meta-package depends on packages needed for a typical - NeuroDebian deployment, e.g. enabling the complementary NeuroDebian - repository of package backports and perspective packages not yet - available from stock Debian/Ubuntu. - - -Package: neurodebian-repository -Architecture: all -Pre-depends: python-minimal, wget -Depends: neurodebian-keyring, ${misc:Depends} -Recommends: netselect -Description: NeuroDebian APT repository installer - Besides making (neuro)scientific software available on stock Debian - systems, neuro.debian.net (and mirrors around the globe) provides - a repository with backport builds of the NeuroDebian-maintained - packages for all supported Debian and Ubuntu releases. - . This package enables NeuroDebian repository on top of the stock Debian or Ubuntu system. diff --git a/debian/neurodebian-repository.postinst b/debian/neurodebian-repository.postinst deleted file mode 100755 index dcae7cc..0000000 --- a/debian/neurodebian-repository.postinst +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -e - -. /usr/share/debconf/confmodule - - -case "$1" in - configure) - # obtain all the options and call nd-configurerepo - opts="--do-not-update" - db_get neurodebian-repository/release; [ "$RET" = "auto" ] || opts+=" -r '$RET'" - db_get neurodebian-repository/mirror; nd_mirror="${RET##* }" # get just a url if it came together with alias - db_get neurodebian-repository/flavor; nd_flavor="$RET" - db_get neurodebian-repository/components; nd_components="${RET// /}" - - db_get neurodebian-repository/overwrite; [ "$RET" = "true" ] && opts+=" --overwrite" || : - db_get neurodebian-repository/suffix; [ "$RET" = "" ] || opts+=" --suffix='$RET'" || : - - eval nd-configurerepo -m "$nd_mirror" -c "$nd_components" $opts - ;; - abort-upgrade|abort-remove|abort-deconfigure) - # nothing to do - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# diff --git a/debian/neurodebian-repository.config b/debian/neurodebian.config similarity index 71% rename from debian/neurodebian-repository.config rename to debian/neurodebian.config index 4d9ee97..5cec864 100755 --- a/debian/neurodebian-repository.config +++ b/debian/neurodebian.config @@ -10,7 +10,7 @@ debug() [ "${DEBCONF_DEBUG:-}" != "developer" ] || echo -e "D: $*" >&2 } -db_settitle neurodebian-repository/title +db_settitle neurodebian/title if [ "$1" = "configure" ]; then # Must have been called in preinst state, so no nd-configurerepo @@ -33,22 +33,22 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do 1) export neurodebian_releases="$(ND_IFS=', ' nd-configurerepo --print-releases)" debug "releases: $neurodebian_releases" - db_subst neurodebian-repository/release releases "$neurodebian_releases" - db_input medium neurodebian-repository/release || true + db_subst neurodebian/release releases "$neurodebian_releases" + db_input medium neurodebian/release || true ;; 2) export neurodebian_mirrors="$(ND_IFS=', ' nd-configurerepo --print-mirrors)" debug "mirrors: $neurodebian_mirrors" - db_subst neurodebian-repository/mirror mirrors "$neurodebian_mirrors" - db_input medium neurodebian-repository/mirror || true + db_subst neurodebian/mirror mirrors "$neurodebian_mirrors" + db_input medium neurodebian/mirror || true mirror_selection_ret="$RET" debug "mirror select return: <$mirror_selection_ret>" ;; - 3) db_input medium neurodebian-repository/flavor || true ;; - 4) db_input medium neurodebian-repository/components || true ;; - 5) db_input low neurodebian-repository/overwrite || true ;; - 6) db_input low neurodebian-repository/suffix || true ;; - 7) db_input medium neurodebian-repository/run-update-note || true ;; + 3) db_input medium neurodebian/flavor || true ;; + 4) db_input medium neurodebian/components || true ;; + 5) db_input low neurodebian/overwrite || true ;; + 6) db_input low neurodebian/suffix || true ;; + 7) db_input medium neurodebian/run-update-note || true ;; esac if db_go; then @@ -60,7 +60,7 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do # # case $STATE in # 2) -# db_metaget neurodebian-repository/mirror value +# db_metaget neurodebian/mirror value # selected_mirror="$RET" # # TODOs: # # - handle custom @@ -71,10 +71,10 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do # # if the question was not even shown, we would # # not get a chance to specify mirror, thus # # better just fail altogether and demand intervention -# db_input high neurodebian-repository/netselect-cannot-be-used +# db_input high neurodebian/netselect-cannot-be-used # exit 1 # else -# db_input high neurodebian-repository/netselect-not-found +# db_input high neurodebian/netselect-not-found # continue; # fi # fi diff --git a/debian/neurodebian-repository.install b/debian/neurodebian.install similarity index 100% rename from debian/neurodebian-repository.install rename to debian/neurodebian.install diff --git a/debian/neurodebian.postinst b/debian/neurodebian.postinst new file mode 100755 index 0000000..97cbc86 --- /dev/null +++ b/debian/neurodebian.postinst @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + + +case "$1" in + configure) + # obtain all the options and call nd-configurerepo + opts="--do-not-update" + db_get neurodebian/release; [ "$RET" = "auto" ] || opts+=" -r '$RET'" + db_get neurodebian/mirror; nd_mirror="${RET##* }" # get just a url if it came together with alias + db_get neurodebian/flavor; nd_flavor="$RET" + db_get neurodebian/components; nd_components="${RET// /}" + + db_get neurodebian/overwrite; [ "$RET" = "true" ] && opts+=" --overwrite" || : + db_get neurodebian/suffix; [ "$RET" = "" ] || opts+=" --suffix='$RET'" || : + + eval nd-configurerepo -m "$nd_mirror" -c "$nd_components" $opts + ;; + abort-upgrade|abort-remove|abort-deconfigure) + # nothing to do + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/debian/neurodebian-repository.postrm b/debian/neurodebian.postrm similarity index 100% rename from debian/neurodebian-repository.postrm rename to debian/neurodebian.postrm diff --git a/debian/neurodebian-repository.templates b/debian/neurodebian.templates similarity index 86% rename from debian/neurodebian-repository.templates rename to debian/neurodebian.templates index d2896c8..9782c69 100644 --- a/debian/neurodebian-repository.templates +++ b/debian/neurodebian.templates @@ -1,9 +1,9 @@ -Template: neurodebian-repository/title +Template: neurodebian/title Type: title Description: NeuroDebian APT repository installer -Template: neurodebian-repository/release +Template: neurodebian/release Type: select Choices: auto, ${releases} Default: auto @@ -14,7 +14,7 @@ Description: Release name of the base system apt-cache policy. -Template: neurodebian-repository/mirror +Template: neurodebian/mirror Type: select Choices: origin, best, custom, ${mirrors} Default: best @@ -31,7 +31,7 @@ Description: NeuroDebian mirror to use: is not available, default mirror (possibly 'origin') will be used. -Template: neurodebian-repository/flavor +Template: neurodebian/flavor Type: select Choices: auto, libre, full Default: auto @@ -48,7 +48,7 @@ Description: NeuroDebian flavor to use: apt-cache policy ('full' -- if non-free (Debian) or multiverse (Ubuntu) areas are enabled) -Template: neurodebian-repository/components +Template: neurodebian/components Type: multiselect Choices: software, data, devel Default: software, data @@ -67,14 +67,14 @@ Description: Select NeuroDebian repository components to enable required by software packages. Should generally be enabled. -Template: neurodebian-repository/overwrite +Template: neurodebian/overwrite Type: boolean Default: true Description: Should existing NeuroDebian APT file be overridden? If not allowed, configuration would fail if there is an existing apt configuration file for the NeuroDebian. -Template: neurodebian-repository/suffix +Template: neurodebian/suffix Type: string Default: Description: Additional suffix to use in the NeuroDebian APT file name @@ -82,21 +82,21 @@ Description: Additional suffix to use in the NeuroDebian APT file name (e.g. NeuroDebian devel) or release, without interfering with the main/default configuration file. -Template: neurodebian-repository/run-update-note +Template: neurodebian/run-update-note Type: note Description: Upon completion of installation invoke update in your APT frontend. For the installed NeuroDebian APT configuration to take an effect, list of packages needs to be updated. This needs to be done "manually" (e.g. apt-get update) upon completion of installation of - the neurodebian-repository package. + the neurodebian package. -Template: neurodebian-repository/netselect-not-found +Template: neurodebian/netselect-not-found Type: error Description: netselect tool was not found Please install netselect tool first (apt-get install netselect) or choose a specific mirror. -Template: neurodebian-repository/netselect-cannot-be-used +Template: neurodebian/netselect-cannot-be-used Type: error Description: netselect tool was not found (no other mirror) Please install netselect tool first (apt-get install netselect) diff --git a/tools/tests/test_neurodebian-repository-deployment b/tools/tests/test_neurodebian-repository-deployment index 19e9a17..0a4583a 100755 --- a/tools/tests/test_neurodebian-repository-deployment +++ b/tools/tests/test_neurodebian-repository-deployment @@ -5,13 +5,13 @@ set -ex apt_file=/etc/apt/sources.list.d/local.list # clean up from a previous test -dpkg --purge neurodebian-repository neurodebian-keyring || : -echo PURGE | debconf-communicate neurodebian-repository || : +dpkg --purge neurodebian neurodebian-keyring || : +echo PURGE | debconf-communicate neurodebian || : rm -rf /tmp/apt $apt_file; mkdir -p /tmp/apt; cd /tmp/apt; rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget; -wget http://www.onerussian.com/tmp/neurodebian-repository_0.33~a1_all.deb; +wget http://www.onerussian.com/tmp/neurodebian_0.33~a1_all.deb; wget http://www.onerussian.com/tmp/neurodebian-keyring_0.33~a1_all.deb; # generate APT repo @@ -19,7 +19,7 @@ apt-get install -y dpkg-dev ; dpkg-scanpackages . /dev/null > Packages # Add it to the list of available echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update # Install the beast -apt-get install -y --allow-unauthenticated neurodebian-repository +apt-get install -y --allow-unauthenticated neurodebian # Verify that it has correct entries # Very cruel way to figure out the default release. Would fail if # options, such as multiarch, are specified after deb @@ -28,7 +28,7 @@ grep -E "^deb\s+http.* $release main\s*\$" /etc/apt/sources.list.d/neurodebian.s grep -E '^deb\s+http.* data main\s*$' /etc/apt/sources.list.d/neurodebian.sources.list # May be even retrospect stored debconf configuration apt-get install debconf-utils -debconf-get-selections | grep neurodebian-repository/release.*select.*auto +debconf-get-selections | grep neurodebian/release.*select.*auto # And apt-get must be working apt-get update # Make sure it is active -- 2.39.2