updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / capt-src / capt-src.install
blob1f78dbdbb616569fe25df56a762a31c069d23241
1 post_install(){
2     if [ -d /usr/share/ppd ]
3         then
4         cd /usr/share/cups/model
5         for fn in CN*CAPT*.ppd
6         do
7             ln -s /usr/share/cups/model/${fn} /usr/share/ppd/${fn}
8             done
9     fi
11     # Fifo files needed for the daemon
12     # Based on the official Debian postinst script
13     mkdir -p /var/ccpd
14     for i in {0..7}
15      do
16         mkfifo -m 660 /var/ccpd/fifo${i}
17     done
19     chown -R root.lp /var/ccpd
20     chmod 770 /var/ccpd
21     
22     mkdir -p /var/captmon/
23     chown -R root.lp /var/captmon
24     chmod -R 770 /var/captmon
26     cat << EOF
27     >>> Installation:
28     >>> 1) Make sure CUPS is running and your printer is turned on and connected to your computer.
29     >>> eg.
30     >>> /etc/rc.d/cups start
31     >>>
32     >>> 2) /usr/sbin/lpadmin -p <name> -m <corresponding ppd> -v ccp:/var/ccpd/fifo0 -E 
33     >>> eg.
34     >>> /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E 
35     >>> (you can find ppds in /usr/share/cups/model/)
36     >>>
37     >>> 3) Check the name of the device, udev created for you.
38     >>> eg. /dev/usb/lp0
39     >>>
40     >>> 4) /usr/sbin/ccpdadmin -p <name> -o udev_device
41     >>> eg.
42     >>> /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0
43     >>> (should show table with new printer)
44     >>> 
45     >>> 5) /etc/rc.d/ccpd start
46     >>>
47     >>> 6) Now you can print. Add cups and ccpd to the DAEMONS line of your rc.conf.
48 EOF
51 post_upgrade(){
52         post_remove
53         post_install
56 post_remove(){
57     if [ -d /usr/share/ppd ]
58         then
59             rm -rf /usr/share/ppd/CN*CAPT*.ppd
60     fi
61     
62     rm -rf /var/ccpd
63     rm -rf /var/captmon
66 op=$1
67 shift
68 $op $*