Home | History | Annotate | Download | only in docs
      1 <h2>JDS RPM Rules</h2>
      2 
      3 <style>
      4 li {padding:3px;}
      5 </style>
      6 
      7 <p>
      8 The following RPM rules apply for hacking on the JDS sources -
      9 <p>
     10 
     11 <h3>Scripts</h3>
     12 
     13 <ul>
     14   <li>
     15 	pre/post-install/remove scripts should never touch files belonging
     16 	to another package.
     17   </li>
     18 
     19   <li>
     20 	Never add or delete files in pre/post-install scripts. Adding files
     21 	will result in files in the file system that do not belong to any
     22 	packages. Removing files will cause the package to fail 
     23 	verification (rpm --verify) and result in warnings about missing
     24 	files when you uninstall the package.
     25   </li>
     26 
     27   <li>
     28 	If you change a file in a pre/post-install script, make sure you
     29 	use 
     30 	<a href="http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-CONFIG-DIRECTIVE">%verify</a>
     31 	directive to tell RPM not to verify the MD5 checksum, size and
     32 	modification of that file when running rpm --verify -
     33 	<blockquote>
     34 		<tt>%verify (not md5 size mtime) file.conf</tt>
     35 	</blockquote>
     36   </li>
     37 
     38   <li>
     39 	 The script fragment for registering help docs with scrollkeeper
     40 	should be "<tt>scrollkeeper-update -q</tt>" and nothing else.
     41   </li>
     42 
     43   <li>
     44 	 Do not use the "j" or "z" flags of tar to uncompress sources 
     45 	as it's not portable on Solaris. Use 
     46 	"<tt>bzip2 -dc %SOURCEn | tar xf -</tt>"
     47   </li>
     48 </ul>
     49 
     50 <h3>Dependencies</h3>
     51 
     52 <ul>
     53   <li>
     54 	When <tt>%pre</tt> and <tt>%post</tt> scripts depend on other 
     55 	packages (almost always the case), the package has to use 
     56 	the <tt>PreReq: <i>other-package</i></tt> tag to define that
     57 	dependency. This tag ensures that other-package is installed 
     58 	before the package that defines the tag. The Requires tag 
     59 	only specifies that both packages need to be installed to 
     60 	get a running system, but the order is not important.
     61 	<br/><br/>
     62 	For example, if <tt>%post</tt> calls <tt>scrollkeeper-update</tt>,
     63 	then the spec file must include "<tt>PreReq: scrollkeeper</tt>".
     64   </li>
     65 
     66   <li>
     67 	 When a previously delivered package obsoleted by new one, and 
     68 	therefore no longer delivered, the new package has to use the 
     69 	"Obsoletes" tag to avoid problems with upgrades. If the new 
     70 	package still provides the old code, also use the "Provides" 
     71 	tag.  For example, if package <tt>bonobo-activation</tt> is 
     72 	merged into <tt>libbonobo</tt> put this into <tt>libbonobo.spec</tt> -
     73 	<pre>
     74 		%define bonobo_activation_version 2.4.0
     75 		Obsoletes: bonobo-activation < %{bonobo_activation_version}
     76 		Provides: bonobo-activation = %{bonobo_activation_version}
     77 		Obsoletes: bonobo-activation-devel < %{bonobo_activation_version}
     78 		Provides: bonobo-activation-devel = %{bonobo_activation_version}
     79 	</pre>
     80   </li>
     81 </ul>
     82 
     83 <h3>Files</h3>
     84 
     85 <ul>
     86   <li>
     87 	 Always use the most specific directory variable, e.g. 
     88 	<tt>%_bindir</tt> instead of <tt>%_prefix/bin</tt> and 
     89 	<tt>%_datadir</tt> instead of <tt>%_prefix/share</tt>.
     90   </li>
     91 
     92   <li>
     93 	 Use the 
     94 	<tt><a href="http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-CONFIG-DIRECTIVE">%config</a></tt>
     95 	directive for config files.
     96   </li>
     97 
     98   <li>
     99 	Do not include libtool's .la files in the packages. Not even in the 
    100 	devel package.
    101   </li>
    102 
    103   <li>
    104 	Do not include static libs unless absolutely necessary, in that case, 
    105 	include it in the devel package.
    106   </li>
    107 
    108   <li>
    109 	Include lib*.so.* in the base package, lib*.so in the -devel package.
    110   </li>
    111 </ul>
    112 
    113 <h3>Patches</h3>
    114 
    115 <ul>
    116   <li>
    117 	All patches should be p1 (i.e. the files names in the diff start with the 
    118 	top level source dir and you use <tt>%patchn -p1</tt> in the spec file.
    119   </li>
    120 
    121   <li>
    122 	The patch naming convention should be the following - 
    123 	<tt>module_name-nn-descriptive_text.diff</tt>, where <tt><i>modules_name</i></tt>
    124 	is the base name of the spec file without the .spec, <tt><i>nn</i></tt> is the 
    125 	number of the patch (<tt><i>Patchnn</i></tt> tag in the spec file) and 
    126 	<tt><i>descriptive_text</i></tt> is a very short description of what the patch 
    127 	does or why it is needed, e.g.:
    128 	<blockquote><tt>
    129 		gst-02-fix-registry-crashes.diff.
    130 	</tt><blockquote>
    131   </li>
    132 
    133   <li>
    134 	When you remove a patch, make sure that patches with higher numbers are renumbered 
    135 	(update <tt><i>Patchnn</i></tt> tag in the spec file, rename file, cvs remove 
    136 	old_file, cvs add new_file). There is a script in the <b>scripts</b> directory to
    137 	automatically reorder patches - use it carefully if you do so.
    138   </li>
    139 </ul>
    140