Javascript-based selection menu and setup code generation.
Advantages: users can now simply copy/paste two lines and get the full
setup, instead of having to figure out what to copy where, after
downloading into a temporary directory and post-hoc enabling the gpg
key.
cd artwork; cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
+ cp -r build/src/lists $(WWW_DIR)/
clean:
def write_sourceslist(jinja_env, cfg, outdir):
create_dir(outdir)
- create_dir(os.path.join(outdir, '_static'))
+ create_dir(os.path.join(outdir, 'lists'))
repos = {}
for release in cfg.options('release codenames'):
transrel = trans_codename(release, cfg)
repos[transrel] = []
for mirror in cfg.options('mirrors'):
- listname = 'neurodebian.%s.%s.sources.list' % (release, mirror)
+ listname = '%s.%s' % (release, mirror)
repos[transrel].append((mirror, listname))
- lf = open(os.path.join(outdir, '_static', listname), 'w')
+ lf = open(os.path.join(outdir, 'lists', listname), 'w')
for rel in ('data', release):
aptcfg = '%s %s main contrib non-free\n' % (cfg.get('mirrors', mirror),
rel)
lf.write('#deb-src %s' % aptcfg)
lf.close()
+ id2codename = dict([(cfg.get('release backport ids', r), r)
+ for r in cfg.options('release codenames')])
+ id2relname = dict([(cfg.get('release backport ids', r), trans_codename(r, cfg))
+ for r in cfg.options('release codenames')])
+ mirror2name = dict([(m, cfg.get('mirror names', m))
+ for m in cfg.options('mirrors')])
+ mirror2url = dict([(m, cfg.get('mirrors', m))
+ for m in cfg.options('mirrors')])
srclist_template = jinja_env.get_template('sources_lists.rst')
sl = open(os.path.join(outdir, 'sources_lists'), 'w')
- sl.write(srclist_template.render(repos=repos))
+ sl.write(srclist_template.render(id2codename=id2codename,
+ id2relname=id2relname,
+ mirror2name=mirror2name,
+ mirror2url=mirror2url))
sl.close()
-{% for dist, mirrors in repos|dictsort %}
-* {{ dist }}: {% for mirror, list in mirrors|sort %}[`{{ mirror }} <_static/{{ list }}>`__] {% endfor %}
-{% endfor %}
+.. raw:: html
+
+ <select id="release" name="release">
+ <option value="">Select a release</option>
+{%- for id, relname in id2relname|dictsort(true, 'value') %}
+ <option value="{{ id }}">{{ relname }}</option>
+{%- endfor %}
+ </select>
+ <select id="mirror" name="mirror">
+{%- for id, mirrorname in mirror2name|dictsort %}
+{%- if id == 'us-nh' %}
+ <option selected value="{{ id }}">{{ mirrorname }}</option>
+{%- else %}
+ <option value="{{ id }}">{{ mirrorname }}</option>
+{%- endif %}
+{%- endfor %}
+ </select>
+
+ <div class="highlight-python" id="reposetup">
+ <pre id="code">
+ After selecting a release the setup code will be shown here.
+ </pre>
+ </div>
+ <script>
+ <!--
+
+ var rel2name = {
+{%- for id, codename in id2codename|dictsort %}
+ "{{ id }}" : "{{ codename }}",
+{%- endfor %}
+ };
+
+ var mirrors = {
+{%- for id, url in mirror2url|dictsort %}
+ "{{ id }}" : "{{ url }}",
+{%- endfor %}
+ };
+
+ function createrepourl(rel, mir) {
+ if(rel in rel2name && mir in mirrors) {
+
+ var retrepo = "sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9\n" +
+ "wget -O- http://neuro.debian.net/lists/" + rel2name[rel] + "."
+ + mir + " | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list\n";
+ return retrepo;
+ }
+
+ };
+ function updateout(rel, mir) {
+ $('#code').text(createrepourl(rel, mir));
+ };
+ $('#release').change(function() {
+ var singleValues = $("#release").val();
+ var mirrorVal = $("#mirror").val();
+ updateout(singleValues, mirrorVal);
+ });
+ $('#mirror').change(function() {
+ var singleValues = $("#release").val();
+ var mirrorVal = $("#mirror").val();
+ updateout(singleValues, mirrorVal);
+ });
+
+ //-->
+ </script>
How to use this repository
==========================
-The easiest way to use this repository is to download an APT-configuration file
-(`sources.list`). Simply choose your target distribution/release and download
-the configuration for a mirror close to you (depending on your browser, you
-might have to right-click and choose 'save as'). Once downloaded, put the file
-in the `/etc/apt/sources.list.d/` directory on your system. Moving files in
-this directory will require superuser privileges, therefore you should probably
-download the file into a temporary directory and subsequently move it into
-`/etc/apt/sources.list.d/`. APT-configurations are available for the following
-releases and repository mirrors:
+To enable the NeuroDebian repository on your system, select your Debian or
+Ubuntu release and a repository mirror from the lists below. Upon selection
+a short command snippet will be displayed that can be copied and pasted into
+a terminal session. These commands will configure the system package manager
+with the NeuroDebian repository key and package source information.
.. include:: sources_lists
-.. note::
- Thanks to the following institutions and individuals for hosting a mirror:
-
- * `Department of Psychological and Brain Sciences at Dartmouth College`_
- *[us-nh]* (primary mirror)
- * `Department of Experimental Psychology at the University of Magdeburg`_
- *[de]*
- * `Neurobot at Aristotle University of Thessaloniki, Greece`_ *[gr]*
- * `Paul Ivanov`_ *[us-ca]*
- * `Medical-image Analysis and Statistical Interpretation lab at Vanderbilt`_
- *[us-tn]*
-
- If your are interested in mirroring the repository, please see the :ref:`faq`.
-
-.. _Department of Psychological and Brain Sciences at Dartmouth College: http://www.dartmouth.edu/~psych
-.. _Department of Experimental Psychology at the University of Magdeburg: http://apsy.gse.uni-magdeburg.de
-.. _Neurobot at Aristotle University of Thessaloniki, Greece: http://neurobot.bio.auth.gr
-.. _Paul Ivanov: http://www.pirsquared.org
-.. _Medical-image Analysis and Statistical Interpretation lab at Vanderbilt: https://masi.vuse.vanderbilt.edu
-
Once this is done, you have to update the package index. Use your favorite
-package manager, e.g. synaptic, adept, or whatever you like. In the terminal
-you can use :command:`aptitude` to achieve the same::
+package manager, e.g. synaptic, adept. In the terminal you can use
+:command:`apt-get` to achieve this::
- sudo aptitude update
+ sudo apt-get update
-Now, you can proceed to install packages, e.g.::
+Now, you can install packages, e.g.::
- sudo aptitude install lipsia
+ sudo apt-get install mricron
.. note::
+
Not every package is available for all distributions/releases. For information
about which package version is available for which release and architecture,
please have a look at the corresponding package pages.
-After this initial setup you probably also want to configure your package
-manager to recognize the NeuroDebian archive key. With this key the package
-manager can verify that packages haven't been modified and are identical with
-the ones in the main NeuroDebian archive, regardless of which mirror you
-downloaded them from. The NeuroDebian key id is **2649A5A9**. If you need further
-help setting up package authentication, please take a look at
-:ref:`corresponding FAQ <sec_pkg_authentication>`.
-
.. _chap_installation:
.. _Jim Haxby: http://haxbylab.dartmouth.edu/ppl/jim.html
+Thanks to the following institutions and individuals for hosting a mirror:
+
+* `Department of Psychological and Brain Sciences at Dartmouth College`_
+ *[us-nh]* (primary mirror)
+* `Department of Experimental Psychology at the University of Magdeburg`_
+ *[de]*
+* `Neurobot at Aristotle University of Thessaloniki, Greece`_ *[gr]*
+* `Paul Ivanov`_ *[us-ca]*
+* `Medical-image Analysis and Statistical Interpretation lab at Vanderbilt`_
+ *[us-tn]*
+
+If your are interested in mirroring the repository, please see the :ref:`faq`.
+
+.. _Department of Psychological and Brain Sciences at Dartmouth College: http://www.dartmouth.edu/~psych
+.. _Department of Experimental Psychology at the University of Magdeburg: http://apsy.gse.uni-magdeburg.de
+.. _Neurobot at Aristotle University of Thessaloniki, Greece: http://neurobot.bio.auth.gr
+.. _Paul Ivanov: http://www.pirsquared.org
+.. _Medical-image Analysis and Statistical Interpretation lab at Vanderbilt: https://masi.vuse.vanderbilt.edu
+
+
Publications
============