Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
playground:package-messages [2018/03/12 18:51] – created jeffplayground:package-messages [2018/03/12 20:08] – [Overview] jeff
Line 3: Line 3:
 ===== Overview ===== ===== Overview =====
  
-At present, ''opkg'' and the package-generation system does not provide a formal way to display messages about the package to end users. +At present, ''opkg'' and the package-generation system does not provide a formal way to display //messages// about the package to end users. It does include a package //description//.
  
-Other package-management systems, such as ''dpkg'' on Debian-like systems, and ''pkg'' on FreeBSD-like systems provide a "package message" that can be viewed before installation, as well as displayed on installation.+''pkg'' on FreeBSD-like systems provide a "package message" that can be viewed before installation, as well as displayed on installation
 + 
 +It is not clear that ''dpkg'' or the RPM Package manager provide a similar facility.
  
 This page is a work-in-progress to define the use cases and success criteria for any future development of such a facility. At the time of this writing (March, 2018), there is not a schedule for such development. This page is a work-in-progress to define the use cases and success criteria for any future development of such a facility. At the time of this writing (March, 2018), there is not a schedule for such development.
Line 31: Line 33:
 As a LuCI user, I would like to be able to query any package as to its package message. This would ideally include packages that I have neither downloaded nor installed. As a LuCI user, I would like to be able to query any package as to its package message. This would ideally include packages that I have neither downloaded nor installed.
  
 +==== Package Maintainer Creates Package Message ====
 +
 +As a package maintainer, I would like to be able to clearly and consistently define a message to be presented to users and potential users of the package to indicate notable security concerns, dependencies or conflicts that need to be resolved by the end user, manual steps needed to be taken by the end user to make the package function, and the like.
 +
 +===== Similar Implementations =====
 +
 +This section describes how package messages are handled in other Unix-like operating systems. It is intended as a reference for the preparation of specification of behavior that is appropriate in the OpenWRT environment.
 +
 +==== FreeBSD ====
 +
 +Recent FreeBSD distributions use the ''[[https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=&n=1|pkg]]'' system. 
 +
 +Note that portions of this content may be subject to [[https://www.freebsd.org/copyright/freebsd-license.html|The FreeBSD Copyright]] or other licenses.
 +
 +=== Package Install Example ===
 +
 +<code>
 +jeff@js:~$ sudo pkg upgrade
 +Updating FreeBSD repository catalogue...
 +FreeBSD repository is up to date.
 +All repositories are up to date.
 +Checking for upgrades (59 candidates): 100%
 +Processing candidates (59 candidates): 100%
 +The following 2 package(s) will be affected (of 0 checked):
 +
 +Installed packages to be UPGRADED:
 + nspr: 4.18 -> 4.19
 + ca_root_nss: 3.35 -> 3.36
 +
 +Number of packages to be upgraded: 2
 +
 +533 KiB to be downloaded.
 +
 +Proceed with this action? [y/N]: y
 +[1/2] Fetching nspr-4.19.txz: 100%  241 KiB 246.7kB/   00:01    
 +[2/2] Fetching ca_root_nss-3.36.txz: 100%  292 KiB 299.3kB/   00:01    
 +Checking integrity... done (0 conflicting)
 +[1/2] Upgrading nspr from 4.18 to 4.19...
 +[1/2] Extracting nspr-4.19: 100%
 +[2/2] Upgrading ca_root_nss from 3.35 to 3.36...
 +Extracting ca_root_nss-3.36: 100%
 +Message from ca_root_nss-3.36:
 +
 +********************************* WARNING *********************************
 +
 +FreeBSD does not, and can not warrant that the certification authorities
 +whose certificates are included in this package have in any way been
 +audited for trustworthiness or RFC 3647 compliance.
 +
 +Assessment and verification of trust is the complete responsibility of the
 +system administrator.
 +
 +*********************************** NOTE **********************************
 +
 +This package installs symlinks to support root certificates discovery by
 +default for software that uses OpenSSL.
 +
 +This enables SSL Certificate Verification by client software without manual
 +intervention.
 +
 +If you prefer to do this manually, replace the following symlinks with
 +either an empty file or your site-local certificate bundle.
 +
 +  * /etc/ssl/cert.pem
 +  * /usr/local/etc/ssl/cert.pem
 +  * /usr/local/openssl/cert.pem
 +
 +***************************************************************************
 +</code>
 +
 +=== Package Query Example ===
 +
 +<code>
 +jeff@js:~$ pkg query %M postfix
 +Always:
 +To use postfix instead of sendmail:
 +  - clear sendmail queue and stop the sendmail daemons
 +
 +Run the following commands to enable postfix during startup:
 +  - sysrc postfix_enable="YES"
 +  - sysrc sendmail_enable="NONE"
 +
 +If postfix is *not* already activated in /usr/local/etc/mail/mailer.conf
 +  - mv /usr/local/etc/mail/mailer.conf /usr/local/etc/mail/mailer.conf.old
 +  - install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /usr/local/etc/mail/mailer.conf
 +
 +Disable sendmail(8) specific tasks,
 +add the following lines to /etc/periodic.conf(.local):
 +  daily_clean_hoststat_enable="NO"
 +  daily_status_mail_rejects_enable="NO"
 +  daily_status_include_submit_mailq="NO"
 +  daily_submit_queuerun="NO"
 +
 +If you are using SASL, you need to make sure that postfix has access to read
 +the sasldb file.  This is accomplished by adding postfix to group mail and
 +making the /usr/local/etc/sasldb* file(s) readable by group mail (this should
 +be the default for new installs).
 +
 +If you are upgrading from prior postfix version, please see the README
 +files for recommended changes to your configuration and additional
 +http://www.postfix.org/COMPATIBILITY_README.html
 +</code>
 +
 +=== Implementation ===
 +
 +Primary documentation for the FreeBSD ''pkg'' system may be found at [[https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/|https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/]]
 +
 +FreeBSD does not, in its base configuration, supply GUI utilities for package management.
 +
 +There is [[https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/pkg-files.html#porting-message|specific documentation]] on messaging end users. As of March 2018, it, in part, reads
 +
 +> To display a message when the package is installed, place the message in pkg-message. This capability is often useful to display additional installation steps to be taken after a pkg install or to display licensing information.
 +
 +> When some lines about the build-time knobs or warnings have to be displayed, use ECHO_MSG. pkg-message is only for post-installation steps. Likewise, the distinction between ECHO_MSG is for printing informational text to the screen and ECHO_CMD is for command pipelining:
 +
 +<code>
 +update-etc-shells:
 + @${ECHO_MSG} "updating /etc/shells"
 + @${CP} /etc/shells /etc/shells.bak
 + @( ${GREP} -v ${PREFIX}/bin/bash /etc/shells.bak; \
 + ${ECHO_CMD} ${PREFIX}/bin/bash) >/etc/shells
 + @${RM} /etc/shells.bak
 +</code>
 +
 +==== Debian-based Systems ====
 +
 +Debian-based systems typically use the ''dpkg'' (''.deb'') format and tools, even if overlaid with more user-friendly tools, such as ''apt'', ''apt-get'', or GUI-based tools such as ''synaptic''. The ''dpkg'' format appears to be similar to that used by ''opkg'' although the archive/compression format used is different.
 +
 +Debian packaging has a [[https://wiki.debian.org/Packaging|"jump page" in the Debian wiki]]. There is also a [[https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.en.pdf|good tutorial available]].
 +
 +https://www.debian.org/doc/debian-policy/ does not appear to describe a "package message" functionality. It does discuss the [[https://www.debian.org/doc/debian-policy/#description|Description]] field. 
 +
 +The presence or absence of a "controlling terminal" is [[https://www.debian.org/doc/debian-policy/#controlling-terminal-for-maintainer-scripts|discussed in the debian-policy documentation]]. As of March, 2018, this reads, in part
  
 +> Maintainer scripts are not guaranteed to run with a controlling terminal and may not be able to interact with the user. They must be able to fall back to noninteractive behavior if no controlling terminal is available. Maintainer scripts that prompt via a program conforming to the Debian Configuration Management Specification (see Prompting in maintainer scripts) may assume that program will handle falling back to noninteractive behavior.
  
 +[[https://www.debian.org/doc/debian-policy/#s-maintscriptprompt|Prompting in maintainer scripts]] is also discussed.
  
 +==== RedHat/Fedora/CentOS-based Systems ====
  
 +RedHat, Fedora, and their derivatives use the [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/ch-rpm|RPM Package Manager]]. The details of the package are generally [[http://ftp.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html|specified in a ''.spec'' file]]. The ''.spec'' file contains a "Description" section in the "human readable" preamble.
  
  • Last modified: 2018/03/12 20:49
  • by jeff