#!/bin/sh
#
#	pcspinstall		
#
# Create the devices
#
#	pcsp 		(30, 3)	(simulate /dev/dsp)
#
if [ -e /dev/pcsp ]; then 
	rm -f /dev/pcsp 
fi
mknod -m 666 /dev/pcsp c 30 3
#
#	SPARC audio	(30, 4)	(simulate /dev/audio)
#
if [ -e /dev/pcaudio ]; then
	rm -f /dev/pcaudio
fi
mknod -m 666 /dev/pcaudio c 30 4
#
#       PCSP mixer      (30, 0) (simulate /dev/mixer)
#
if [ -e /dev/pcmixer ]; then
        rm -f /dev/pcmixer
fi
mknod -m 666 /dev/pcmixer c 30 0
#
# and make links if /dev/dsp, /dev/audio and /dev/mixer don't exist
#
if [ ! -e /dev/dsp ]; then
	ln -s /dev/pcsp /dev/dsp 
fi
if [ ! -e /dev/audio ]; then
	ln -s /dev/pcaudio /dev/audio 
fi
if [ ! -e /dev/mixer ]; then
        ln -s /dev/pcmixer /dev/mixer
fi
#
# check for <sys/pcsp.h> and create one if not exist
#
if [ ! -e /usr/include/sys/pcsp.h ]; then
	echo '#include <linux/pcsp.h>' > /usr/include/sys/pcsp.h
fi
#
# check for <sys/soundcard.h> and create one if not exist
#
if [ ! -e /usr/include/sys/soundcard.h ]; then
	echo '#include <sys/pcsp.h>' > /usr/include/sys/soundcard.h
fi
exit 0
