[Git][java-team/jalview][master] 6 commits: Editing the wrapper to allow clicking on the icon or starting from a...

Pierre Gruet gitlab at salsa.debian.org
Sat Feb 20 13:48:58 GMT 2021



Pierre Gruet pushed to branch master at Debian Java Maintainers / jalview


Commits:
9561dbe7 by Pierre Gruet at 2021-02-10T22:16:25+01:00
Editing the wrapper to allow clicking on the icon or starting from a right-click on a file in the file manager

- - - - -
26689dcd by Pierre Gruet at 2021-02-10T22:26:44+01:00
Producing the .build_properties file needed in the jar

- - - - -
7d1d1450 by Pierre Gruet at 2021-02-20T14:40:40+01:00
Changing the date format in the .build_properties file

- - - - -
c0606fdc by Pierre Gruet at 2021-02-20T14:41:34+01:00
Packaging the example file so that it is not downloaded from the Internet at each startup

- - - - -
457598de by Pierre Gruet at 2021-02-20T14:42:38+01:00
Using debconf to ask questions about privacy

Managing a default /etc/jalview_properties file with maintainer scripts, it can
be reconfigured with debconf.

- - - - -
40c27ce9 by Pierre Gruet at 2021-02-20T14:44:19+01:00
Copying the default configuration file as a dotfile of the user if it does not exist

- - - - -


11 changed files:

- + debian/config
- debian/control
- debian/jalview.desktop
- + debian/po/POTFILES.in
- + debian/po/templates.pot
- + debian/postinst
- + debian/postrm
- debian/rules
- + debian/templates
- debian/wrappers/jalview
- + debian/write_build_properties_file.sh.in


Changes:

=====================================
debian/config
=====================================
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+# Fetching news
+db_input medium jalview/news || true
+# Querying for questionnaire
+db_input medium jalview/questionnaire || true
+# Downloading from identifiers.org
+db_input medium jalview/identifiersservice || true
+# Web services discovery
+db_input medium jalview/jws2services || true
+# Downloading HTML templates
+db_input medium jalview/htmltemplates || true
+db_go


=====================================
debian/control
=====================================
@@ -4,6 +4,7 @@ Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Pierre Gruet <pgtdebian at free.fr>
 Build-Depends: debhelper-compat (= 13),
+               po-debconf,
                default-jdk,
                groovy,
                imagemagick,
@@ -44,6 +45,7 @@ Rules-Requires-Root: no
 Package: jalview
 Architecture: all
 Depends: default-jre,
+         debconf,
          libcommons-discovery-java,
          libjaxws-java,
          ${java:Depends},


=====================================
debian/jalview.desktop
=====================================
@@ -5,7 +5,7 @@ Name=Jalview
 Comment=Multiple Sequence Alignment Editor
 Icon=jalview-icon
 TryExec=jalview
-Exec=jalview -open %u
+Exec=jalview %u
 Terminal=false
 Categories=Science;Biology;
 Keywords=alignment;sequence;


=====================================
debian/po/POTFILES.in
=====================================
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates


=====================================
debian/po/templates.pot
=====================================
@@ -0,0 +1,100 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the jalview package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: jalview\n"
+"Report-Msgid-Bugs-To: jalview at packages.debian.org\n"
+"POT-Creation-Date: 2021-02-19 16:02+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Allow downloading data automatically from identifiers.org?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"Automatically downloading a list of URL templates for biological databases "
+"from identifiers.org is a convenience for users but can be deactivated as it "
+"causes an automatic ping to a web server. Users can enable or disable this "
+"service from their own configuration file."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:2001
+msgid "Allow fetching news from the Jalview website?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:2001
+msgid ""
+"Fetched news are put into a popup window at startup. They are informative to "
+"users but imply they are automatically grasped from the Jalview website. The "
+"latter records the IP address of the machine to make statistics about the "
+"number of users. Users can enable or disable news fetching from their own "
+"configuration file."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:3001
+msgid "Allow querying the Jalview website about a user questionnaire?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:3001
+msgid ""
+"User questionnaires are proposed from time to time on the Jalview website, "
+"there can be an automatic query to look for them at startup but this implies "
+"pinging the Jalview website, which records the IP address of the machine to "
+"make statistics about the number of users. Users can enable or disable the "
+"query from their own configuration file."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:4001
+msgid "Allow pinging the JABAWS web services at startup?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:4001
+msgid ""
+"The JABAWS web services give access to larger analysis features than if one "
+"runs only the standalone application. The ping at startup leads to "
+"discovering the available services. Users can enable or disable the startup "
+"discovery from their own configuration file or from the settings window in "
+"the application."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:5001
+msgid "Allow downloading HTML templates automatically from Github?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:5001
+msgid ""
+"This feature allows to download the latest 'BioJS' HTML export template "
+"automatically from the Github repository at startup. Users can enable or "
+"disable this feature from their own configuration file."
+msgstr ""


=====================================
debian/postinst
=====================================
@@ -0,0 +1,148 @@
+#!/bin/sh -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" -a ! -e /etc/jalview_properties ]; then
+    # Creating the configuration file from scratch, we will put comments inside.
+
+    # Put some introductory lines in the configuration file.
+    echo "# This file is copied into a user's home directory by" > /etc/jalview_properties
+    echo "# the jalview wrapper script when no .jalview_properties file" >> /etc/jalview_properties
+    echo "# exists." >> /etc/jalview_properties
+    echo "#" >> /etc/jalview_properties
+    echo "# Changes to this file will not affect the jalview configuration" >> /etc/jalview_properties
+    echo "# for existing users (at least not at the time of writing)" >> /etc/jalview_properties
+    echo "" >> /etc/jalview_properties
+    echo "# Configure the automatic display of the Jalview Example Project for new users" >> /etc/jalview_properties
+    echo "# default is true" >> /etc/jalview_properties
+    echo "# SHOW_STARTUP_FILE=false" >> /etc/jalview_properties
+    echo "" >> /etc/jalview_properties
+    echo "# Location of the file to be loaded in on startup if SHOW_STARTUP_FILE is true" >> /etc/jalview_properties
+    echo "# default is https://www.jalview.org/examples/exampleFile_2_7.jvp" >> /etc/jalview_properties
+    echo "STARTUP_FILE=/usr/share/doc/jalview/examples/exampleFile_2_7.jvp" >> /etc/jalview_properties
+    echo "" >> /etc/jalview_properties
+
+    # If news fetching is not allowed by debconf input, uncomment the line in
+    # the configuration file.
+    echo "# Connection: https://www.jalview.org/feeds/desktop/rss" >> /etc/jalview_properties
+    echo "# uncomment to stop Jalview checking the www.jalview.org news feed" >> /etc/jalview_properties
+    db_get jalview/news
+    if [ "$RET" = "true" ]; then
+        echo '# NONEWS=true' >> /etc/jalview_properties
+    else
+        echo 'NONEWS=true' >> /etc/jalview_properties
+    fi
+    echo "" >> /etc/jalview_properties
+
+    # If the questionnaire querying is not allowed by debconf input, uncomment
+    # the line in the configuration file.
+    echo "# Uncomment to disable jalview's retrieval of https://www.jalview.org/cgi-bin/questionnaire.pl" >> /etc/jalview_properties
+    echo "# this service is used to make Jalview users aware" >> /etc/jalview_properties
+    echo "# of any community questionnaires currently active on www.jalview.org" >> /etc/jalview_properties
+    echo "# Allowed values are true/false. Default is true." >> /etc/jalview_properties
+    db_get jalview/questionnaire
+    if [ "$RET" = "true" ]; then
+        echo '# NOQUESTIONNAIRES=true' >> /etc/jalview_properties
+    else
+        echo 'NOQUESTIONNAIRES=true' >> /etc/jalview_properties
+    fi
+    echo "" >> /etc/jalview_properties
+
+    # If the identifiers service ping is not allowed by debconf input,
+    # uncomment the line in the configuration file.
+    echo "# Disable Jalview's connections to various web services" >> /etc/jalview_properties
+    echo "#" >> /etc/jalview_properties
+    echo "# Connection: https://www.jalview.org/services/identifiers" >> /etc/jalview_properties
+    echo "# uncomment to stop jalview retrieving a list of URL templates for" >> /etc/jalview_properties
+    echo "# biological databases originally provided by identifiers.org" >> /etc/jalview_properties
+    db_get jalview/identifiersservice
+    if [ "$RET" = "true" ]; then
+        echo '# NOIDENTIFIERSSERVICE=true' >> /etc/jalview_properties
+    else
+        echo 'NOIDENTIFIERSSERVICE=true' >> /etc/jalview_properties
+    fi
+    echo "" >> /etc/jalview_properties
+
+    # If discovering the JABA web services is not allowed by debconf input,
+    # uncomment the line in the configuration file.
+    echo "# Uncomment to prevent jalview automatically contacting" >> /etc/jalview_properties
+    echo "# https://www.compbio.dundee.ac.uk/jabaws/ to discover web services" >> /etc/jalview_properties
+    echo "# When disabled, users can still initiate service discovery via a button" >> /etc/jalview_properties
+    echo "# in the 'Web Services' menu." >> /etc/jalview_properties
+    echo "# Allowed values are true or false. Default is true." >> /etc/jalview_properties
+    db_get jalview/jws2services
+    if [ "$RET" = "true" ]; then
+        echo '# SHOW_JWS2_SERVICES=false' >> /etc/jalview_properties
+    else
+        echo 'SHOW_JWS2_SERVICES=false' >> /etc/jalview_properties
+    fi
+    echo "" >> /etc/jalview_properties
+
+    # If looking for HTML templates is not allowed by debconf input, uncomment
+    # the line in the configuration file.
+    echo "# Connection: https://raw.githubusercontent.com/jalview/exporter-templates/master/biojs/package.json" >> /etc/jalview_properties
+    echo "# uncomment to disable download of the latest 'BioJS' HTML export template" >> /etc/jalview_properties
+    db_get jalview/htmltemplates
+    if [ "$RET" = "true" ]; then
+        echo '# NOHTMLTEMPLATES=true' >> /etc/jalview_properties
+    else
+        echo 'NOHTMLTEMPLATES=true' >> /etc/jalview_properties
+    fi
+elif [ "$1" = "configure" -a -e /etc/jalview_properties ]; then
+    # The configuration file already exists, we are just updating its contents.
+
+    altered_File="$(mktemp -d)/jalview_properties"
+
+    # If news fetching is not allowed by debconf input, uncomment the line in
+    # the configuration file.
+    db_get jalview/news
+    if [ "$RET" = "true" ]; then
+        sed 's/.*NONEWS=.*/# NONEWS=true/' /etc/jalview_properties > $altered_File
+    else
+        sed 's/.*NONEWS=.*/NONEWS=true/' /etc/jalview_properties > $altered_File
+    fi
+    cp $altered_File /etc/jalview_properties
+
+    # If the questionnaire querying is not allowed by debconf input, uncomment
+    # the line in the configuration file.
+    db_get jalview/questionnaire
+    if [ "$RET" = "true" ]; then
+        sed 's/.*NOQUESTIONNAIRES=.*/# NOQUESTIONNAIRES=true/' /etc/jalview_properties > $altered_File
+    else
+        sed 's/.*NOQUESTIONNAIRES=.*/NOQUESTIONNAIRES=true/' /etc/jalview_properties > $altered_File
+    fi
+    cp $altered_File /etc/jalview_properties
+
+    # If the identifiers service ping is not allowed by debconf input,
+    # uncomment the line in the configuration file.
+    db_get jalview/identifiersservice
+    if [ "$RET" = "true" ]; then
+        sed 's/.*NOIDENTIFIERSSERVICE=.*/# NOIDENTIFIERSSERVICE=true/' /etc/jalview_properties > $altered_File
+    else
+        sed 's/.*NOIDENTIFIERSSERVICE=.*/NOIDENTIFIERSSERVICE=true/' /etc/jalview_properties > $altered_File
+    fi
+    cp $altered_File /etc/jalview_properties
+
+    # If discovering the JABA web services is not allowed by debconf input,
+    # uncomment the line in the configuration file.
+    db_get jalview/jws2services
+    if [ "$RET" = "true" ]; then
+        sed 's/.*SHOW_JWS2_SERVICES=.*/# SHOW_JWS2_SERVICES=false/' /etc/jalview_properties > $altered_File
+    else
+        sed 's/.*SHOW_JWS2_SERVICES=.*/SHOW_JWS2_SERVICES=false/' /etc/jalview_properties > $altered_File
+    fi
+    cp $altered_File /etc/jalview_properties
+
+    # If looking for HTML templates is not allowed by debconf input, uncomment
+    # the line in the configuration file.
+    db_get jalview/htmltemplates
+    if [ "$RET" = "true" ]; then
+        sed 's/.*NOHTMLTEMPLATES=.*/# NOHTMLTEMPLATES=true/' /etc/jalview_properties > $altered_File
+    else
+        sed 's/.*NOHTMLTEMPLATES=.*/NOHTMLTEMPLATES=true/' /etc/jalview_properties > $altered_File
+    fi
+    cp $altered_File /etc/jalview_properties
+fi
+
+#DEBHELPER#


=====================================
debian/postrm
=====================================
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+# If purging the package, remove the configuration file if it exists.
+if [ "$1" = "purge" -a -e /etc/jalview_properties ]; then
+    rm -f /etc/jalview_properties
+fi
+
+#DEBHELPER#


=====================================
debian/rules
=====================================
@@ -12,6 +12,9 @@ override_dh_clean:
 	dh_clean
 	# Removing the help/ folder that was put into resources/
 	$(RM) -rf resources/help/
+	# Removing the file to create .build_properties, and .build_properties itself.
+	if [ -e write_build_properties_file.sh ]; then $(RM) write_build_properties_file.sh ; fi
+	if [ -e resources/.buildbuild_properties ]; then $(RM) resources/.build_properties ; fi
 	# Putting gradle file back in place, removing Maven's pom.
 	if [ -e buildUpstream.gradle ] ; then mv buildUpstream.gradle build.gradle ; fi
 	$(RM) pom.xml
@@ -19,6 +22,10 @@ override_dh_clean:
 override_dh_auto_configure:
 	# Putting help folder inside resources so that it enters the jar.
 	cp -a help/help/ resources/
+	# Putting the .build_properties file needed by upstream in the resources.
+	sed 's/\(VERSION_NUMBER\)/$(DEB_VERSION)/' debian/write_build_properties_file.sh.in > write_build_properties_file.sh && \
+	        chmod a+x write_build_properties_file.sh && \
+	        ./write_build_properties_file.sh
 	# Putting gradle stuff out of the way and placing pom.xml at root, with a
 	# hack to put the package version number inside the pom.
 	mv build.gradle buildUpstream.gradle
@@ -35,6 +42,11 @@ override_dh_auto_install:
 	jh_manifest
 	jh_depends
 
+override_dh_installexamples:
+	dh_installexamples
+	# Providing an example at startup instead of having to load it from the Internet.
+	cp examples/exampleFile_2_7.jar debian/$(DEB_SOURCE)/usr/share/doc/jalview/examples/exampleFile_2_7.jvp
+
 override_dh_fixperms:
 	# Setting the packaged example file as not executable.
 	chmod a-x debian/$(DEB_SOURCE)/usr/share/doc/jalview/examples/uniref50.fa


=====================================
debian/templates
=====================================
@@ -0,0 +1,46 @@
+Template: jalview/identifiersservice
+Type: boolean
+Default: true
+_Description: Allow downloading data automatically from identifiers.org?
+ Automatically downloading a list of URL templates for biological databases
+ from identifiers.org is a convenience for users but can be deactivated as it
+ causes an automatic ping to a web server.
+ Users can enable or disable this service from their own configuration file.
+
+Template: jalview/news
+Type: boolean
+Default: true
+_Description: Allow fetching news from the Jalview website?
+ Fetched news are put into a popup window at startup. They are informative to
+ users but imply they are automatically grasped from the Jalview website. The
+ latter records the IP address of the machine to make statistics about the
+ number of users.
+ Users can enable or disable news fetching from their own configuration file.
+
+Template: jalview/questionnaire
+Type: boolean
+Default: true
+_Description: Allow querying the Jalview website about a user questionnaire?
+ User questionnaires are proposed from time to time on the Jalview website,
+ there can be an automatic query to look for them at startup but this implies
+ pinging the Jalview website, which records the IP address of the machine to
+ make statistics about the number of users.
+ Users can enable or disable the query from their own configuration file.
+
+Template: jalview/jws2services
+Type: boolean
+Default: true
+_Description: Allow pinging the JABAWS web services at startup?
+ The JABAWS web services give access to larger analysis features than if one
+ runs only the standalone application. The ping at startup leads to discovering
+ the available services.
+ Users can enable or disable the startup discovery from their own configuration
+ file or from the settings window in the application.
+
+Template: jalview/htmltemplates
+Type: boolean
+Default: true
+_Description: Allow downloading HTML templates automatically from Github?
+ This feature allows to download the latest 'BioJS' HTML export template
+ automatically from the Github repository at startup.
+ Users can enable or disable this feature from their own configuration file.


=====================================
debian/wrappers/jalview
=====================================
@@ -1,4 +1,18 @@
 #!/bin/sh
 set -e
 
-java -jar /usr/share/java/jalview.jar "$@"
+ARG1=$1
+
+# copy the default settings if no user jalview settings file exists
+if [ -n "${HOME}" -a -e /etc/jalview_properties -a \! -e ${HOME}/.jalview_properties ]; then
+ cp /etc/jalview_properties ${HOME}/.jalview_properties
+fi
+ 
+# check to see if $1 is set and is not start of other cli set args
+OPEN=""
+if [ -n "$ARG1" -a "$ARG1" = "${ARG1#-}" ]; then
+ # first argument exists and does not start with a "-"
+ OPEN="-open"
+fi
+
+java -jar /usr/share/java/jalview.jar $OPEN "$@"


=====================================
debian/write_build_properties_file.sh.in
=====================================
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+echo "#--Jalview Build Details--" > resources/.build_properties
+echo "#"$(date --date="$(sed -n 's/^ --.*, //; s/ [\+-][0-9]*//p' debian/changelog | head -n1)" +"%Y-%m-%d %H:%M:%S") >> resources/.build_properties
+echo "BUILD_DATE="$(date --date="$(sed -n 's/^ --.*, //; s/ [\+-][0-9]*//p' debian/changelog | head -n1)" +"%H\\:%M\\:%S %d %B %Y") >> resources/.build_properties
+echo "INSTALLATION=deb" >> resources/.build_properties
+echo "VERSION=VERSION_NUMBER" >> resources/.build_properties



View it on GitLab: https://salsa.debian.org/java-team/jalview/-/compare/a9e093130a3a616b9bb06791a05f4f5f2f0ff3a1...40c27ce94eef7e434a4adb12ddb14e9535fda313

-- 
View it on GitLab: https://salsa.debian.org/java-team/jalview/-/compare/a9e093130a3a616b9bb06791a05f4f5f2f0ff3a1...40c27ce94eef7e434a4adb12ddb14e9535fda313
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210220/18ac876e/attachment.html>


More information about the pkg-java-commits mailing list