Difference between revisions of "Custom package example"

From LFScript
Line 1: Line 1:
 
'''This page is a rough draft, do not rely on it'''
 
'''This page is a rough draft, do not rely on it'''
 
  
 
This is a sample layout which you must use if you are contributing a custom script. Note that this layout is roughly the same as used in BLFS, however because the page will be imported in LFScript through [[ScriptFactory]] it is important that you follow the style set here '''exactly'''.
 
This is a sample layout which you must use if you are contributing a custom script. Note that this layout is roughly the same as used in BLFS, however because the page will be imported in LFScript through [[ScriptFactory]] it is important that you follow the style set here '''exactly'''.
Line 10: Line 9:
 
Finally, be sure to adapt and include the next line at the top of your page:
 
Finally, be sure to adapt and include the next line at the top of your page:
  
To build this software using LFScript, add ''<code class="scriptName">custom-example</code>'' to the [[LFScript Switches|-x switch]].
+
<scriptname>my-software</scriptname>
  
 
== Sources ==
 
== Sources ==
* Primary source: [http://www.example.com/sourcecode-1.0.tar.xz http://www.example.com/sourcecode-1.0.tar.xz]
+
* Primary source: <sourcecode>http://www.example.com/sourcecode-1.0.tar.xz</sourcecode>
* Alternative source: [http://www.example.com/alt/sourcecode-1.0.tar.xz http://www.example.com/alt/sourcecode-1.0.tar.xz]
+
* Alternative source: <sourcecode>http://www.example.com/alt/sourcecode-1.0.tar.xz</sourcecode>
* Required patch: [http://www.example.com/patch/sourcecode-1.0_fix.patch http://www.example.com/patch/sourcecode-1.0_fix.patch]
+
* Required patch: <sourcecode>http://www.example.com/patch/sourcecode-1.0_fix.patch</sourcecode>
  
  
 
'''MD5 Checksums'''
 
'''MD5 Checksums'''
<pre>9244091002a9d52e91fca0b1f3818ab9  sourcecode-1.0.tar.xz
+
<md5>9244091002a9d52e91fca0b1f3818ab9  sourcecode-1.0.tar.xz
d41d8cd98f00b204e9800998ecf8427e  sourcecode-1.0_fix.patch</pre>
+
d41d8cd98f00b204e9800998ecf8427e  sourcecode-1.0_fix.patch</md5>
  
 
If you do not set a checksum for a file, it will be set as <code>dontverify</code> in a script.
 
If you do not set a checksum for a file, it will be set as <code>dontverify</code> in a script.
  
 
== Dependencies ==
 
== Dependencies ==
* [[NetworkManager|network-manager]]
+
* <dependency value="network-manager">[[NetworkManager]]</dependency>
* libpng
+
* <dependency>libpng</dependency>
  
 
Make the displayed name of dependencies the '''script'''name for it, nothing more, nothing less. So not "NetworkManager", but <code>network-manager</code>. If the dependency is listed on this Wiki, you should link to it.
 
Make the displayed name of dependencies the '''script'''name for it, nothing more, nothing less. So not "NetworkManager", but <code>network-manager</code>. If the dependency is listed on this Wiki, you should link to it.
Line 35: Line 34:
 
If your software requires any pre-installation (like adding special users or groups), you must specify it here.
 
If your software requires any pre-installation (like adding special users or groups), you must specify it here.
  
<pre>useradd -m sampleUser</pre>
+
<preinst>useradd -m sampleUser</preinst>
  
 
== Installation ==
 
== Installation ==
Line 41: Line 40:
 
If the software must be patched, explain here why.
 
If the software must be patched, explain here why.
  
<pre>patch -Np1 < ../sourcecode-1.0_fix.patch</pre>
+
<compile>patch -Np1 < ../sourcecode-1.0_fix.patch</compile>
  
 
Compile the software:
 
Compile the software:
  
<pre>./configure --prefix=/usr &&
+
<compile>./configure --prefix=/usr &&
make</pre>
+
make</compile>
  
 
Then, as the '''root''' user:
 
Then, as the '''root''' user:
  
<pre class="asRoot">make install</pre>
+
<install>make install</install>
  
 
Note that the code block above does not have a <code>DESTDIR=${FAKEROOT}</code> directive. [[ScriptFactory]] will add these automatically if a <code>pre</code> block has <code>class="asRoot"</code>.
 
Note that the code block above does not have a <code>DESTDIR=${FAKEROOT}</code> directive. [[ScriptFactory]] will add these automatically if a <code>pre</code> block has <code>class="asRoot"</code>.
Line 59: Line 58:
 
This packages does not support the use of '''DESTDIR''', in stead it uses:
 
This packages does not support the use of '''DESTDIR''', in stead it uses:
  
<pre>prefix=</pre>
+
<destdir>prefix=</destdir>
  
 
== Post-installation ==
 
== Post-installation ==
 
This section must contain commands which will modify the software after it has been installed, or modify files installed by a different package. It should also contain those commands that configure the package for use on that specific machine.
 
This section must contain commands which will modify the software after it has been installed, or modify files installed by a different package. It should also contain those commands that configure the package for use on that specific machine.
 +
 +
<delaypostinst/>
  
 
For example:
 
For example:
  
<pre class="delayPostinst">update-desktop-database</pre>
+
<postinst>update-desktop-database</postinst>
  
 
If you add <code>class="delayPostinst"</code> to any code block in this section, all post-installation commands will be delayed until all software has been installed.
 
If you add <code>class="delayPostinst"</code> to any code block in this section, all post-installation commands will be delayed until all software has been installed.

Revision as of 15:26, 1 February 2012

This page is a rough draft, do not rely on it

This is a sample layout which you must use if you are contributing a custom script. Note that this layout is roughly the same as used in BLFS, however because the page will be imported in LFScript through ScriptFactory it is important that you follow the style set here exactly.

If your software does not use the Pre-installation, Post-installation or DESTDIR sections, you can leave them out. All other sections are mandatory.

If for any reason, your page causes problems with ScriptFactory, it will not be included in LFScript.

Finally, be sure to adapt and include the next line at the top of your page:

LFScript can find this software under the name my-software.

Sources


MD5 Checksums


MD5 Checksums:

9244091002a9d52e91fca0b1f3818ab9  sourcecode-1.0.tar.xz
d41d8cd98f00b204e9800998ecf8427e  sourcecode-1.0_fix.patch

If you do not set a checksum for a file, it will be set as dontverify in a script.

Dependencies

  • [[NetworkManager]]
  • libpng

Make the displayed name of dependencies the scriptname for it, nothing more, nothing less. So not "NetworkManager", but network-manager. If the dependency is listed on this Wiki, you should link to it.

Do not list optional dependencies.

Pre-installation

If your software requires any pre-installation (like adding special users or groups), you must specify it here.

useradd -m sampleUser

Installation

If the software must be patched, explain here why.

<compile>patch -Np1 < ../sourcecode-1.0_fix.patch</compile>

Compile the software:

<compile>./configure --prefix=/usr && make</compile>

Then, as the root user:

<install>make install</install>

Note that the code block above does not have a DESTDIR=${FAKEROOT} directive. ScriptFactory will add these automatically if a pre block has class="asRoot".

DESTDIR

If a package does not use DESTDIR, but prefix for example, you can specify that in this section, like this:

This packages does not support the use of DESTDIR, in stead it uses:

The source code of this package does not support the standard use of DESTDIR. In stead it uses

prefix=

Post-installation

This section must contain commands which will modify the software after it has been installed, or modify files installed by a different package. It should also contain those commands that configure the package for use on that specific machine.

Note: Post-installation of this software should be performed after all other software has been installed.

For example:

update-desktop-database

If you add class="delayPostinst" to any code block in this section, all post-installation commands will be delayed until all software has been installed.