Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > media > main > by-pkgid > 2a60d8dc79434c4d91c6997e39a37f74 > scriptlet

omni-0.9.1-12mdk.i586.rpm

POSTIN

/bin/sh
# Taken from the RedHat/OmniAll.spec file from the Omni source tree

# add /usr/lib/Omni/lib to /etc/ld.so.conf
if ! grep /usr/lib/Omni /etc/ld.so.conf >/dev/null 2>&1; then \
	cp /etc/ld.so.conf /etc/ld.so.conf.preomni; \
	echo /usr/lib/Omni >> /etc/ld.so.conf; \
	ldconfig; \
fi
# add omni.sh to /etc/profile.d
#if [ ! -f /etc/profile.d/omni.sh ]; then \
#	echo 'if ! echo $PATH | /bin/grep -q "/usr/lib/Omni/bin" ; then' > /etc/profile.d/omni.sh; \
#	echo '	PATH=$PATH:/usr/lib/Omni/bin' >> /etc/profile.d/omni.sh; \
#	echo 'fi' >> /etc/profile.d/omni.sh; \
#	chmod a+rx /etc/profile.d/omni.sh; \
#fi
# add omni.csh to /etc/profile.d
#if [ ! -f /etc/profile.d/omni.csh ]; then \
#	echo 'if ( `echo $PATH | grep /usr/lib/Omni/bin`"a" == "a" ) then' > /etc/profile.d/omni.csh; \
#	echo '	setenv PATH "${PATH}:/usr/lib/Omni/bin"' >> /etc/profile.d/omni.csh; \
#	echo 'endif' >> /etc/profile.d/omni.csh; \
#	chmod a+rx /etc/profile.d/omni.csh; \
#fi
# check for old path
if grep /Omni/bin /etc/profile >/dev/null 2>&1; then \
	/bin/cp /etc/profile /etc/profile.postomni; \
	sed '/\/Omni\/bin/d' /etc/profile > /tmp/$$; \
	/bin/cp /tmp/$$ /etc/profile.conf; \
	/bin/rm /tmp/$$; \
fi

# Remove old Foomatic data of Omni (to assure that the new Foomatic data
# will get installed)
rm -f /usr/share/foomatic/db/source/*/omni*.xml
rm -f `grep -l "Foomatic entry automatically generated by Omni" /usr/share/foomatic/db/source/printer/*.xml`

# We use only the CUPS driver, Foomatic support in Omni is currently broken

# Determine the recommended drivers taking Omni into account
/usr/sbin/foomatic-preferred-driver > /dev/null 2>&1
# Restart the CUPS daemon when it is running, but do not start
# it when it is not running. The restart of the CUPS daemon
# updates the CUPS-internal PPD index
/sbin/service cups condrestart > /dev/null 2>/dev/null || :

POSTUN

/bin/sh
if [ "$1" -eq "0" ]; then
	# On removal
	# Taken from the RedHat/OmniAll.spec file from the Omni source tree

	# remove /usr/lib/Omni/lib from /etc/ld.so.conf
	if grep /usr/lib/Omni/lib /etc/ld.so.conf >/dev/null 2>&1; then \
		/bin/cp /etc/ld.so.conf /etc/ld.so.conf.postomni; \
		sed '/\/usr\/lib\/Omni\/lib/d' /etc/ld.so.conf > /tmp/$$; \
		/bin/cp /tmp/$$ /etc/ld.so.conf; \
		/bin/rm /tmp/$$; \
		ldconfig; \
	fi
	# remove omni.sh from /etc/profile.d
        if [ -f /etc/profile.d/omni.sh ]; then \
		/bin/rm /etc/profile.d/omni.sh; \
	fi
	# remove omni.csh from /etc/profile.d
        if [ -f /etc/profile.d/omni.csh ]; then \
		/bin/rm /etc/profile.d/omni.csh; \
	fi

	# Remove Foomatic data of Omni
	rm -f /usr/share/foomatic/db/source/*/omni*.xml
	rm -f `grep -l "Foomatic entry automatically generated by Omni" /usr/share/foomatic/db/source/printer/*.xml`
	# Clean up Foomatic recommended drivers
	/usr/sbin/foomatic-preferred-driver > /dev/null 2>&1
	# Restart the CUPS daemon when it is running, but do not start
	# it when it is not running. The restart of the CUPS daemon
	# updates the CUPS-internal PPD index
	/sbin/service cups condrestart > /dev/null 2>/dev/null || :
fi