<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dugan</id>
	<title>SlackWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dugan"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/Special:Contributions/Dugan"/>
	<updated>2026-05-02T17:30:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=LCD_Monitor_Configuration_In_X.Org&amp;diff=34</id>
		<title>LCD Monitor Configuration In X.Org</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=LCD_Monitor_Configuration_In_X.Org&amp;diff=34"/>
		<updated>2009-05-28T20:36:03Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
==DISCLAIMER==&lt;br /&gt;
&lt;br /&gt;
If there is nothing wrong with your display, please don't go mucking about with your ~/.fonts.conf file (at least, back it up first). If you do have problems with your LCD display, then this is a good bet to try. If you have any success or failure, please do report this back, and changes, if any, that you made to your .fonts.conf file and any other file (perhaps /etc/X11/xorg.conf?) Comments, corrections and thoughts are always welcome.&lt;br /&gt;
&lt;br /&gt;
This may well also work with XFree86 &amp;gt; 4.3, since they use the same font configuration files as this. Older versions have a non-XML font configuration setup (I don't know when the switch over was made though), and will not be covered.&lt;br /&gt;
&lt;br /&gt;
WARNING - Parts of this article are out of date, and there are a few changes required for modular X. These will be added soon.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
LCD/TFTs display fonts very differently to a CRT. Unfortunately with Slackware's default settings on X.Org/FreeType, the results for fonts on an LCD are painful to say the least. This is further compounded by the fact that all the 'helpful' HOWTOs out there are badly out of date, referring to ancient versions of the now defunct XFree86. Whilst there are a few sites out there with bits of information, putting into a workable solution is quite a challenge.&lt;br /&gt;
&lt;br /&gt;
This exists, therefore, to show the naysayers that they're wrong, and that you _can_ enjoy nice looking fonts in Slackware.&lt;br /&gt;
&lt;br /&gt;
(Please note, this is _not_ an exhaustive HOWTO, and it is _not_ a HOWTO about .fonts.conf (please see the Bibliography for a site detailing the tags available in .fonts.conf). This HOWTO is only about configuring an LCD monitor and what works best for one)&lt;br /&gt;
&lt;br /&gt;
==What You'll Need==&lt;br /&gt;
&lt;br /&gt;
*Your favourite text editor&lt;br /&gt;
*X.Org (or a later edition of XFree86 &amp;gt;4.3. This has only been tested on Slackware 10.1 and above).&lt;br /&gt;
*An LCD/TFT monitor (most of this may also apply to an LCD monitor on a laptop).&lt;br /&gt;
&lt;br /&gt;
==Physical Setup==&lt;br /&gt;
&lt;br /&gt;
===The Monitor===&lt;br /&gt;
&lt;br /&gt;
(I humbly apologise in advance for this section, but better safe than sorry.)&lt;br /&gt;
&lt;br /&gt;
(Standalone Monitors only) Plug up your LCD. Where possible, use the DVI-D (i.e. The digital, not analogue VGA) connector, if both your monitor and your graphics card have one. If not, use an analogue VGA cable and connection (where possible, avoid using DVI-D to VGA adaptors.) Then, ensure the viewing angle of your LCD is correct. Play around with it until you are happy.&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
&lt;br /&gt;
===X===&lt;br /&gt;
&lt;br /&gt;
As far as I know, there is no special configuration of X needed for an LCD monitor. Just create the necessary entry for a monitor in /etc/X11/xorg.conf with the correct refresh rates as normal and enjoy (the monitor itself may even be able to give you these, mine does.) I won't cover this in any more detail, as it's pretty standard and covered better elsewhere.&lt;br /&gt;
&lt;br /&gt;
X will also detect the correct sub-pixel alignment, so you don't need to deal with that either.&lt;br /&gt;
&lt;br /&gt;
===Fonts and FreeType===&lt;br /&gt;
&lt;br /&gt;
The real problems begins with font rendering in X. If you are switching over on your machine from a CRT to an LCD, what is facing you at first sight will be unpleasant to say the least.&lt;br /&gt;
&lt;br /&gt;
Of course, this isn't down to X, as in all modern X servers from X.Org (and the later ones from XFree86) FreeType is responsible for all font rendering (any other modules loaded in your /etc/X11/xorg.conf for font rendering are anachronisms: they are no longer used, and X tells you they don't exist). Something I've seen a lot is that “fonts looked better on 9.0” or earlier versions of Slackware, and there is good reason for this. With the changeover to FreeType2, due to various Apple patents in the US and Japan, the 'bytecode interpreter' is now disabled by default. (Plus, IMHO, the Bitstream fonts that ship with Slackware aren't very good). With a CRT, this isn't much of a problem, but it does make a lot of difference on an LCD and is nearly illegible.&lt;br /&gt;
&lt;br /&gt;
There are two ways round this, either:&lt;br /&gt;
&lt;br /&gt;
#Make alterations to .fonts.conf to try and make the Bitstream fonts render better on an LCD.&lt;br /&gt;
#Rebuild FreeType with the bytecode interpreter, and use the properly hinted MS fonts (Arial, et al) to get cleaner, crisper looking fonts on the LCD.&lt;br /&gt;
&lt;br /&gt;
Both of these solutions give different results (though I prefer the second).&lt;br /&gt;
&lt;br /&gt;
====Common====&lt;br /&gt;
&lt;br /&gt;
For both alternatives, there are some common settings that must be made.&lt;br /&gt;
&lt;br /&gt;
If you're using KDE or GNOME, you'll find they have tools for doing some of what I'm going to describe. However, I would recommend _against_ using them. I've found their attempts at generating and editing a .fonts.conf file to be dubious to say the least. It is much more preferable to edit the file yourself, and since it is now done through a well defined XML file, this isn't as bad as it once appeared to be (judging from some of those ancient HOWTOs).&lt;br /&gt;
&lt;br /&gt;
Crank up your editor and load ~/.fonts.conf (or /etc/fonts/local.conf)&lt;br /&gt;
&lt;br /&gt;
If it exists: Just add these sections to it, inside the &amp;lt;fontconfig&amp;gt;&amp;lt;/fontconfig&amp;gt; tags.&lt;br /&gt;
If it doesn't exist: Use my ~/.fonts.conf skeleton from Appendix A as your .fonts.conf and edit as necessary.&lt;br /&gt;
&lt;br /&gt;
1. Ensure that the sub pixel order is _not_ specified.&lt;br /&gt;
&lt;br /&gt;
X knows the sub pixel order already, and if this is enabled as well, FreeType produces some very strange results. However, if you do still have problems, consider replacing 'none' with 'rgb' (the standard for LCD monitors), 'bgr' (unusual), 'vrgb' (vertical rgb, if you have a monitor that has been rotated by 90 degrees[1]), 'vgbr' (as vrgb, but very rare).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;font&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;rgba&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;const&amp;gt;none&amp;lt;/const&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Enable sub-pixel hinting&lt;br /&gt;
&lt;br /&gt;
This is what really starts to make the difference. Visit http://grc.com/ctwhat.htm for the technical explanation of why we're doing all of this.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;font&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;hinting&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;bool&amp;gt;true&amp;lt;/bool&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Set the hinting amount&lt;br /&gt;
&lt;br /&gt;
Usually, this should be full. Valid options are 'none', 'hintslight', 'hintmedium' and 'hintfull' which should be fairly self explanatory if you've read the article at the link above.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;font&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;hintstyle&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;const&amp;gt;hintfull&amp;lt;/const&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Option 1) The 'Easy' Way====&lt;br /&gt;
&lt;br /&gt;
Essentially, we're going to enable FreeType's non-patented autohinter and antialiasing to improve the appeareance of the default Bitstream fonts.&lt;br /&gt;
&lt;br /&gt;
Add the following to ~/.fonts.conf. &lt;br /&gt;
&lt;br /&gt;
#Enable anti aliasing&lt;br /&gt;
&lt;br /&gt;
This makes the fonts start to look nice, but some of the shapes will be distorted, so we need the FreeType autohinter (see next part). &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;font&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;antialias&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;bool&amp;gt;true&amp;lt;/bool&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fluxbox only:&lt;br /&gt;
&lt;br /&gt;
You may need to enable anti alias separately on Fluxbox before it takes notice of the changes:&lt;br /&gt;
&lt;br /&gt;
fluxbox menu --&amp;gt; Configure --&amp;gt; AntiAlias&lt;br /&gt;
&lt;br /&gt;
#Enable the FreeType autohinter&lt;br /&gt;
&lt;br /&gt;
The autohinter is not turned on automatically, so we have to do this manually.&lt;br /&gt;
&lt;br /&gt;
Please note that OpenOffice.org binaries from the OOo website are built against the bytecode interpreter, so even if you have compiled FreeType with the bytecode interpreter and override it with the autohinter, OOo will still use the bytecode interpreter.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;autohint&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;bool&amp;gt;true&amp;lt;/bool&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Option 2) The 'Hard' Way====&lt;br /&gt;
&lt;br /&gt;
This is my ([[User:Cathectic]]) preferred solution, as I believe it gives better results. This involves rebuilding FreeType with the bytecode interpreter enabled, and then using the properly hinted fonts 'Core Fonts For the Web' from Microsoft.&lt;br /&gt;
&lt;br /&gt;
For this, you will need to:&lt;br /&gt;
&lt;br /&gt;
#Get a copy of FreeType that has the bytecode interpreter enabled.&lt;br /&gt;
##Download the Freetype sources from your local Slackware mirror (slackware-$VERSION/source/l/freetype)&lt;br /&gt;
##In freetype.SlackBuild, uncomment the line to apply the bytecode enabling patch&lt;br /&gt;
##Run the SlackBuild&lt;br /&gt;
##Replace your old freetype package with the new one you've just built.&lt;br /&gt;
&lt;br /&gt;
'''32bit X Applications (Slamd64 only)''': To enable 32bit applications in Slamd64 to use the bytecode interpreter, you need to install a 32bit bytecode enabled FreeType.&lt;br /&gt;
&lt;br /&gt;
#Download and install the 'Microsoft Core Fonts for the Web' (if you have a Windows installation, you could import the fonts from that instead. This tutorial assumes you do not) from either:&lt;br /&gt;
##LinuxPackages (install CabExtract, then CoreFonts)&lt;br /&gt;
##Or, From the 'Core Fonts for the Web' at http://prdownloads.sourceforge.net/corefonts/ &lt;br /&gt;
###Get all the *.exe files&lt;br /&gt;
###Get the CabExtract source RPM, rpm2tgz it, untar, build and install&lt;br /&gt;
###Use CabExtract to extract the *.ttf's from the *.exe's you downloaded, and then move the fonts to /usr/X11/lib/X11/fonts/TTF (/usr/share/fonts/TTF for X.Org 7 or newer).&lt;br /&gt;
&lt;br /&gt;
Now add the following to ~/.fonts.conf&lt;br /&gt;
&lt;br /&gt;
1. Disable the autohinter&lt;br /&gt;
&lt;br /&gt;
This isn't strictly necessary – the autohinter is not enabled by default, and if it's not enabled, the bytecode interpreter is used by default. However, it's better safe than sorry.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- Disable autohinter - using bytecode interpreter instead --&amp;gt;&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;autohint&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;bool&amp;gt;false&amp;lt;/bool&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Set the MS fonts as defaults&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- Set sans-serif as Arial --&amp;gt;&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;test name=&amp;quot;family&amp;quot; qual=&amp;quot;any&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;sans-serif&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/test&amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;Arial&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- Set monospace as Courier New --&amp;gt;&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;test name=&amp;quot;family&amp;quot; qual=&amp;quot;any&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;monospace&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/test&amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;Courier New&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- Set serif to Times New Roman --&amp;gt;&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;test name=&amp;quot;family&amp;quot; qual=&amp;quot;any&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;serif&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/test&amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;Times New Roman&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(I would also recommend using the template in Appendix B to replace all the Bitstream and Luxi fonts with the MS equivalents (or set them to use serif, sans-serif, monospace instead)).&lt;br /&gt;
&lt;br /&gt;
====Testing====&lt;br /&gt;
&lt;br /&gt;
Just load any application up (I'd recommend a Gtk one, KDE will probably need a restart for the changes to take affect everywhere), and the changes should be immediately obvious (I used Mozilla Firefox, by opening and closing it after every tweak of ~/.fonts.conf, I was able to see the changes immediately).&lt;br /&gt;
&lt;br /&gt;
====Apply System Wide====&lt;br /&gt;
&lt;br /&gt;
You can apply these changes system wide, using /etc/fonts/local.conf&lt;br /&gt;
&lt;br /&gt;
If it exists, just append the sections you added above to it.&lt;br /&gt;
If it doesn't, use your .fonts.conf as /etc/fonts/local.conf, and edit it as necessary&lt;br /&gt;
&lt;br /&gt;
(The order of precedence for processing is /etc/fonts/fonts.conf (automatically generated, don't edit it), /etc/fonts/local.conf then ~/.fonts.conf - meaning your ~/.fonts.conf will always override the system settings).&lt;br /&gt;
&lt;br /&gt;
===Application Specific Settings===&lt;br /&gt;
&lt;br /&gt;
Qt and Gtk settings need to be changed. &lt;br /&gt;
&lt;br /&gt;
====Gtk====&lt;br /&gt;
&lt;br /&gt;
For gtk, edit .gtkrc-2.0 and set the fonts either to the generic 'serif', 'sans-serif', etc (now aliased to the MS fonts), or specify the MS fonts outright.&lt;br /&gt;
&lt;br /&gt;
====Qt====&lt;br /&gt;
For qt, edit .kde/kderc and .qt/qtrc&lt;br /&gt;
&lt;br /&gt;
==Suggestions==&lt;br /&gt;
&lt;br /&gt;
===Non TrueType fonts===&lt;br /&gt;
&lt;br /&gt;
Non TrueType fonts don't render well on LCDs as they don't support hinting. For these fonts (e.g. Helvetica), it is recommended that you specify an alternative TrueType font (that is hopefully similar, but it doesn't have to be!) to use instead (in this case, whatever the default sans-serif font on the system is):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;match target=&amp;quot;pattern&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;test name=&amp;quot;family&amp;quot; qual=&amp;quot;any&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;Helvetica&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/test&amp;gt;&lt;br /&gt;
  &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;sans-serif&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/edit&amp;gt;&lt;br /&gt;
 &amp;lt;/match&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can easily reuse this for other fonts. Just copy and paste, then replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want to replace it with (or you can use the generic descriptions 'serif', 'sans-serif' or 'monospace').&lt;br /&gt;
&lt;br /&gt;
===Old Gtk/Qt===&lt;br /&gt;
&lt;br /&gt;
Some programs (usually older ones) using these libraries may not always use anti aliased fonts, even if you've specified them in .fonts.conf. This can fixed by:&lt;br /&gt;
&lt;br /&gt;
Gtk: Add the following to /etc/profile: &lt;br /&gt;
export GDK_USE_XFT='1'&lt;br /&gt;
&lt;br /&gt;
qt: In ~/.qt/qtrc, ensure the following entry is present under [General]: &lt;br /&gt;
enableXft=true&lt;br /&gt;
useXft=true&lt;br /&gt;
&lt;br /&gt;
Programs coded using Gtk 1.x don't appear to support anti aliasing properly – you may want to consider replacing them with ones that use Gtk 2.x (e.g. Replacing XMMS with its Gtk2 fork, Beep Media Player)&lt;br /&gt;
&lt;br /&gt;
===OpenOffice.org===&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org binaries are built against the bytecode interpreter. If you install a bytecode enabled FreeType, OOo will always use it, regardless of any system settings enabling the autohinter. Also, OpenOffice.org fonts have to be changed manually.&lt;br /&gt;
&lt;br /&gt;
Tools &amp;gt; Options &amp;gt; OpenOffice.org &amp;gt; 'Use system font for user interface' (make sure this is checked).&lt;br /&gt;
&lt;br /&gt;
==Appendix A==&lt;br /&gt;
&lt;br /&gt;
The following is a ~/.fonts.conf / /etc/fonts/local.conf skeleton. Use this to put together a working configuration for your system.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE fontconfig SYSTEM &amp;quot;fonts.dtd&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;fontconfig&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;!-- Settings go between fontconfig tags --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/fontconfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B==&lt;br /&gt;
&lt;br /&gt;
This section is a recommendation only. Some fonts are not TrueType, which means they don't support anti aliasing and look dreadful on an LCD. The way round this is to tell FreeType to replace any such fonts with a properly hinted TrueType equivalent. All of the Bitstream and Luxi fonts should be aliased in this way (some sites, such as Gnome's home page, use these fonts, and they don't render correctly with the bytecode interpreter).&lt;br /&gt;
&lt;br /&gt;
You can copy, paste and edit the following example for Helvetica for any other fonts you want to replace. (Just replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want it to be replaced with. Generic font descriptions serif, sans-serif and monospace are valid entries, as well as specific font names.)&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- Replace Helvetica with default sans-serif --&amp;gt;&lt;br /&gt;
  &amp;lt;match target=&amp;quot;pattern&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
   &amp;lt;test name=&amp;quot;family&amp;quot; qual=&amp;quot;any&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;Helvetica&amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;/test&amp;gt;&lt;br /&gt;
   &amp;lt;edit mode=&amp;quot;assign&amp;quot; name=&amp;quot;family&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;sans-serif&amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;/edit&amp;gt;&lt;br /&gt;
  &amp;lt;/match&amp;gt;&lt;br /&gt;
 &amp;lt;alias&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&lt;br /&gt;
[1] Apparently, there are some monitors where the screen can be rotated. If so, perhaps the vrgb/vbgr settings might be better for you (but only when the screen is rotated) If you can test this, please report back the results. &lt;br /&gt;
&lt;br /&gt;
==Bibliography==&lt;br /&gt;
&lt;br /&gt;
Man Page of fonts.conf - http://www.fontconfig.org/fontconfig-user.html&amp;lt;br /&amp;gt;&lt;br /&gt;
XFree86 Font Configuration - http://www.xfree86.org/current/fonts2.html&amp;lt;br /&amp;gt;&lt;br /&gt;
Explanation of Sub Pixel Hinting - http://grc.com/ctwhat.htm&amp;lt;br /&amp;gt;&lt;br /&gt;
Gentoo Xorg &amp;amp; Fonts (And how to fix Konsole Linux fonts problem) - http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts&amp;lt;br /&amp;gt;&lt;br /&gt;
If you're running an old version of XFree http://www.tldp.org/HOWTO/FDU/index.html&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Compiling&amp;diff=33</id>
		<title>Compiling</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Compiling&amp;diff=33"/>
		<updated>2009-05-28T20:28:32Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Well compiling a program can be a pain, but it's pretty fun. First you need to get the source you're compiling and read the INSTALL and README files on any weird install techniques. We first need to extract the source:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;tar zxvf file.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now see a bunch of files on your screen, that means it's extracting, now half the programs have a configure script, this means you can enable, disable and tell the program where to install to:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives you a list of the options you can compile in or disable options. Now this is a normal compile line:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;./configure --prefix=/usr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now this installs the program in /usr so you don't need to edit the $PATH to launch it, Now 2 other options that you might want to add to some programs are:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;--sysconfdir=/etc&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--localstatedir=/var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are pretty self explanatory. You may or may not need to edit these. Some source say $PREFIX/etc or something similar for the --sysconfdir and you might not want that, this is an example of when you need the --sysconfdir=/etc. Now when we have the source configured, you want to compile it:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiles the actual program. It might take some time, it might not, depending on the source. &lt;br /&gt;
&lt;br /&gt;
If make succeeds without errors, the program is now technically compiled. Some simpler programs can be run directly after compiling, without having to be installed, but most programs need to be fully installed before they can properly run. &lt;br /&gt;
&lt;br /&gt;
To install, one can simply proceed as such: &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;su&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the above method does not take advantage of Slackware's package management system, which will make upgrading or uninstalling this program in the future much easier.  The preferred way to install programs is through packages-- thus, at this point, the program should be packaged instead of simply running &amp;quot;make install&amp;quot; as root. See [[Building_A_Package]] and [[Checkinstall]].&lt;br /&gt;
&lt;br /&gt;
This is just a basic way to compile a program and it's pretty easy to do. Now you know how to compile a program. Good luck.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Checkinstall&amp;diff=32</id>
		<title>Checkinstall</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Checkinstall&amp;diff=32"/>
		<updated>2009-05-28T20:27:22Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki. AND GOT RID OF SPAM.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Checkinstall is actually really easy to use. Like it's told in [[compiling]] tutorial, you first do:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure (--option=argument/path)&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then when configure has finished you write&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after compiling you simply write&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;checkinstall -y -S&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you don't have to worry about it. This command makes a package and installs it. Also it leaves copy of this package to current directory in case you need it. If you want to remove package you go to /var/log/packages and write:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;removepkg pkgname&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Configuration'''&lt;br /&gt;
&lt;br /&gt;
Checkinstall also works with a config file: /etc/checkinstall/checkinstallrc. In this file, the options that are especially&lt;br /&gt;
interesting to a SlackWare user are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCHITECTURE=&amp;quot;i686&amp;quot;&lt;br /&gt;
INSTYPE=&amp;quot;S&amp;quot;&lt;br /&gt;
PAK_DIR=&amp;quot;/usr/src&amp;quot;&lt;br /&gt;
SHOW_SLACK_INSTALL=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ARCHITECTURE&amp;quot; sets your architecture (if blank, it will auto guess)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;INSTYPE&amp;quot; specifies the type of package to create (S for Slackware)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;PAK_DIR&amp;quot; is the location where the finished packages will be moved to&lt;br /&gt;
&lt;br /&gt;
&amp;quot;SHOW_SLACK_INSTALL&amp;quot; specifies wether the slackware package info will be shown when it's installed&lt;br /&gt;
&lt;br /&gt;
That's it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Checkinstall home page: http://asic-linux.com.mx/~izto/checkinstall/&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Building_A_Package&amp;diff=31</id>
		<title>Building A Package</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Building_A_Package&amp;diff=31"/>
		<updated>2009-05-28T20:24:50Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Configure and compile the source as you usually do:&lt;br /&gt;
 ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
Make a temporary destination directory available:&lt;br /&gt;
 mkdir /tmp/build&lt;br /&gt;
&lt;br /&gt;
Install into the temporary directory:&lt;br /&gt;
 make install DESTDIR=/tmp/build&lt;br /&gt;
&lt;br /&gt;
Now strip libs/bins within the temporary directory:&lt;br /&gt;
 strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/*&lt;br /&gt;
&lt;br /&gt;
You also want to make sure that anything in &amp;lt;tt&amp;gt;/usr/man&amp;lt;/tt&amp;gt; is gzipped before you make the package:&lt;br /&gt;
 gzip -9 /tmp/build/usr/man/man?/*.?&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;install&amp;lt;/tt&amp;gt; directory, this is where the description and install script will be stored:&lt;br /&gt;
 cd /tmp/build&lt;br /&gt;
 mkdir install&lt;br /&gt;
 cd install&lt;br /&gt;
&lt;br /&gt;
Using a text editor, create a file called &amp;lt;tt&amp;gt;slack-desc&amp;lt;/tt&amp;gt; and fill it with the following contents:&lt;br /&gt;
&lt;br /&gt;
    |-----handy-ruler------------------------------------------------------|&lt;br /&gt;
 app: Application Name (Short/Brief description)&lt;br /&gt;
 app:&lt;br /&gt;
 app: Enter a description of the package you are building.&lt;br /&gt;
 app: All 11 &amp;quot;app:&amp;quot; lines must be present&lt;br /&gt;
 app: &amp;quot;app&amp;quot; needs to be your application name.&lt;br /&gt;
 app: The handy-ruler is there to help you, these lines should not exceed&lt;br /&gt;
 app: 79 characters.&lt;br /&gt;
 app:&lt;br /&gt;
 app:&lt;br /&gt;
 app:&lt;br /&gt;
 app:&lt;br /&gt;
&lt;br /&gt;
Create the actual package:&lt;br /&gt;
 cd /tmp/build&lt;br /&gt;
 makepkg ../app-version-arch-tag.tgz&lt;br /&gt;
&lt;br /&gt;
''(The dashes should appear as above, so if the version has a subversion like say &amp;quot;1.0 RC2&amp;quot; make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like &amp;quot;i486&amp;quot; for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc.  Official slackware packages have only numbers as tags.)''&lt;br /&gt;
&lt;br /&gt;
When prompted to recreate symbolic links, say &amp;lt;tt&amp;gt;yes&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When prompted to reset permissions, say &amp;lt;tt&amp;gt;no&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.''&lt;br /&gt;
&lt;br /&gt;
If all went well, you can now install the package.&lt;br /&gt;
 cd ..&lt;br /&gt;
 installpkg app-version-arch-tag.tgz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]].&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Different_Approach_To_Buildscripts&amp;diff=30</id>
		<title>Different Approach To Buildscripts</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Different_Approach_To_Buildscripts&amp;diff=30"/>
		<updated>2009-05-28T20:23:32Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
Pretty much everyone can have their own way of writing Slackware buildscripts. I also have mine, which just makes it easier for me to package software.&lt;br /&gt;
&lt;br /&gt;
In here, I'm going to explain mine. To start, let's look at one I wrote this morning while drinking coffee cup #1:&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    &lt;br /&gt;
    #############################################################################&lt;br /&gt;
    ## Name: jpilot                                                            ##&lt;br /&gt;
    ## Version: 0.99.8                                                         ##&lt;br /&gt;
    ## Packager: Martin Lefebvre (dadexter@gmail.com)                          ##&lt;br /&gt;
    ## Homepage: http://www.jpilot.org                                         ##&lt;br /&gt;
    #############################################################################&lt;br /&gt;
    &lt;br /&gt;
    PKGNAME=jpilot&lt;br /&gt;
    VERSION=0.99.8&lt;br /&gt;
    LOC=&amp;quot;http://jpilot.org/$PKGNAME-$VERSION.tar.gz&amp;quot;&lt;br /&gt;
    ARCH=`uname -m`&lt;br /&gt;
    &lt;br /&gt;
    START=`pwd`&lt;br /&gt;
    PKG=$START/pkg&lt;br /&gt;
    SRC=$START/work&lt;br /&gt;
    &lt;br /&gt;
    build() {&lt;br /&gt;
            mkdir -p $PKG $SRC&lt;br /&gt;
            cd $SRC&lt;br /&gt;
            wget $LOC&lt;br /&gt;
            tar -zxvf $PKGNAME-$VERSION.tar.gz&lt;br /&gt;
            cd $PKGNAME-$VERSION&lt;br /&gt;
            ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \&lt;br /&gt;
            --enable-gtk2 --enable-prometheon&lt;br /&gt;
            &lt;br /&gt;
            patch -p0 &amp;lt; patch.0.99.8-memory&lt;br /&gt;
            patch -p0 &amp;lt; patch.jpilot-sync&lt;br /&gt;
            make&lt;br /&gt;
            make DESTDIR=$PKG install&lt;br /&gt;
            mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION&lt;br /&gt;
            cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \&lt;br /&gt;
            NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION&lt;br /&gt;
            &lt;br /&gt;
            cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring&lt;br /&gt;
            cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer&lt;br /&gt;
            cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    package() {&lt;br /&gt;
            cd $PKG&lt;br /&gt;
            find . | xargs file | grep &amp;quot;executable&amp;quot; | grep ELF | cut -f 1 -d : \&lt;br /&gt;
            | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
            find . | xargs file | grep &amp;quot;shared object&amp;quot; | grep ELF | cut -f 1 -d : \&lt;br /&gt;
            | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
            find . | xargs file | grep &amp;quot;current ar archive&amp;quot; | cut -f 1 -d : | \&lt;br /&gt;
            xargs strip --strip-debug 2&amp;gt; /dev/null&lt;br /&gt;
            chown -R root:root usr/bin&lt;br /&gt;
            gzip -p $PKG/usr/man/man*/*&lt;br /&gt;
            mkdir $PKG/install&lt;br /&gt;
            cp $START/slack-desc $PKG/install/slack-desc&lt;br /&gt;
            cd $PKG&lt;br /&gt;
            makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    build&lt;br /&gt;
    package&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The top section is just comments identifying the piece of software we're going to build, and the name of the script's author. Then we have the following lines:&lt;br /&gt;
&lt;br /&gt;
    PKGNAME=jpilot&lt;br /&gt;
    VERSION=0.99.8&lt;br /&gt;
    LOC=&amp;quot;http://jpilot.org/$PKGNAME-$VERSION.tar.gz&amp;quot;&lt;br /&gt;
    ARCH=`uname -m`&lt;br /&gt;
    &lt;br /&gt;
    START=`pwd`&lt;br /&gt;
    PKG=$START/pkg&lt;br /&gt;
    SRC=$START/work&lt;br /&gt;
&lt;br /&gt;
They set the program's name, version, download URL, build and package directories. Since I usually don't specify anything related to the cpu or architecture, it auto detects the architecture. So, the $ARCH variable *should be* accurate.&lt;br /&gt;
&lt;br /&gt;
    build() {&lt;br /&gt;
            mkdir -p $PKG $SRC&lt;br /&gt;
            cd $SRC&lt;br /&gt;
            wget $LOC&lt;br /&gt;
            tar -zxvf $PKGNAME-$VERSION.tar.gz&lt;br /&gt;
            cd $PKGNAME-$VERSION&lt;br /&gt;
            ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \&lt;br /&gt;
            --enable-gtk2 --enable-prometheon&lt;br /&gt;
            &lt;br /&gt;
            patch -p0 &amp;lt; patch.0.99.8-memory&lt;br /&gt;
            patch -p0 &amp;lt; patch.jpilot-sync&lt;br /&gt;
            make&lt;br /&gt;
            make DESTDIR=$PKG install&lt;br /&gt;
            mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION&lt;br /&gt;
            cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \&lt;br /&gt;
            NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION&lt;br /&gt;
            &lt;br /&gt;
            cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring&lt;br /&gt;
            cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer&lt;br /&gt;
            cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
The is the main build function. This contains the code required to build the software. First, we create the build and package directories. The next 3 lines change to the building diirectory, uses wget to fetch the source file and extracts it.&lt;br /&gt;
&lt;br /&gt;
The lines after that are what you would normally type at your command line to build the software:&lt;br /&gt;
&lt;br /&gt;
* Change to the source directory.&lt;br /&gt;
* Run ./configure with all the options you want.&lt;br /&gt;
* Apply two patches required (in this case) to fix bugs with the software.&lt;br /&gt;
* Run make&lt;br /&gt;
* Install the software in the package directory defined by $PKG&lt;br /&gt;
* Create the standard Slackware Software Documentation directory in the package&lt;br /&gt;
* Copy the standard documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next section is the packaging part:&lt;br /&gt;
&lt;br /&gt;
    package() {&lt;br /&gt;
            cd $PKG&lt;br /&gt;
            find . | xargs file | grep &amp;quot;executable&amp;quot; | grep ELF | cut -f 1 -d : \&lt;br /&gt;
            | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
            find . | xargs file | grep &amp;quot;shared object&amp;quot; | grep ELF | cut -f 1 -d : \&lt;br /&gt;
            | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
            find . | xargs file | grep &amp;quot;current ar archive&amp;quot; | cut -f 1 -d : | \&lt;br /&gt;
            xargs strip --strip-debug 2&amp;gt; /dev/null&lt;br /&gt;
            chown -R root:root usr/bin&lt;br /&gt;
            gzip -p $PKG/usr/man/man*/*&lt;br /&gt;
            mkdir $PKG/install&lt;br /&gt;
            cp $START/slack-desc $PKG/install/slack-desc&lt;br /&gt;
            cd $PKG&lt;br /&gt;
            makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
* We change to the package directory&lt;br /&gt;
* Strip executables and libraries in order to decrease size.&lt;br /&gt;
* As a Slackware standard, we change the ownership of the executables to root:root (to be done for every bin/ and sbin/ directory)&lt;br /&gt;
* We compress the manpages&lt;br /&gt;
* Create install/ and copy the slack-desc file from the start directory&lt;br /&gt;
* Finally, change back to the package folder and create the package tarball.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, the slack-desc and some patch files are distributed with the SlackBuild. This also makes it easier to ship the build script with patches that might be required for the software to work on Slackware (patch to remove PAM stuff).&lt;br /&gt;
&lt;br /&gt;
The slack-desc file format is described here: [http://www.linuxpackages.net/howto.php?page=slack-desc&amp;amp;title=Slackware+Desc+Files LinuxPackages.net]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional files:&lt;br /&gt;
&lt;br /&gt;
Some people use slapt-get (like me). slapt-get supports additional features such as&lt;br /&gt;
* Dependencies&lt;br /&gt;
* Conflicts&lt;br /&gt;
* Suggestions&lt;br /&gt;
&lt;br /&gt;
Not everyone wants those features, so building a package with those files will not interfere with the normal pkgtools process. For more info on these optional files, go here: [http://www.linuxpackages.net/howto.php?page=perfect-package&amp;amp;title=Perfect+Package#Optional LinuxPackages.net]&lt;br /&gt;
&lt;br /&gt;
If you decide to use those files, you will then have to repeat these lines:&lt;br /&gt;
&lt;br /&gt;
    cp $START/slack-desc $PKG/install/slack-desc&lt;br /&gt;
&lt;br /&gt;
for slack-required, slack-conflicts, and slack-suggests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
See also [[SlackBuild_Scripts]] and [[Writing A SlackBuild Script]]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Contest&amp;diff=29</id>
		<title>Contest</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Contest&amp;diff=29"/>
		<updated>2009-05-28T20:19:39Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This contest is completed; congratulations to Marcus'''&lt;br /&gt;
&lt;br /&gt;
This page is here for those of you who wanted to create logos for slackwiki.org's contest.&lt;br /&gt;
Have at it!!!&lt;br /&gt;
&lt;br /&gt;
From [[User:FredEmmott|Fred87]] Can i have SVGs and/or png's please :)&lt;br /&gt;
&lt;br /&gt;
From [[User:erik|erik]] Mine is a png :)&lt;br /&gt;
----&lt;br /&gt;
Submitted by: [[User:Dominian|Dominian]] on Nov. 17, 2004&amp;lt;br&amp;gt;&lt;br /&gt;
http://home.insightbb.com/~mhayes/images/slackwiki_logo.png&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
Submitted by: [[User:jjdm|jjdm]] on Nov. 20, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
Repainted [http://us.aminet.net/pix/trace/BOOK.jpg this book] with sodipodi, repainted the slackware-logo and added a third-party svg-tux. You can get the SVG-file at [http://mufl.politux.org/logo.svg]. If you like the logo, but not the colors, feel free to edit the SVG-file. I meen, _please_ edit the SVG if you are good in colors because I'm a little colorblind. Thanks.&amp;lt;br/&amp;gt;&lt;br /&gt;
http://mufl.politux.org/logo.png&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
Submitted by: [[User:erik|erik]] on Nov. 21, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
The Wings of Slack, not mine, original from [http://subgenius.com/ The Church of the Subgenius].&amp;lt;br/&amp;gt;&lt;br /&gt;
Should fit right over the old logo (135x135), transparent bg will blend with current bg.&amp;lt;br/&amp;gt;&lt;br /&gt;
http://sl1200.org/WingsOfSlack.png&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
Submitted by: [[User:buzzedlightyear|buzzedlightyear]] on Nov. 23, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
Slackware logo, cropped it from a background i found and added text.&amp;lt;br/&amp;gt;&lt;br /&gt;
http://www.slackwaregallery.com/albums/userpics/10157/slackwikilogo.png&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
Submitted by: [[User:tewmten|tewmten]] on Dec. 14, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
A little penguin writing a book wich has the Slackware S on it.&amp;lt;br/&amp;gt;&lt;br /&gt;
135x135 with transparent background.&amp;lt;br/&amp;gt;&lt;br /&gt;
http://irda.mine.nu/~tewmten/SlackWiki-tew.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Submitted by: [[User:v3ctor|v3ctor]] on Dec. 15, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
Just a little something.&amp;lt;/br&amp;gt;&lt;br /&gt;
http://www.geocities.com/thelucid99/slackwiki.png&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Submitted by: [[User:Marcus|Marcus]] on Dec. 25, 2004&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to use it:&lt;br /&gt;
&lt;br /&gt;
http://www.gnulinux.de/images/personal/slackwiki/slackwiki.gif&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Build_Environment&amp;diff=28</id>
		<title>Build Environment</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Build_Environment&amp;diff=28"/>
		<updated>2009-05-28T20:17:15Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Replaced [CODE] tags (which weren't displaying properly)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
The purpose of this document is to give you several ideas on how to set up a good building environment (directory structure and such) for making Slackware packages from SlackBuild scripts.&lt;br /&gt;
&lt;br /&gt;
Hopefully, you can see what works for several different people here.  The definition of &amp;quot;good&amp;quot; is largely dependent upon personal preference, but all of these would be classified as &amp;quot;good&amp;quot; for the individuals using them.&lt;br /&gt;
&lt;br /&gt;
= Individual Setups =&lt;br /&gt;
&lt;br /&gt;
== jjdm ==&lt;br /&gt;
&lt;br /&gt;
My directory structure is as follows:&lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/'''&lt;br /&gt;
The slackware home directory. This directory (and all subdirectories) are owned by the group &amp;quot;packager&amp;quot; (of which root and my user account are members on my system). &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source'''&lt;br /&gt;
In this directory I've placed the whole slackware-source because maybe I have to temporarily build another package to build a new one because of header files and stuff. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source/myslackware/'''&lt;br /&gt;
This is where I build all my packages. Now they are unorganized but you can organize them in different topics like they're in Slackware. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source/myslackware/&amp;lt;package&amp;gt;'''&lt;br /&gt;
In this directory you build your package &amp;lt;package&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/packages'''&lt;br /&gt;
Place where the built packages are. &lt;br /&gt;
&lt;br /&gt;
You don't have to use such a building environment. You can place everything in your home-folder, in /root or somewhere else. The only important thing is that you always keep track of your files and packages.&lt;br /&gt;
&lt;br /&gt;
BTW: You can get the Slackware source packages from your Slackware-mirror of choice. It's placed in source/.&lt;br /&gt;
&lt;br /&gt;
== robw810 ==&lt;br /&gt;
&lt;br /&gt;
=== Directory Structure ===&lt;br /&gt;
My setup is something like this:&lt;br /&gt;
 /shared/os_files/slackware/slackware-(version)/source/...&lt;br /&gt;
 /home/rworkman/build/source&lt;br /&gt;
 /home/rworkman/build/packages&lt;br /&gt;
&lt;br /&gt;
=== Explanation of Directory Structure ===&lt;br /&gt;
The '''/shared/os_files/slackware/slackware-(version)/source/''' directory contains all of the source files (it's copied directly from the cdroms) from that release of Slackware.&lt;br /&gt;
&lt;br /&gt;
The '''/home/rworkman/build/source''' directory contains all of the sources for my SlackBuild scripts and such (it's set up basically identical to what the Slackware source directory contains).&lt;br /&gt;
&lt;br /&gt;
The '''/home/rworkman/build/packages''' directory contains all of the packages compiled from my sources.&lt;br /&gt;
&lt;br /&gt;
=== Integration of Directory Structure with Executing SlackBuild Scripts ===&lt;br /&gt;
&lt;br /&gt;
With some good environment variables declared in your SlackBuild scripts, it's relatively easy to manage this setup:&lt;br /&gt;
 PKG_OUT=/home/rworkman/build/packages&lt;br /&gt;
&lt;br /&gt;
=== Final Thoughts ===&lt;br /&gt;
As always, what works for me may not be ideal for you, so adjust your expectations accordingly :)&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
&lt;br /&gt;
* [[Writing_A_SlackBuild_Script]]&lt;br /&gt;
* [[SlackBuild_Scripts]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Build_Environment&amp;diff=27</id>
		<title>Build Environment</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Build_Environment&amp;diff=27"/>
		<updated>2009-05-28T20:12:40Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
The purpose of this document is to give you several ideas on how to set up a good building environment (directory structure and such) for making Slackware packages from SlackBuild scripts.&lt;br /&gt;
&lt;br /&gt;
Hopefully, you can see what works for several different people here.  The definition of &amp;quot;good&amp;quot; is largely dependent upon personal preference, but all of these would be classified as &amp;quot;good&amp;quot; for the individuals using them.&lt;br /&gt;
&lt;br /&gt;
= Individual Setups =&lt;br /&gt;
&lt;br /&gt;
== jjdm ==&lt;br /&gt;
&lt;br /&gt;
My directory structure is as follows:&lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/'''&lt;br /&gt;
The slackware home directory. This directory (and all subdirectories) are owned by the group &amp;quot;packager&amp;quot; (of which root and my user account are members on my system). &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source'''&lt;br /&gt;
In this directory I've placed the whole slackware-source because maybe I have to temporarily build another package to build a new one because of header files and stuff. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source/myslackware/'''&lt;br /&gt;
This is where I build all my packages. Now they are unorganized but you can organize them in different topics like they're in Slackware. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/source/myslackware/&amp;lt;package&amp;gt;'''&lt;br /&gt;
In this directory you build your package &amp;lt;package&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
'''/home/slackware/packages'''&lt;br /&gt;
Place where the built packages are. &lt;br /&gt;
&lt;br /&gt;
You don't have to use such a building environment. You can place everything in your home-folder, in /root or somewhere else. The only important thing is that you always keep track of your files and packages.&lt;br /&gt;
&lt;br /&gt;
BTW: You can get the Slackware source packages from your Slackware-mirror of choice. It's placed in source/.&lt;br /&gt;
&lt;br /&gt;
== robw810 ==&lt;br /&gt;
&lt;br /&gt;
=== Directory Structure ===&lt;br /&gt;
My setup is something like this:&lt;br /&gt;
 /shared/os_files/slackware/slackware-(version)/source/...&lt;br /&gt;
 /home/rworkman/build/source&lt;br /&gt;
 /home/rworkman/build/packages&lt;br /&gt;
&lt;br /&gt;
=== Explanation of Directory Structure ===&lt;br /&gt;
The [code] /shared/os_files/slackware/slackware-(version)/source/ [/code] directory contains all of the source files (it's copied directly from the cdroms) from that release of Slackware.&lt;br /&gt;
&lt;br /&gt;
The [code]/home/rworkman/build/source[/code] directory contains all of the sources for my SlackBuild scripts and such (it's set up basically identical to what the Slackware source directory contains).&lt;br /&gt;
&lt;br /&gt;
The [code]/home/rworkman/build/packages[/code] directory contains all of the packages compiled from my sources.&lt;br /&gt;
&lt;br /&gt;
=== Integration of Directory Structure with Executing SlackBuild Scripts ===&lt;br /&gt;
&lt;br /&gt;
With some good environment variables declared in your SlackBuild scripts, it's relatively easy to manage this setup:&lt;br /&gt;
 PKG_OUT=/home/rworkman/build/packages&lt;br /&gt;
&lt;br /&gt;
=== Final Thoughts ===&lt;br /&gt;
As always, what works for me may not be ideal for you, so adjust your expectations accordingly :)&lt;br /&gt;
&lt;br /&gt;
= Other Resources =&lt;br /&gt;
&lt;br /&gt;
* [[Writing_A_SlackBuild_Script]]&lt;br /&gt;
* [[SlackBuild_Scripts]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26</id>
		<title>Doinst.sh</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26"/>
		<updated>2009-05-28T20:09:56Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script is usually included under ./install within Slackware [[packages]] and contains post-install actions.&lt;br /&gt;
&lt;br /&gt;
Usually automatically created by [[makepkg]] for cleaning up and recreating symbolic links, advanced packagers may wish to include further configuration instructions here to be executed after files have been extracted from the .tgz package.&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
Within packages, doinst.sh is located in install/.&lt;br /&gt;
&lt;br /&gt;
After installation, the doinst.sh scripts are placed in /var/log/scripts, and renamed into the package name.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Handling symbolic links ===&lt;br /&gt;
&lt;br /&gt;
The package 'udev-064-i486-2' (from Slackware 10.2), contains a doinst.sh script which includes the following:&lt;br /&gt;
&lt;br /&gt;
 ( cd etc/hotplug.d/default ; rm -rf 10-udev.hotplug )&lt;br /&gt;
 ( cd etc/hotplug.d/default ; ln -sf /sbin/udevsend 10-udev.hotplug )&lt;br /&gt;
 ( cd usr/man/man8 ; rm -rf udevsend.8.gz )&lt;br /&gt;
 ( cd usr/man/man8 ; ln -sf udevd.8.gz udevsend.8.gz )&lt;br /&gt;
&lt;br /&gt;
Thus, during installation of this package, it will delete 'etc/hotplug.d/default/10-udev.hotplug' and 'usr/man/man8/udevsend.8.gz', then immediately recreate them using symbolic links.&lt;br /&gt;
&lt;br /&gt;
This part of doinst.sh scripts is the most common, and is almost always generated by [[makepkg]] automatically during the creation of the package. In fact, 'makepkg' strongly suggests handling symbolic links using the doinst.sh script this way.&lt;br /&gt;
&lt;br /&gt;
=== Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
The package 'vim-7.0.109-i486-1' (from Slackware 11.0), contains a doinst.sh script which includes the following:&lt;br /&gt;
&lt;br /&gt;
 config() {&lt;br /&gt;
  NEW=&amp;quot;$1&amp;quot;&lt;br /&gt;
  OLD=&amp;quot;$(dirname $NEW)/$(basename $NEW .new)&amp;quot;&lt;br /&gt;
  # If there's no config file by that name, mv it over:&lt;br /&gt;
  if [ ! -r $OLD ]; then&lt;br /&gt;
    mv $NEW $OLD&lt;br /&gt;
  elif [ &amp;quot;$(cat $OLD | md5sum)&amp;quot; = &amp;quot;$(cat $NEW | md5sum)&amp;quot; ]; then # toss the redundant copy&lt;br /&gt;
    rm $NEW&lt;br /&gt;
  fi&lt;br /&gt;
  # Otherwise, we leave the .new copy for the admin to consider...&lt;br /&gt;
 }&lt;br /&gt;
 config usr/share/vim/vimrc.new&lt;br /&gt;
&lt;br /&gt;
The config() function checks whether the configuration file in the package (vimrc) already exists on the system, or is exactly the same as the new one included in the package; if it exists and is not the same as the package's copy, it will not overwrite the old one but instead will be copied with a .new file extension (vimrc.new).&lt;br /&gt;
&lt;br /&gt;
This is a common, and the preferred, way of dealing with configuration files in Slackware packages.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Packages]]&lt;br /&gt;
* [[Building A Package]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Packages&amp;diff=25</id>
		<title>Packages</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Packages&amp;diff=25"/>
		<updated>2009-05-28T20:07:13Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Migrated from old wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slackware's package management system utilizes .tgz tarballs as its standard package format. These tarballs are  tar.gz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools.&lt;br /&gt;
&lt;br /&gt;
Information about a package is stored in two ways, in the filename of the package and a description file inside that package.&lt;br /&gt;
&lt;br /&gt;
==Package Tools==&lt;br /&gt;
See the respective manual pages for more information on each of the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pkgtool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;installpkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;removepkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;explodepkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;makepkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;upgradepkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Slackware Package Layout==&lt;br /&gt;
A typical Slackware package is laid out as such:&lt;br /&gt;
 ./&lt;br /&gt;
 ./install/doinst.sh&lt;br /&gt;
 ./install/slack-desc&lt;br /&gt;
 [./usr/bin]&lt;br /&gt;
 [./usr/lib]&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links.&lt;br /&gt;
&lt;br /&gt;
Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. &lt;br /&gt;
&lt;br /&gt;
There are other special files within packages: &lt;br /&gt;
&lt;br /&gt;
'''usr/doc/&amp;lt;appname&amp;gt;&amp;lt;version&amp;gt;'''&lt;br /&gt;
All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree.&lt;br /&gt;
&lt;br /&gt;
==Making Slackware Packages==&lt;br /&gt;
See [[Building A Package]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Slack-desc&amp;diff=24</id>
		<title>Slack-desc</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Slack-desc&amp;diff=24"/>
		<updated>2009-05-28T17:47:48Z</updated>

		<summary type="html">&lt;p&gt;Dugan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
A proper slack-desc file should be written as follows:&lt;br /&gt;
&lt;br /&gt;
 # HOW TO EDIT THIS FILE:&lt;br /&gt;
 # The &amp;quot;handy ruler&amp;quot; below makes it easier to edit a package description.  Line&lt;br /&gt;
 # up the first '|' above the ':' following the base package name, and the '|' on&lt;br /&gt;
 # the right side marks the last column you can put a character in.  You must make&lt;br /&gt;
 # exactly 11 lines for the formatting to be correct.  It's also customary to&lt;br /&gt;
 # leave one space after the ':'.&lt;br /&gt;
 &lt;br /&gt;
        |-----handy-ruler------------------------------------------------------|&lt;br /&gt;
 appname: Summary of application name and function (one line only)&lt;br /&gt;
 appname:      &amp;lt;this line is generally left blank&amp;gt;&lt;br /&gt;
 appname: Description of application  -  this description should be fairly&lt;br /&gt;
 appname: in-depth; in other words, make it clear what the package does (and &lt;br /&gt;
 appname: maybe include relevant links and/or instructions if there's room),&lt;br /&gt;
 appname: but don't get too verbose.  &lt;br /&gt;
 appname: This file can have a maximum of eleven (11) lines of text preceded by&lt;br /&gt;
 appname: the &amp;quot;appname: &amp;quot; designation.  &lt;br /&gt;
 appname: &lt;br /&gt;
 appname: It's a good idea to include a link to the application's homepage too.&lt;br /&gt;
 appname: &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appname&amp;quot; string must *exactly* match the application name portion of the &lt;br /&gt;
Slackware package (for example, a package titled &amp;quot;gaim-1.5-i486-1.tgz&amp;quot; must have &lt;br /&gt;
a slack-desc file with the &amp;lt;appname&amp;gt; string of &amp;quot;gaim: &amp;quot; rather than &amp;quot;Gaim: &amp;quot; or &lt;br /&gt;
&amp;quot;GAIM: &amp;quot; or something else.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;handy ruler&amp;quot; is meant to stop you at 79 characters, because the standard&lt;br /&gt;
console is 80x25 and if you go beyond this the words will wrap.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
 man makepkg&lt;br /&gt;
 man pkgtool&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Slack-desc&amp;diff=23</id>
		<title>Slack-desc</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Slack-desc&amp;diff=23"/>
		<updated>2009-05-28T17:46:19Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Created page with 'Category:Tutorials  = Introduction =   Originally written by Florian Mueller jjdm@jjdm.org  Substantial cleanup and enhancement by Robby Workman (rworkman)  If you use slackw...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
 Originally written by Florian Mueller jjdm@jjdm.org&lt;br /&gt;
 Substantial cleanup and enhancement by Robby Workman (rworkman)&lt;br /&gt;
&lt;br /&gt;
If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages.  In this situation, you have several options on how to install the application:&lt;br /&gt;
&lt;br /&gt;
 * ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
 * use checkinstall&lt;br /&gt;
 * use installwatch&lt;br /&gt;
 * compile and use makepkg by hand&lt;br /&gt;
 * write a SlackBuild script&lt;br /&gt;
&lt;br /&gt;
I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script.&lt;br /&gt;
&lt;br /&gt;
I cannot teach you how to build the &amp;quot;perfect&amp;quot; package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system.  You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly.  What I can teach you is how to build a package that works and which stays true to the &amp;quot;Slackware Way.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;But it takes so much time!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it.&lt;br /&gt;
&lt;br /&gt;
= The Slackware package structure =&lt;br /&gt;
&lt;br /&gt;
See [[Packages#Slackware Package Layout]]&lt;br /&gt;
&lt;br /&gt;
= Setting up your build environment =&lt;br /&gt;
&lt;br /&gt;
See [[Build_Environment]] for examples of how various users do this.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script.&lt;br /&gt;
&lt;br /&gt;
For this example, we'll create a package of latex2html - I made my homepage with that tool.&lt;br /&gt;
&lt;br /&gt;
First, you have to create a directory named &amp;lt;build_environment&amp;gt;/latex2html/. Get the most recent source code release of latex2html place it in this directory.  Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;build_environment&amp;gt;&lt;br /&gt;
 $ mkdir latex2html&lt;br /&gt;
 $ cd latex2html&lt;br /&gt;
 $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005&lt;br /&gt;
&lt;br /&gt;
Next, we'll create some other needed files with touch.  If you're not familiar with touch, see:&lt;br /&gt;
 man touch&lt;br /&gt;
Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild.&lt;br /&gt;
&lt;br /&gt;
 $ touch latex2html.SlackBuild&lt;br /&gt;
 $ touch slack-desc&lt;br /&gt;
&lt;br /&gt;
Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it.&lt;br /&gt;
&lt;br /&gt;
 $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1&lt;br /&gt;
&lt;br /&gt;
= Writing the slack-desc file =&lt;br /&gt;
&lt;br /&gt;
See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file.&lt;br /&gt;
&lt;br /&gt;
= Writing the SlackBuild script =&lt;br /&gt;
&lt;br /&gt;
This is the section which takes the most time, and I'll go through it with you step by step.  When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts.  Therefore, if you see something you would do a different way, feel free to do it that way - it's okay.&lt;br /&gt;
&lt;br /&gt;
===Initial Setup===&lt;br /&gt;
&lt;br /&gt;
Open the file latex2html.SlackBuild with your favourite editor.  What follows below is a piece by piece walk-through of a working SlackBuild script.  You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself.&lt;br /&gt;
&lt;br /&gt;
First, you'll need to set your shell interpreter.  This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability.  For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
&lt;br /&gt;
You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this:&lt;br /&gt;
&lt;br /&gt;
 #&amp;lt;your name&amp;gt; revision date yyyy/mm/dd&lt;br /&gt;
&lt;br /&gt;
With the next few lines, we set some variables that will be used throughout the script. First is the &amp;quot;CWD&amp;quot; variable; in our case, CWD will be &amp;lt;build_environment&amp;gt;/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp.&lt;br /&gt;
&lt;br /&gt;
 #Set initial variables:	&lt;br /&gt;
 &lt;br /&gt;
 CWD=$(pwd)&lt;br /&gt;
 if [ &amp;quot;$TMP&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
   TMP=/tmp&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you.&lt;br /&gt;
 &lt;br /&gt;
 # The version which appears in the application's filename&lt;br /&gt;
 VERSION=2002-2-1 	&lt;br /&gt;
 &lt;br /&gt;
 # If the version conflicts with the Slackware package standard&lt;br /&gt;
 # The dash character (&amp;quot;-&amp;quot;) is not allowed in the VERSION string&lt;br /&gt;
 # You can set the PKG_VERSION to something else than VERSION&lt;br /&gt;
 PKG_VERSION=2002.2.1 # the version which appears in the package name. &lt;br /&gt;
 &lt;br /&gt;
 ARCH=${ARCH:-i486} # the architecture on which you want to build your package	&lt;br /&gt;
 &lt;br /&gt;
 # First digit is the build number, which specifies how many times it has been built.	&lt;br /&gt;
 # Second string is the short form of the authors name, typical three initials:w&lt;br /&gt;
 BUILD=${BUILD:-1_rlw}&lt;br /&gt;
 &lt;br /&gt;
 # The application's name&lt;br /&gt;
 APP=latex2html&lt;br /&gt;
 &lt;br /&gt;
 # The installation directory of the package (where its actual directory&lt;br /&gt;
 # structure will be created) &lt;br /&gt;
 PKG=$TMP/package-$APP&lt;br /&gt;
&lt;br /&gt;
Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS).  If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use &amp;quot;-mcpu&amp;quot; instead of &amp;quot;-mtune&amp;quot; below.&lt;br /&gt;
&lt;br /&gt;
 if [ &amp;quot;$ARCH&amp;quot; = &amp;quot;i486&amp;quot; ]; then&lt;br /&gt;
   SLKCFLAGS=&amp;quot;-O2 -march=i486 -mtune=i686&amp;quot;&lt;br /&gt;
  elif [ &amp;quot;$ARCH&amp;quot; = &amp;quot;x86_64&amp;quot; ]; then&lt;br /&gt;
   SLKCFLAGS=&amp;quot;-O2 -fPIC&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically.&lt;br /&gt;
&lt;br /&gt;
=== Extract Sources ===&lt;br /&gt;
&lt;br /&gt;
 # Delete the leftover directories if they exist (due to a previous build)&lt;br /&gt;
 # and (re)create the packaging directory&lt;br /&gt;
 rm -rf $PKG &lt;br /&gt;
 mkdir -p $TMP $PKG&lt;br /&gt;
 rm -rf $TMP/$APP-$VERSION&lt;br /&gt;
 &lt;br /&gt;
 # Change to the TMP directory&lt;br /&gt;
 cd $TMP || exit 1&lt;br /&gt;
  &lt;br /&gt;
 # Extract the application source in TMP&lt;br /&gt;
 # Note: if your application comes as a tar.bz2, you need tar -jxvf&lt;br /&gt;
 tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Change to the application source directory&lt;br /&gt;
 cd $APP-$VERSION || exit 1&lt;br /&gt;
  &lt;br /&gt;
 # Change ownership and permissions if necessary&lt;br /&gt;
 # This may not be needed in some source tarballs, but it never hurts&lt;br /&gt;
 chown -R root:root .&lt;br /&gt;
 chmod -R u+w,go+r-w,a-s .&lt;br /&gt;
&lt;br /&gt;
===Configure and Compile Sources===&lt;br /&gt;
&lt;br /&gt;
 # Set configure options&lt;br /&gt;
 # If your app is written in C++, you'll also need to add a line for CXXFLAGS&lt;br /&gt;
 CFLAGS=&amp;quot;$SLKCFLAGS&amp;quot; \&lt;br /&gt;
   ./configure \&lt;br /&gt;
   --prefix=/usr \&lt;br /&gt;
   --sysconfdir=/etc \&lt;br /&gt;
   --localstatedir=/var \&lt;br /&gt;
   --with-perl=/usr/bin/perl \&lt;br /&gt;
   --enable-eps \&lt;br /&gt;
   --enable-gif \&lt;br /&gt;
   --enable-png \&lt;br /&gt;
   --build=$ARCH-slackware-linux \&lt;br /&gt;
   --host=$ARCH-slackware-linux &lt;br /&gt;
 &lt;br /&gt;
 # compile the source, but exit if anything goes wrong&lt;br /&gt;
 make || exit&lt;br /&gt;
  &lt;br /&gt;
 # Install everything into the package directory, but exit if anything goes wrong&lt;br /&gt;
 make install DESTDIR=$PKG || exit&lt;br /&gt;
&lt;br /&gt;
There are three configure options I always set:&lt;br /&gt;
&lt;br /&gt;
* --prefix=/usr&lt;br /&gt;
* --sysconfdir=/etc&lt;br /&gt;
* --localstatedir=/var&lt;br /&gt;
&lt;br /&gt;
This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location.  See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on &amp;quot;correct&amp;quot; locations of various filetypes.&lt;br /&gt;
&lt;br /&gt;
You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process.  You simply cd into the source directory and run:&lt;br /&gt;
 ./configure --help&lt;br /&gt;
This will produce a page or two (sometimes more, though) of information about various options that are specific to the application.  Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well:&lt;br /&gt;
 ./configure --help | lpr&lt;br /&gt;
 ./configure --help | less&lt;br /&gt;
&lt;br /&gt;
The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed.  This should always be our package directory ($PKG).  Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps.  A simple line like this:&lt;br /&gt;
 grep DESTDIR Makefile*&lt;br /&gt;
while inside the source directory should tell you whether it supports DESTDIR or not.  If you get some lines of output with $DESTDIR in them, you're in good shape.  If the command returns no output, then the Makefile does not support the DESTDIR variable.&lt;br /&gt;
&lt;br /&gt;
Here's a piece of advice: ALWAYS go through the ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script.  There are quite a few applications out there which try to do &amp;quot;funny stuff&amp;quot; during the installation phase.&lt;br /&gt;
 For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script&lt;br /&gt;
 Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need&lt;br /&gt;
 to do so until you look at all of the Makefiles for apcupsd (or watch the install process)&lt;br /&gt;
Anyway, if you go through the process as a normal user, you will get &amp;quot;Permission Denied&amp;quot; errors and such if the install process tries to write anywhere it's not allowed to do so.&lt;br /&gt;
&lt;br /&gt;
=== Install Documentation ===&lt;br /&gt;
&lt;br /&gt;
 # Create a directory for documentation&lt;br /&gt;
 mkdir -p $PKG/usr/doc/$APP-$VERSION&lt;br /&gt;
 &lt;br /&gt;
 # Copy documentation to the docs directory and fix permissions&lt;br /&gt;
 cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION&lt;br /&gt;
 find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;&lt;br /&gt;
&lt;br /&gt;
I (rworkman) also like to place a copy of my SlackBuild script in this directory&lt;br /&gt;
 cat $CWD/$APP.SlackBuild &amp;gt; $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild&lt;br /&gt;
&lt;br /&gt;
Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files.  In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application.&lt;br /&gt;
&lt;br /&gt;
=== Final Touches ===&lt;br /&gt;
&lt;br /&gt;
 # Create the ./install directory and copy the slack-desc into it&lt;br /&gt;
 mkdir -p $PKG/install&lt;br /&gt;
 cat $CWD/slack-desc &amp;gt; $PKG/install/slack-desc&lt;br /&gt;
&lt;br /&gt;
NOTE: In some cases, you will have some sort of command or setup that&lt;br /&gt;
needs to run after the package contents are installed - for this, you&lt;br /&gt;
would add a file to $CWD called &amp;quot;doinst.sh&amp;quot; which contains the needed&lt;br /&gt;
commands, and then compress that file with gzip.  The SlackBuild script&lt;br /&gt;
will zcat (which means to gunzip and cat its contents) that file and &lt;br /&gt;
write the output to a doinst.sh file in the $PKG/install directory.&lt;br /&gt;
&lt;br /&gt;
 # Add doinst.sh to package (if it exists)&lt;br /&gt;
 if [ -e $CWD/doinst.sh.gz ]; then&lt;br /&gt;
   zcat $CWD/doinst.sh.gz &amp;gt; $PKG/install/doinst.sh&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip&lt;br /&gt;
Note that you might be able to use &amp;quot;make install-strip&amp;quot; instead of &amp;quot;make install&amp;quot; above instead to accomplish the same purpose&lt;br /&gt;
&lt;br /&gt;
 # Strip some libraries and binaries&lt;br /&gt;
 ( cd $PKG&lt;br /&gt;
    find . | xargs file | grep &amp;quot;executable&amp;quot; | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
    find . | xargs file | grep &amp;quot;shared object&amp;quot; | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
 )&lt;br /&gt;
 &lt;br /&gt;
 # Compress man pages if they exist&lt;br /&gt;
 if [ -d $PKG/usr/man ]; then&lt;br /&gt;
   ( cd $PKG/usr/man&lt;br /&gt;
   find . -type f -exec gzip -9 {} \;&lt;br /&gt;
   for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done&lt;br /&gt;
   ) &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Compress info pages if they exist (and remove the dir file)&lt;br /&gt;
 if [ -d $PKG/usr/info ]; then&lt;br /&gt;
   gzip -9 $PKG/usr/info/*.info&lt;br /&gt;
   rm -f $PKG/usr/info/dir&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
=== Build the Package ===&lt;br /&gt;
&lt;br /&gt;
 # Build the package&lt;br /&gt;
 cd $PKG&lt;br /&gt;
 /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz&lt;br /&gt;
&lt;br /&gt;
= Other Concerns =&lt;br /&gt;
&lt;br /&gt;
=== DESTDIR Option Not Available ===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install.  On some applications the DESTDIR Makefile variable has another name.  For example, some Qt applications use the variable INSTALL_ROOT for the same purpose.  If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule.  Sometimes there will be no DESTDIR equivalent at all.  The &amp;lt;strong&amp;gt;best&amp;lt;/strong&amp;gt; thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that.  The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases.  In the meantime, here are some thoughts on the subject...&lt;br /&gt;
&lt;br /&gt;
==== Example 1: ====&lt;br /&gt;
Configure the build with:&lt;br /&gt;
 ./configure --prefix=$PKG/usr&lt;br /&gt;
along with your other configure options.  This will install *all* of the package contents in that directory.  If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine.  You might also try this along with your other configure options.&lt;br /&gt;
 ./configure --prefix=$PKG/usr \&lt;br /&gt;
    --sysconfdir=$PKG/etc \&lt;br /&gt;
    --localstatedir=$PKG/var &lt;br /&gt;
There are some applications, however, which &amp;quot;hard-code&amp;quot; configuration files based on configure/Makefile parameters.  In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes.&lt;br /&gt;
&lt;br /&gt;
==== Example 2: ====&lt;br /&gt;
This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile.  This approach makes it a bit easier for those not familiar with Makefiles.&lt;br /&gt;
&lt;br /&gt;
If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead:&lt;br /&gt;
 make prefix=$PKG/usr install&lt;br /&gt;
This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line.  Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make).  Some Makefiles may use a &amp;quot;'''PREFIX ='''&amp;quot; macro instead of the usual &amp;quot;'''prefix ='''&amp;quot;, so the 'make install' command would look like this:&lt;br /&gt;
 make PREFIX=$PKG/usr install&lt;br /&gt;
Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix.  For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so:&lt;br /&gt;
 grep -i '^prefix \?=' Makefile{,.in}&lt;br /&gt;
The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search &amp;quot;Makefile&amp;quot; or &amp;quot;Makefile.in&amp;quot; files, the second one being a template for the &amp;quot;configure&amp;quot; script.  Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching.&lt;br /&gt;
&lt;br /&gt;
Once in a while, there may be a &amp;quot;'''PREFIX ='''&amp;quot; in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location.&lt;br /&gt;
&lt;br /&gt;
=== Patching the Sources ===&lt;br /&gt;
&lt;br /&gt;
Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically.  &lt;br /&gt;
&lt;br /&gt;
===== Obtaining the Patch =====&lt;br /&gt;
&lt;br /&gt;
In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here.  Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above).&lt;br /&gt;
 $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff&lt;br /&gt;
It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this:&lt;br /&gt;
 $ gzip -9 bigsecuritypatch.diff&lt;br /&gt;
This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment.&lt;br /&gt;
&lt;br /&gt;
===== Applying the Patch =====&lt;br /&gt;
&lt;br /&gt;
You will now need to edit your &amp;lt;application&amp;gt;.SlackBuild script so that it applies the patch before it runs configure, make, and make install.  To do this, you'll want something like this to run before the configure script, but after extracting the sources:&lt;br /&gt;
 zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit&lt;br /&gt;
Depending on how the patch was created, you might use a different patchlevel on that line, as in:&lt;br /&gt;
 zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit&lt;br /&gt;
It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch.  You'll often need to skip the top-level directory, but not always (hence the -p0).&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[SlackBuild_Scripts]]&lt;br /&gt;
* [[Different_Approach_To_Buildscripts]]&lt;br /&gt;
* [[Building_A_Package]]&lt;br /&gt;
* [[Slack-desc]]&lt;br /&gt;
* [[Checkinstall]]&lt;br /&gt;
* [[Compiling]]&lt;br /&gt;
&lt;br /&gt;
= SlackBuild Script Repositories =&lt;br /&gt;
&lt;br /&gt;
;* http://slackbuilds.org&lt;br /&gt;
;* http://www.slackware.com/~alien/slackbuilds/&lt;br /&gt;
;* http://slackbuilds.slackadelic.com/&lt;br /&gt;
;* http://slackbuilds.rlworkman.net/&lt;br /&gt;
;* http://www.slackbuilds.net/slackbuilds/&lt;br /&gt;
;* http://slackbuild.strangeworlds.co.uk/&lt;br /&gt;
;* http://www2.linuxpackages.net/packages/SlackBuilds/&lt;br /&gt;
;* http://www.selkfoster.com.ar/downloads/slackbuilds/&lt;br /&gt;
;* http://slack.sarava.org/slackbuilds/&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Writing_A_SlackBuild_Script&amp;diff=22</id>
		<title>Writing A SlackBuild Script</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Writing_A_SlackBuild_Script&amp;diff=22"/>
		<updated>2009-05-28T17:39:45Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Created page with 'Category:Tutorials  = Introduction =   Originally written by Florian Mueller jjdm@jjdm.org  Substantial cleanup and enhancement by Robby Workman (rworkman)  If you use slackw...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
 Originally written by Florian Mueller jjdm@jjdm.org&lt;br /&gt;
 Substantial cleanup and enhancement by Robby Workman (rworkman)&lt;br /&gt;
&lt;br /&gt;
If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages.  In this situation, you have several options on how to install the application:&lt;br /&gt;
&lt;br /&gt;
 * ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
 * use checkinstall&lt;br /&gt;
 * use installwatch&lt;br /&gt;
 * compile and use makepkg by hand&lt;br /&gt;
 * write a SlackBuild script&lt;br /&gt;
&lt;br /&gt;
I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script.&lt;br /&gt;
&lt;br /&gt;
I cannot teach you how to build the &amp;quot;perfect&amp;quot; package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system.  You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly.  What I can teach you is how to build a package that works and which stays true to the &amp;quot;Slackware Way.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;But it takes so much time!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it.&lt;br /&gt;
&lt;br /&gt;
= The Slackware package structure =&lt;br /&gt;
&lt;br /&gt;
See [[Packages#Slackware Package Layout]]&lt;br /&gt;
&lt;br /&gt;
= Setting up your build environment =&lt;br /&gt;
&lt;br /&gt;
See [[Build_Environment]] for examples of how various users do this.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script.&lt;br /&gt;
&lt;br /&gt;
For this example, we'll create a package of latex2html - I made my homepage with that tool.&lt;br /&gt;
&lt;br /&gt;
First, you have to create a directory named &amp;lt;build_environment&amp;gt;/latex2html/. Get the most recent source code release of latex2html place it in this directory.  Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;build_environment&amp;gt;&lt;br /&gt;
 $ mkdir latex2html&lt;br /&gt;
 $ cd latex2html&lt;br /&gt;
 $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005&lt;br /&gt;
&lt;br /&gt;
Next, we'll create some other needed files with touch.  If you're not familiar with touch, see:&lt;br /&gt;
 man touch&lt;br /&gt;
Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild.&lt;br /&gt;
&lt;br /&gt;
 $ touch latex2html.SlackBuild&lt;br /&gt;
 $ touch slack-desc&lt;br /&gt;
&lt;br /&gt;
Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it.&lt;br /&gt;
&lt;br /&gt;
 $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1&lt;br /&gt;
&lt;br /&gt;
= Writing the slack-desc file =&lt;br /&gt;
&lt;br /&gt;
See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file.&lt;br /&gt;
&lt;br /&gt;
= Writing the SlackBuild script =&lt;br /&gt;
&lt;br /&gt;
This is the section which takes the most time, and I'll go through it with you step by step.  When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts.  Therefore, if you see something you would do a different way, feel free to do it that way - it's okay.&lt;br /&gt;
&lt;br /&gt;
===Initial Setup===&lt;br /&gt;
&lt;br /&gt;
Open the file latex2html.SlackBuild with your favourite editor.  What follows below is a piece by piece walk-through of a working SlackBuild script.  You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself.&lt;br /&gt;
&lt;br /&gt;
First, you'll need to set your shell interpreter.  This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability.  For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
&lt;br /&gt;
You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this:&lt;br /&gt;
&lt;br /&gt;
 #&amp;lt;your name&amp;gt; revision date yyyy/mm/dd&lt;br /&gt;
&lt;br /&gt;
With the next few lines, we set some variables that will be used throughout the script. First is the &amp;quot;CWD&amp;quot; variable; in our case, CWD will be &amp;lt;build_environment&amp;gt;/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp.&lt;br /&gt;
&lt;br /&gt;
 #Set initial variables:	&lt;br /&gt;
 &lt;br /&gt;
 CWD=$(pwd)&lt;br /&gt;
 if [ &amp;quot;$TMP&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
   TMP=/tmp&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you.&lt;br /&gt;
 &lt;br /&gt;
 # The version which appears in the application's filename&lt;br /&gt;
 VERSION=2002-2-1 	&lt;br /&gt;
 &lt;br /&gt;
 # If the version conflicts with the Slackware package standard&lt;br /&gt;
 # The dash character (&amp;quot;-&amp;quot;) is not allowed in the VERSION string&lt;br /&gt;
 # You can set the PKG_VERSION to something else than VERSION&lt;br /&gt;
 PKG_VERSION=2002.2.1 # the version which appears in the package name. &lt;br /&gt;
 &lt;br /&gt;
 ARCH=${ARCH:-i486} # the architecture on which you want to build your package	&lt;br /&gt;
 &lt;br /&gt;
 # First digit is the build number, which specifies how many times it has been built.	&lt;br /&gt;
 # Second string is the short form of the authors name, typical three initials:w&lt;br /&gt;
 BUILD=${BUILD:-1_rlw}&lt;br /&gt;
 &lt;br /&gt;
 # The application's name&lt;br /&gt;
 APP=latex2html&lt;br /&gt;
 &lt;br /&gt;
 # The installation directory of the package (where its actual directory&lt;br /&gt;
 # structure will be created) &lt;br /&gt;
 PKG=$TMP/package-$APP&lt;br /&gt;
&lt;br /&gt;
Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS).  If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use &amp;quot;-mcpu&amp;quot; instead of &amp;quot;-mtune&amp;quot; below.&lt;br /&gt;
&lt;br /&gt;
 if [ &amp;quot;$ARCH&amp;quot; = &amp;quot;i486&amp;quot; ]; then&lt;br /&gt;
   SLKCFLAGS=&amp;quot;-O2 -march=i486 -mtune=i686&amp;quot;&lt;br /&gt;
  elif [ &amp;quot;$ARCH&amp;quot; = &amp;quot;x86_64&amp;quot; ]; then&lt;br /&gt;
   SLKCFLAGS=&amp;quot;-O2 -fPIC&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically.&lt;br /&gt;
&lt;br /&gt;
=== Extract Sources ===&lt;br /&gt;
&lt;br /&gt;
 # Delete the leftover directories if they exist (due to a previous build)&lt;br /&gt;
 # and (re)create the packaging directory&lt;br /&gt;
 rm -rf $PKG &lt;br /&gt;
 mkdir -p $TMP $PKG&lt;br /&gt;
 rm -rf $TMP/$APP-$VERSION&lt;br /&gt;
 &lt;br /&gt;
 # Change to the TMP directory&lt;br /&gt;
 cd $TMP || exit 1&lt;br /&gt;
  &lt;br /&gt;
 # Extract the application source in TMP&lt;br /&gt;
 # Note: if your application comes as a tar.bz2, you need tar -jxvf&lt;br /&gt;
 tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Change to the application source directory&lt;br /&gt;
 cd $APP-$VERSION || exit 1&lt;br /&gt;
  &lt;br /&gt;
 # Change ownership and permissions if necessary&lt;br /&gt;
 # This may not be needed in some source tarballs, but it never hurts&lt;br /&gt;
 chown -R root:root .&lt;br /&gt;
 chmod -R u+w,go+r-w,a-s .&lt;br /&gt;
&lt;br /&gt;
===Configure and Compile Sources===&lt;br /&gt;
&lt;br /&gt;
 # Set configure options&lt;br /&gt;
 # If your app is written in C++, you'll also need to add a line for CXXFLAGS&lt;br /&gt;
 CFLAGS=&amp;quot;$SLKCFLAGS&amp;quot; \&lt;br /&gt;
   ./configure \&lt;br /&gt;
   --prefix=/usr \&lt;br /&gt;
   --sysconfdir=/etc \&lt;br /&gt;
   --localstatedir=/var \&lt;br /&gt;
   --with-perl=/usr/bin/perl \&lt;br /&gt;
   --enable-eps \&lt;br /&gt;
   --enable-gif \&lt;br /&gt;
   --enable-png \&lt;br /&gt;
   --build=$ARCH-slackware-linux \&lt;br /&gt;
   --host=$ARCH-slackware-linux &lt;br /&gt;
 &lt;br /&gt;
 # compile the source, but exit if anything goes wrong&lt;br /&gt;
 make || exit&lt;br /&gt;
  &lt;br /&gt;
 # Install everything into the package directory, but exit if anything goes wrong&lt;br /&gt;
 make install DESTDIR=$PKG || exit&lt;br /&gt;
&lt;br /&gt;
There are three configure options I always set:&lt;br /&gt;
&lt;br /&gt;
* --prefix=/usr&lt;br /&gt;
* --sysconfdir=/etc&lt;br /&gt;
* --localstatedir=/var&lt;br /&gt;
&lt;br /&gt;
This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location.  See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on &amp;quot;correct&amp;quot; locations of various filetypes.&lt;br /&gt;
&lt;br /&gt;
You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process.  You simply cd into the source directory and run:&lt;br /&gt;
 ./configure --help&lt;br /&gt;
This will produce a page or two (sometimes more, though) of information about various options that are specific to the application.  Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well:&lt;br /&gt;
 ./configure --help | lpr&lt;br /&gt;
 ./configure --help | less&lt;br /&gt;
&lt;br /&gt;
The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed.  This should always be our package directory ($PKG).  Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps.  A simple line like this:&lt;br /&gt;
 grep DESTDIR Makefile*&lt;br /&gt;
while inside the source directory should tell you whether it supports DESTDIR or not.  If you get some lines of output with $DESTDIR in them, you're in good shape.  If the command returns no output, then the Makefile does not support the DESTDIR variable.&lt;br /&gt;
&lt;br /&gt;
Here's a piece of advice: ALWAYS go through the ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script.  There are quite a few applications out there which try to do &amp;quot;funny stuff&amp;quot; during the installation phase.&lt;br /&gt;
 For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script&lt;br /&gt;
 Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need&lt;br /&gt;
 to do so until you look at all of the Makefiles for apcupsd (or watch the install process)&lt;br /&gt;
Anyway, if you go through the process as a normal user, you will get &amp;quot;Permission Denied&amp;quot; errors and such if the install process tries to write anywhere it's not allowed to do so.&lt;br /&gt;
&lt;br /&gt;
=== Install Documentation ===&lt;br /&gt;
&lt;br /&gt;
 # Create a directory for documentation&lt;br /&gt;
 mkdir -p $PKG/usr/doc/$APP-$VERSION&lt;br /&gt;
 &lt;br /&gt;
 # Copy documentation to the docs directory and fix permissions&lt;br /&gt;
 cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION&lt;br /&gt;
 find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;&lt;br /&gt;
&lt;br /&gt;
I (rworkman) also like to place a copy of my SlackBuild script in this directory&lt;br /&gt;
 cat $CWD/$APP.SlackBuild &amp;gt; $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild&lt;br /&gt;
&lt;br /&gt;
Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files.  In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application.&lt;br /&gt;
&lt;br /&gt;
=== Final Touches ===&lt;br /&gt;
&lt;br /&gt;
 # Create the ./install directory and copy the slack-desc into it&lt;br /&gt;
 mkdir -p $PKG/install&lt;br /&gt;
 cat $CWD/slack-desc &amp;gt; $PKG/install/slack-desc&lt;br /&gt;
&lt;br /&gt;
NOTE: In some cases, you will have some sort of command or setup that&lt;br /&gt;
needs to run after the package contents are installed - for this, you&lt;br /&gt;
would add a file to $CWD called &amp;quot;doinst.sh&amp;quot; which contains the needed&lt;br /&gt;
commands, and then compress that file with gzip.  The SlackBuild script&lt;br /&gt;
will zcat (which means to gunzip and cat its contents) that file and &lt;br /&gt;
write the output to a doinst.sh file in the $PKG/install directory.&lt;br /&gt;
&lt;br /&gt;
 # Add doinst.sh to package (if it exists)&lt;br /&gt;
 if [ -e $CWD/doinst.sh.gz ]; then&lt;br /&gt;
   zcat $CWD/doinst.sh.gz &amp;gt; $PKG/install/doinst.sh&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip&lt;br /&gt;
Note that you might be able to use &amp;quot;make install-strip&amp;quot; instead of &amp;quot;make install&amp;quot; above instead to accomplish the same purpose&lt;br /&gt;
&lt;br /&gt;
 # Strip some libraries and binaries&lt;br /&gt;
 ( cd $PKG&lt;br /&gt;
    find . | xargs file | grep &amp;quot;executable&amp;quot; | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
    find . | xargs file | grep &amp;quot;shared object&amp;quot; | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2&amp;gt; /dev/null&lt;br /&gt;
 )&lt;br /&gt;
 &lt;br /&gt;
 # Compress man pages if they exist&lt;br /&gt;
 if [ -d $PKG/usr/man ]; then&lt;br /&gt;
   ( cd $PKG/usr/man&lt;br /&gt;
   find . -type f -exec gzip -9 {} \;&lt;br /&gt;
   for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done&lt;br /&gt;
   ) &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Compress info pages if they exist (and remove the dir file)&lt;br /&gt;
 if [ -d $PKG/usr/info ]; then&lt;br /&gt;
   gzip -9 $PKG/usr/info/*.info&lt;br /&gt;
   rm -f $PKG/usr/info/dir&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
=== Build the Package ===&lt;br /&gt;
&lt;br /&gt;
 # Build the package&lt;br /&gt;
 cd $PKG&lt;br /&gt;
 /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz&lt;br /&gt;
&lt;br /&gt;
= Other Concerns =&lt;br /&gt;
&lt;br /&gt;
=== DESTDIR Option Not Available ===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install.  On some applications the DESTDIR Makefile variable has another name.  For example, some Qt applications use the variable INSTALL_ROOT for the same purpose.  If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule.  Sometimes there will be no DESTDIR equivalent at all.  The &amp;lt;strong&amp;gt;best&amp;lt;/strong&amp;gt; thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that.  The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases.  In the meantime, here are some thoughts on the subject...&lt;br /&gt;
&lt;br /&gt;
==== Example 1: ====&lt;br /&gt;
Configure the build with:&lt;br /&gt;
 ./configure --prefix=$PKG/usr&lt;br /&gt;
along with your other configure options.  This will install *all* of the package contents in that directory.  If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine.  You might also try this along with your other configure options.&lt;br /&gt;
 ./configure --prefix=$PKG/usr \&lt;br /&gt;
    --sysconfdir=$PKG/etc \&lt;br /&gt;
    --localstatedir=$PKG/var &lt;br /&gt;
There are some applications, however, which &amp;quot;hard-code&amp;quot; configuration files based on configure/Makefile parameters.  In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes.&lt;br /&gt;
&lt;br /&gt;
==== Example 2: ====&lt;br /&gt;
This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile.  This approach makes it a bit easier for those not familiar with Makefiles.&lt;br /&gt;
&lt;br /&gt;
If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead:&lt;br /&gt;
 make prefix=$PKG/usr install&lt;br /&gt;
This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line.  Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make).  Some Makefiles may use a &amp;quot;'''PREFIX ='''&amp;quot; macro instead of the usual &amp;quot;'''prefix ='''&amp;quot;, so the 'make install' command would look like this:&lt;br /&gt;
 make PREFIX=$PKG/usr install&lt;br /&gt;
Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix.  For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so:&lt;br /&gt;
 grep -i '^prefix \?=' Makefile{,.in}&lt;br /&gt;
The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search &amp;quot;Makefile&amp;quot; or &amp;quot;Makefile.in&amp;quot; files, the second one being a template for the &amp;quot;configure&amp;quot; script.  Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching.&lt;br /&gt;
&lt;br /&gt;
Once in a while, there may be a &amp;quot;'''PREFIX ='''&amp;quot; in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location.&lt;br /&gt;
&lt;br /&gt;
=== Patching the Sources ===&lt;br /&gt;
&lt;br /&gt;
Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically.  &lt;br /&gt;
&lt;br /&gt;
===== Obtaining the Patch =====&lt;br /&gt;
&lt;br /&gt;
In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here.  Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above).&lt;br /&gt;
 $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff&lt;br /&gt;
It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this:&lt;br /&gt;
 $ gzip -9 bigsecuritypatch.diff&lt;br /&gt;
This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment.&lt;br /&gt;
&lt;br /&gt;
===== Applying the Patch =====&lt;br /&gt;
&lt;br /&gt;
You will now need to edit your &amp;lt;application&amp;gt;.SlackBuild script so that it applies the patch before it runs configure, make, and make install.  To do this, you'll want something like this to run before the configure script, but after extracting the sources:&lt;br /&gt;
 zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit&lt;br /&gt;
Depending on how the patch was created, you might use a different patchlevel on that line, as in:&lt;br /&gt;
 zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit&lt;br /&gt;
It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch.  You'll often need to skip the top-level directory, but not always (hence the -p0).&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[SlackBuild_Scripts]]&lt;br /&gt;
* [[Different_Approach_To_Buildscripts]]&lt;br /&gt;
* [[Building_A_Package]]&lt;br /&gt;
* [[Slack-desc]]&lt;br /&gt;
* [[Checkinstall]]&lt;br /&gt;
* [[Compiling]]&lt;br /&gt;
&lt;br /&gt;
= SlackBuild Script Repositories =&lt;br /&gt;
&lt;br /&gt;
;* http://slackbuilds.org&lt;br /&gt;
;* http://www.slackware.com/~alien/slackbuilds/&lt;br /&gt;
;* http://slackbuilds.slackadelic.com/&lt;br /&gt;
;* http://slackbuilds.rlworkman.net/&lt;br /&gt;
;* http://www.slackbuilds.net/slackbuilds/&lt;br /&gt;
;* http://slackbuild.strangeworlds.co.uk/&lt;br /&gt;
;* http://www2.linuxpackages.net/packages/SlackBuilds/&lt;br /&gt;
;* http://www.selkfoster.com.ar/downloads/slackbuilds/&lt;br /&gt;
;* http://slack.sarava.org/slackbuilds/&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=SlackBuild_Scripts&amp;diff=21</id>
		<title>SlackBuild Scripts</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=SlackBuild_Scripts&amp;diff=21"/>
		<updated>2009-05-28T17:37:32Z</updated>

		<summary type="html">&lt;p&gt;Dugan: Created page with 'SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source.   While not necessary to compile and create packages on Slack...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. &lt;br /&gt;
&lt;br /&gt;
While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages.&lt;br /&gt;
&lt;br /&gt;
== Using SlackBuild Scripts ==&lt;br /&gt;
In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;mkdir pidgin&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;cd pidgin&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;wget --passive-ftp &amp;lt;nowiki&amp;gt;ftp://slackware.at/slackware-12.1/source/xap/pidgin/*&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This downloads the files needed for Slackware scripts.  The same idea applies for SlackBuild scripts from other&lt;br /&gt;
sources - you generally need to download all of the files in the directory that contains the build script.  For example, in the pidgin source directory, you would need the following files:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;pidgin-2.4.1.tar.bz2  pidgin-encryption-3.0.tar.gz  pidgin.SlackBuild*  slack-desc &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory.&lt;br /&gt;
&lt;br /&gt;
Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;VERSION=2.4.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the line we are looking at. Now we can change this to&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;VERSION=2.4.2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;chmod +x pidgin.SlackBuild&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now this is executable, and we want to run as root for permissions and other reasons so we want to become root:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;su -&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we start the script, and this will compile Pidgin and make a Slackware package.  Depending on how the &lt;br /&gt;
script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some&lt;br /&gt;
other location - have a look at the SlackBuild script for some hints if you can't find the package that&lt;br /&gt;
was built.  &lt;br /&gt;
&lt;br /&gt;
Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to&lt;br /&gt;
move it somewhere else on your system for safekeeping).&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;./pidgin.SlackBuild&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=SlackBuild Archives=&lt;br /&gt;
;* http://www.slackbuilds.org&lt;br /&gt;
;* http://repository.slacky.eu&lt;br /&gt;
;* http://www.slackware.com/~alien/slackbuilds/&lt;br /&gt;
;* http://www.slackbuilds.net/slackbuilds/&lt;br /&gt;
;* http://slackbuild.strangeworlds.co.uk/&lt;br /&gt;
&lt;br /&gt;
=Other Resources=&lt;br /&gt;
For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
</feed>