make-hplip 2.48 KB
Newer Older
1 2 3
#!/bin/sh
#
#    Copyright (C) 2011 MPA
4
#    Copyright (C) 2013 Ruben Rodriguez <ruben@trisquel.info>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#

21
VERSION=1
22 23 24

. ./config

25
echo Removing printers not supported with free drivers from the database
26
tmp=`mktemp`
27
output=`mktemp`
28 29
printers='data/models/models.dat'

30 31 32 33 34 35 36 37 38
# Keep header license
sed  '/\[/,99999d' $printers > $output

for model in $(grep '\[' $printers | /bin/sed 's/\[//; s/\]//'); do
  sed -n "/\[$model\]/,/^$/p;" $printers > $tmp
  grep '^download=True' -q $tmp && continue
  grep '^plugin=1' -q $tmp && continue
  grep '^support-type=0' -q $tmp && continue
  cat $tmp >> $output
39
done
40 41 42 43 44 45 46 47 48 49 50

cp $output $printers


#grep -B 7 'download=True' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' > $tmp2
#grep -B 18 'plugin=1' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' >> $tmp2
#grep -B 33 'support-type=0' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' >> $tmp2
#sort -u < $tmp2 > $tmp
#for i in `cat $tmp`; do 
#	/bin/sed -i '/\['"$i"'\]/,/^$/d' $printers
#done
51 52
sed -i 's/plugin=2/plugin=0/g' $printers

53
rm $tmp $tmp2
54 55

rm debian/patches/hp_photosmart_pro_b9100_support.dpatch
Ruben Rodriguez committed
56
sed -i '/hp_photosmart_pro_b9100_support.dpatch/d' debian/patches/series
57
rm debian/patches/ubuntu-hp-mkuri-notification-text.dpatch
Ruben Rodriguez committed
58
sed -i '/ubuntu-hp-mkuri-notification-text.dpatch/d' debian/patches/series
59 60 61 62 63 64 65
rm debian/local/scripts/hp-plugin-ubuntu
sed /hp-plugin-ubuntu/d ./debian/rules -i

# disable downloader
#rm plugin.py
#sed s/plugin.py//g -i ./hplip.list.in ./Makefile.in ./Makefile.am
#sed '/run_plugin_command/s/$/\n    return/' -i ./base/pkit.py
66

67 68 69 70
# Fix compilation problems
sed '/ln -s \/usr\/share\/hplip\/hpssd.py/s:ln.*:cp hpssd.py ./debian/tmp/usr/sbin/hpssd:' -i debian/rules
apt-get install --force-yes -y hplip

71 72 73
changelog "Removed printers with propietary drivers (required and optional)"

compile