<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Doinst.sh - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=Doinst.sh&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 16:09:21 GMT</lastBuildDate>
		<item>
			<title>Dugan: Migrated from old wiki</title>
			<link>https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26&amp;oldid=prev</guid>
			<description>&lt;p&gt;Migrated from old wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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;</description>
			<pubDate>Thu, 28 May 2009 20:09:56 GMT</pubDate>
			<dc:creator>Dugan</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Doinst.sh</comments>
		</item>
</channel></rss>