DICE and LCFG Software Guidelines

Similar documents
Python RPM Porting Guide Release 0.1

PS1-MOPS SOURCE CODE DOCUMENTATION

BUILDING YOUR OWN RPMS

Integration of UNICORE Components into Linux Systems

RPM How To: Intro. What is RPM? Why Building RPMS? Who is this howto designed for? Who can build RPMS? What do I need to build RPMS?

Difficult to keep track of different versions of a file if several people are making updates

Building Linux Packages with RPM

Red Hat Enterprise Linux 7 RPM Packaging Guide

Construction: version control and system building

CS11 Advanced C++ Fall Lecture 4

Software Deployment Packaging, Installation, Updates

Building RPMs for Native Application Hosting

Overview. What are community packages? Who installs what? How to compile and install? Setup at FSU RCC. Using RPMs vs regular install

Transitioning from Spread 3.17.x to Spread 4.0

PicSOM Development. Developer s Manual for PicSOM picsom-dev $Revision: 1.61 $. $Date: 2004/08/17 09:00:25 $

Construction: version control and system building

Open Build Service (OBS) Packager Workshop

Kernel Korner Exploring Dynamic Kernel Module Support (DKMS)

Version control with RCS and CVS An introduction. Markus Bjartveit Krüger

Software Packaging with RPM

GLIMMER, Version Control and Build Systems

ag.el Documentation Release 0.45 Wilfred Hughes

OCTVQE Zaptel Echo Canceller (PRELIMINARY)

Common CVS Command Summary

Red Hat Enterprise Linux 7

Implementing an EtherNet/IP Device DTM

Building RPMs. Josko Plazonic. & Thomas Uphill. January 25, Building RPMs. Josko Plazonic. Princeton University.

Makefile Brief Reference

CS11 Intro C++ Spring 2018 Lecture 4

Introduction to CVS. Sivan Toledo Tel-Aviv University

CptS 360 (System Programming) Unit 3: Development Tools

Howto: CVS to Git Efficient Multi-Module CVS Migration

Draft: MLDesigner and LinCVS

Tcl Extension Architecture Developer s Guide DRAFT

The vc bundle. June 11, 2018

Introduction to Perl 6 Documentation

Eli System Administration Guide

ESTABLISHED Paul Kunz SLAC. Overview. Examples. Expose the downsides. Benefits. Risks and Costs. Building with Automake 1 Paul F.

MRO Delay Line. Coding and Documentation Guidelines for Prototype Delay Line Software. John Young. rev June 2007

Configuration. Monday, November 30, :28 AM. Configuration

Chapter 1 - Introduction. September 8, 2016

Documentation External Synchronization FirstSpirit

Additional Guidelines and Suggestions for Project Milestone 1 CS161 Computer Security, Spring 2008

These are instructions for building Perl under DOS (or w??), using DJGPP v2.03 or later. Under w95 long filenames are supported.

History of the development of Lua

Typesetting Technical Reports Using LaTeX

Files

Adding Applications to the GNOME Software Center

We d like to hear your suggestions for improving our indexes. Send to

Python Project Documentation

LECTURE 26. Documenting Python

RHCE BOOT CAMP. Various Additional Topics

Using CVS 1 of 18. Using CVS. C oncurrent V ersions System - Jeremy Mates

About CVS. 1 Version Control - what is it? why is it useful?

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2

ClickLearn Studio. - A technical guide 9/18/2017

Why Use the Autotools?...xviii Acknowledgments... xx I Wish You the Very Best... xx

ACE Operation Manual

Fedora Draft Documentation Packager's Guide

JRA4 COMMON SOFTWARE SOFTWARE USER REQUIREMENTS JRA4-SPE Revision : 1.0. Date : 04/07/2005

Programmer s Reference

Building the X Window System from the X.org Source Distribution 1

CAAM 420 Fall 2012 Lecture 27. Prachi Bhawalkar

National Aeronautics and Space and Administration Space Administration. CFE CMake Build System

EDDA. Fredrik Jonsson. December 7, Electronic Design Description Automation

A Smart Way to Manage Packages in Yocto Project

Study Guide: Directory and le structure

The make4ht build system

Configuration and Build System

WebTool Hacking HOWTO

Version Control. DIFF Example. Version Control, continued. Lecture 12: Version Control & RCS. Things change

Red Hat Enterprise Linux 6

User Manual. ACM MAC Word Template. (MAC 2016 version)

KMyMoney Project Handbook

Caliber 11.0 for Visual Studio Team Systems

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

COSC345 Software Engineering. Version Control

Shell Project Part 1 (140 points)

Make. Dependency Graphs

Package Manager. RPM (Red Hat Package Manager)

The pkgsrc wrapper framework

Manual Shell Script Linux If File Exists Wildcard

R packages from a Fedora perspective

Development tools: Version control, build tools, and integrated development environments 1

Explaining & Accessing the SPDX License List

Please choose the best answer. More than one answer might be true, but choose the one that is best.

Java and the Future of SNePS SneRG Technical Note 31

How-To Build a Simple Slack Package

The build2 Package Manager

The WebGUI Runtime Environment. Roy Johnson Plain Black Corporation

7. METHODOLOGY FGDC metadata

*roff code is suitable for display on a terminal using nroff(1), normally via man(1), or printing using troff(1).

Doxygen A source documentation tool.

An Unexpected Journey. Implementing License Matching using the SPDX License List

LAT-TD-xxxxx-xx May 21, 2002

This class is a formatter that takes Pod and renders it as XHTML validating HTML.

X.Org and XFree86 Version Numbering Schemes

M E R C U R I A L (The Source Control Management)

Maxima Code Status and Plans

Configuration Management and Branching/Merging Models in iuml. Ref: CTN 101 v1.2

Transcription:

DICE and LCFG Software Guidelines by paul@dcs.ed.ac.uk DICE Computing Environment Project Division of Informatics University of Edinburgh 1 Introduction This document describes the standards to be used for system software produced within the Division of Informatics. This is intended to be an evolving document, based on experiences and recommendations from all Divisional COs, and suggestions for changes and additions are always welcome. It is hoped that these guidelines will help to make Division software easier to work with, more reliable, and accessible to more people. In particular, all local software in use on production systems must have a corresponding source module in the DICE CVS repository, including up-to-date documentation, and adequate instructions for regenerating the software from the sources. 2 CVS and Packages Names The CVS repository has a flat structure with an entry at the top level for each module. Each module has a unique name and normally corresponds to one SRPM of the same name (the SRPM may generate several RPMS). lcfg modules are intended to be exportable as part of the LCFG configuration system, and should not contain any site-specific code. LCFG component (object) modules should have names of the form: lcfg-component although the module name should not be used to determine which RPMs contain components (this can be determined by the RPM group - see section 6). Copies of imported packages which have significant local modifications should be named: dice-package There are no other restrictions on module names. 3 Version Numbering Module version numbers should consist of three components (X.Y.Z), interpreted as follows: X is a major version number which should be changed when there are substantial changes to the code base or interfaces. Y is a minor version number. Odd numbers represent a development version of the package, and even numbers represent a production version. For production version, Z represents a bug-fix level. There should be normally be no significant functional difference between different bugfix levels of the same version, and they should always be be backwards-compatible. For development versions, Z represents a development release number. In this case, there may well be significant differences in functionality between different releases. By convention, Y=99 represents the preparation for the next major version. This means that a new package should be developed at 0.99.Z, and move to 1.0.0 for the first production release. CVS tags should be used to identify all files corresponding to a particular version of the package. The tags should have the form: name X Y Z The name is the name of the module with any - s replaced with s. Notice that the RPM release number is not part of this versioning scheme. The RPM release number will normally always be 1, but it may increase if the packaging is changed without changing the contents of the CVS repository (for example, if a specfile which is not stored in the CVS is changed). 4 Pathnames The packages dice-config and lcfg-config provide symbolic names for the common pathnames

DICE and LCFG Software Guidelines (2) used by DICE and LCFG software. The files dice.mk and lcfg.mk can be included using GNU make as follows: include dice.mk include lcfg.mk Appendices A and B list the symbols currently provided and describe their use. Additional suggestions for these files are welcome. All packages should configure themselves at build time to use these pathnames wherever appropriate; this allows the pathnames to be changed by a simple rebuild, either for future evolution (maybe on different platforms), or by different sites (who might supply a different lcfg-config package). Notice that the example files given in appendices C and E contain explicit pathnames; these would normally be instantiated at build time using a package such as dice-buildtools (see 5) or GNU autoconf. The file lcfg.mk will define legacy values for LCFG pathnames if the environment variable LCFG COMPAT is set to yes, and new pathnames if it is set to no. At the time of writing, the DICE LCFG system is still using these legacy pathnames and the default is to use legacy pathnames. Other filenames should conform to the Linux Filesystem Hierarchy Standard (FHS) 1 wherever possible. ChangeLog A history of modifications. This should include a brief description of changes between versions. The Emacs command M-x add-change-log-entry will automatically add a correctly-formatted entry, and cvs2cl will create a ChangeLog from the comments in the CVS repository. 6 RPMs Generated RPMs should include some standard headers: Vendor: University of Edinburgh Copyright: GPL Group: GROUP (see below) Packager: name <mail> The Distribution field is reserved for a future standard use and should not be assigned. The following groups should be used where appropriate: LCFG/Components - LCFG components. LCFG/Doc - LCFG documentation. 5 Building and Packaging The package dice-buildtools 2 provides a set of makefile targets to assist with building and packaging DICE software from the CVS repository. Use of dice-buildtools is recommended, since this helps to ensure conformance to the standards, and provides a common framework which will be familiar to other users. Feedback and suggestions for improvements to this process are welcome. Whether or not dice-buildtools is used, the following files must appear in the CVS and the %doc section of any corresponding RPM: README a short description of the module for users. README.BUILD instructions for packaging and installing the module from the CVS sources. In particular, it must be clear how to re-configure the package and generate the the corresponding RPMs. 1 http://www.pathname.com/fhs/ 2 http://www.dice.informatics.ed.ac.uk/doc/dice-buildtools.pdf LCFG/Defaults - LCFG default resources. LCFG/System - Other LCFG-related system software. DICE/Applications - DICE (user) applications. DICE/System - DICE system software. DICE/Config - DICE local configuration files. DICE/Doc - DICE documentation. The RPM must contain an accurate %changelog section. The utility cl2rpm can be used to generate this automatically from a GNU-format ChangeLog file. (dice-buildtools performs this automatically). Care should be taken to ensure that RPMs do not depend unnecessarily on the local environment. Some common problems include: Files should not be owned by local users; use %defattr (see the example SPEC file in appendix C).

DICE and LCFG Software Guidelines (3) The RPM BuildRoot should not refer to some local directory (The value shown in the sample SPEC file works well). If documentation compilation requires specific local tools (such as LaTeX styles), then it is useful to include a copy of the compiled documentation in the SRPM. This allows the RPM to be recompiled at a remote site, without rebuilding the documentation. to create, and can easily be converted into other formats such as HTML, manual pages, or TeX. Appendix D shows a sample POD file. The POD file should be installed in $(LCFGPOD)/component.pod The component module must also contain a manual page, which can easily be generated automatically from the POD file: 7 LCFG components In addition to the normal code/documentation RPM, LCFG component modules should generate a separate RPM for the default resources. This is necessary so that the default resources can be collated on separate servers. This is not difficult, and Appendix C shows a sample RPM SPEC file which can be used as a template. 7.1 Component Code The document Writing LCFG Components 3 provides a detailed description of the semantics, conventions and tools for creation of LCFG components. The LCFG component code should be packaged in an RPM with the name lcfg-component. This should include the LCFG component itself and any small supporting programs or other files. If there are significant related programs which may be optional, these can be packaged as separate RPMS; for example, lcfgfoo-server and lcfg-foo-client (as well as lcfg-foo for the component itself). The component code should not contain any sitespecific configuration files. These should be supplied by separate modules. In many cases, the component RPM is not architecture-dependent and should have the BuildArch set to noarch. The component should use the directories specified in lcfg.mk (see Appendix B). 7.2 Component Documentation The original LCFG doc method is now deprecated and should not be supported. However, each component module must include a documentation file in POD (plain-old-documentation) format 4, listing the supported methods and resources, together with a brief description of the component. This format is very easy 3 http://www.lcfg.org/doc/lcfg-ngeneric.pdf 4 perldoc perlpod pod2man --section=8 --release=release: ver --center=lcfg/components foo.pod >lcfg-foo.8 Notice the standard headings, and also the fact that the manual page name includes the lcfg- prefix. The manual page should be included in the same RPM as the component source for installation in section 8 of the manual pages on the local machine. 7.3 Default Resources Each component module must include a file with the name component-schema.def listing the supported resources, together with appropriate default values and meta-resources (see the document LCFG Adaptors for XML Profiles 5 ). The defaults file must be siteindependent, so it should not include any site-specific information; site-specific default values should be provided by a site header file. The schema is a schema version number which should be incremented whenever the resource schema is changed including this as part of the filename allows a single server to support clients with different component versions. A resource with the name schema should also be defined with the schema version as the default value. This allows components to check for mismatches in schema versions. The defaults file should be included in the component RPM and installed in $(LCFGCLIENTDEF)/component-schema.def An LCFG profile server needs access to the default files for all the clients which it serves. This may include serving multiple schema versions. For this reason, each module should also generate a separate 5 http://www.lcfg.org/doc/lcfg-profile.pdf

DICE and LCFG Software Guidelines (4) RPM with the name lcfg-component-defaultssschema, containing only a copy of the defaults file, installed in foobar-1.2.b03-12 Becomes: $(LCFGSERVERDEF)/component-schema.def Using a relocatable RPM for the defaults file is straightforward and helpful for sites which store their sources in a different location (see the example SPEC file in Appendix C). 8 Documentation Some documentation will be included with the corresponding code module. Other, more general, documentation may be managed as a separate module. Documentation files should be installed in the directories $(TYPEFORMAT) where TYPE is either DICE or LCFG and FORMAT is: foobar-1.2.b03-12.dice.3 This ensures that locally modified versions take precedence over the original copies, but it preserves the original name and version for dependency relationships. However, it means that different release numbers of the RPM contain different code (not just packaging differences), and there is no easy way of tracking the development of the local changes in the CVS repository. Better suggestions for handling this are welcome. PDF PDF files named as module.pdf HTML subdirectories with the same names as the modules, containing an index.html file together with any other referenced HTML files. BIB latex-style bib files (with the name module.bib) containing meta-information for the documents. These can be used to generate indices, or for inclusion in bibliographies. See Appendix E for an example. POD POD files. It is useful to install POD versions of manual pages in this directory so that they can be published on the web server. 9 Importing and Modifying External Packages If an external package is imported and modified sufficiently that it becomes a separate fork of the original code, then that package can be treated just like any other local package, with full source code in the CVS repository, and a new local version numbering scheme. It is recommended the the package be named dicepackage so that the original provenance is clear. It is up to the person modifying the package to decide whether the RPM reflects this by including the original tarball and local patches, or whether it simply contains the final local code. There are currently no good recommendations for managing small changes to external packages, especially if the external code base is large. By convention, local RPMS are created with a postfix on the RPM revision. For example:

DICE and LCFG Software Guidelines (5) Appendix A DICE Symbols Defined in dice.mk DICEBIB Directory for BIB files. DICEBIBURL URL for BIB files. DICEBIN Directory for user binaries. DICEDOC Base directory for documentation. DICEHTML Directory for HTML files. DICEHTMLURL URL for HTML files DICELIB Base directory for read-only files. DICEMAN Directory for man pages. DICEPDF Directory for PDF files. DICEPDFURL URL for PDF files. DICEPERL Directory for Perl modules. Normally in the subdirectory DICE::. DICEPOD Directory for POD files. DICESBIN Directory for system binaries. DICEURL Base URL for documentation Based on version 1.0.4 of dice-config.

DICE and LCFG Software Guidelines (6) Appendix B LCFG Symbols Defined in lcfg.mk LCFGBIB LCFGBIBURL LCFGBIN LCFGCLIENTDEF LCFGCONF LCFGCONFIGMSG LCFGDATA LCFGDEF LCFGDOC LCFGHTML LCFGHTMLURL LCFGLIB LCFGLOCK LCFGLOG LCFGMAN LCFGPDF LCFGPDFURL LCFGPERL LCFGPOD LCFGROTATED LCFGSBIN LCFGSERVERDEF LCFGSTATUS LCFGTMP LCFGURL Based on version 1.0.7 of lcfg-config. Directory for BIB files. URL for BIB files. Directory for user binaries. Directory for default resource files used by client Directory for generated files to be preserved between object runs. Files are normally prefixed with the module name, or stored in subdirectories with the same name as the module. A message stating whether the configuration variables have been set to old-style compatibility values, or new-style values. Directory for templates and other fixed configuration files. Files are normally prefixed with the module name, or stored in subdirectories with the same name as the module. Deprecated (use LCFGSERVERDEF) Base directory for documentation. Directory for HTML files. URL for HTML files. Base directory for read-only files. Directory for lock files. Directory for log files. Base directory for man pages. Directory for PDF files. URL for PDF files. Directory for Perl modules. Normally in the subdirectory LCFG::. Directory for POD files. Directory for log rotate files. Directory for system binaries. Directory for default resource files used by server Directory for status files. Directory for temporary files (may be deleted when objects are not running). Files are normally prefixed with the module name, or stored in subdirectories with the same name as the module. Components should not store temporary files in system tmp directories. Base URL for documentation.

DICE and LCFG Software Guidelines (7) Appendix C Sample RPM SPEC File for an LCFG Component Summary: An Example LCFG component Name: lcfg-example Version: 1.0.10 Vendor: University of Edinburgh Release: 1 Copyright: GPL Group: LCFG/Components Source: lcfg-example-1.0.10.src.tgz BuildArch: noarch BuildRoot: /var/tmp/%{name}-build Packager: <paul@dcs.ed.ac.uk> Requires: lcfg-ngeneric %description An example LCFG component. (configured with old-style filenames for compatibility) %prep %setup %build make %install rm -rf $RPM_BUILD_ROOT make PREFIX=$RPM_BUILD_ROOT install %postun [ $1 = 0 ] && rm -f /etc/logrotate.d/lcfg-example exit 0 %files %defattr(-,root,root) %doc ChangeLog README README.BUILD %doc /usr/man/man8/* %doc /usr/lib/lcfg/doc/pod/example.pod /etc/obj/example /usr/lib/lcfg/conf/* /var/obj/conf/example/ /usr/lib/lcfg/defaults/client/example-1.def # These files are only included because we want to include the # source files as documentation since this is an example %doc Makefile specfile example.cin example.pod config.mk %package defaults-s1 Summary: Default resources for lcfg-example Group: LCFG/Defaults Prefix: /usr/lib/lcfg/defaults/server BuildArch: noarch %description defaults-s1 Default resources for the LCFG example component.

DICE and LCFG Software Guidelines (8) (configured with old-style filenames for compatibility) %files defaults-s1 %defattr(-,root,root) /usr/lib/lcfg/defaults/server/example-1.def %clean rm -rf $RPM_BUILD_ROOT

DICE and LCFG Software Guidelines (9) Appendix D Sample LCFG Component POD File =head1 NAME example - An example LCFG component =head1 DESCRIPTION This component is an example only. =head1 RESOURCES =over 4 =item B<server> An example resource which gets substituted into the configuration file. =back

DICE and LCFG Software Guidelines (10) Appendix E Sample BIB File @miscellaneous { dice-guidelines, author = { <paul@dcs.ed.ac.uk> }, organization = { University of Edinburgh }, title = { DICE and LCFG Software Guidelines }, year = { 2001 }, keywords = { dice cvs }, howpublished = { Internal Document }, file = { /usr/lib/dice/doc/pdf/dice-guidelines.pdf }, url = { http://... /dice-guidelines.pdf } }