wok-next view brscan/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents 92b0135d5efa
children 0ed3f456a542
line source
1 # SliTaz package receipt v2.
3 PACKAGE="brscan"
4 VERSION="0.2.4"
5 CATEGORY="office"
6 SHORT_DESC="Brother Scanner driver for SANE"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://solutions.brother.com/linux/sol/printer/linux/sane_drivers.html" # FIXME 404
10 HOST_ARCH="i486"
12 TARBALL="brscan-src-$VERSION.tar.gz"
13 #WGET_URL="http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/sane_source/$TARBALL"
14 WGET_URL="http://mirror1.slitaz.org/sources/packages/b/$TARBALL"
16 BUILD_DEPENDS="file ncurses-dev libusb-compat-dev"
17 SPLIT="brscan2"
19 compile_rules() {
20 case $ARCH in
21 i?86)
22 cd brscan
23 ./configure $CONFIGURE_ARGS || return 1
24 ;;
25 x86_64)
26 cd brscan64
27 ;;
28 esac
30 sed -i '/mk_package/d' Makefile
31 make -j1 &&
32 {
33 cd ..
34 mkdir -p $install
35 cp -a brscan $install
36 }
37 }
39 genpkg_rules() {
40 case $PACKAGE in
41 brscan)
42 mkdir -p $fs/usr/bin $fs/usr/lib/sane
43 for i in BHL BHL2 BHL2FB BHLFB BHMFB BHminiFB YL4 YL4FB \
44 ZL2 ZL2FB ZLe ZLeFB; do
45 mkdir -p $fs/usr/local/Brother/sane/GrayCmData/$i
46 cp -a $install/brscan/libbrcolm/GrayCmData/$i/* \
47 $fs/usr/local/Brother/sane/GrayCmData/$i
48 chmod 644 $fs/usr/local/Brother/sane/GrayCmData/$i/*
49 done
50 cp $install/brscan/backend_brscan/.libs/libsane-brother.so.1.0.7 \
51 $fs/usr/lib/sane/libsane-brother.so.1.0.7
52 ln -s libsane-brother.so.1.0.7 $fs/usr/lib/sane/libsane-brother.so.1
53 ln -s libsane-brother.so.1 $fs/usr/lib/sane/libsane-brother.so
54 cp $install/brscan/libbrscandec/libbrscandec.so.1.0.0 \
55 $fs/usr/lib/libbrscandec.so.1.0.0
56 chmod 755 $fs/usr/lib/libbrscandec.so.1.0.0
57 ln -s libbrscandec.so.1.0.0 $fs/usr/lib/libbrscandec.so.1
58 ln -s libbrscandec.so.1 $fs/usr/lib/libbrscandec.so
59 cp $install/brscan/libbrcolm/libbrcolm.so.1.0.0 \
60 $fs/usr/lib/libbrcolm.so.1.0.0
61 ln -s libbrcolm.so.1.0.0 $fs/usr/lib/libbrcolm.so.1
62 ln -s libbrcolm.so.1 $fs/usr/lib/libbrcolm.so
63 cp $install/brscan/mk_package/Brsane.ini \
64 $fs/usr/local/Brother/sane/Brsane.ini
65 cp $install/brscan/mk_package/brsanenetdevice.cfg \
66 $fs/usr/local/Brother/sane/brsanenetdevice.cfg
67 chmod 666 $fs/usr/local/Brother/sane/brsanenetdevice.cfg
68 cp $install/brscan/netconfig/brsaneconfig \
69 $fs/usr/local/Brother/sane/brsaneconfig
70 ln -s /usr/local/Brother/sane/brsaneconfig $fs/usr/bin/brsaneconfig
71 cp $install/brscan/mk_package/setupSaneScan \
72 $fs/usr/local/Brother/sane/setupSaneScan
73 chmod 755 $fs/usr/local/Brother/sane/setupSaneScan
74 DEPENDS="sane-backends ncurses"
75 TAGS="scanner driver"
76 ;;
77 brscan2)
78 mkdir -p $fs/usr/bin $fs/usr/lib/sane $fs/usr/local/Brother/sane/models2
79 for i in ALL AL; do
80 mkdir -p $fs/usr/local/Brother/sane/GrayCmData/$i
81 cp -a $src/brscan/libbrcolm2/GrayCmData/$i/* \
82 $fs/usr/local/Brother/sane/GrayCmData/$i
83 chmod 644 $fs/usr/local/Brother/sane/GrayCmData/$i
84 done
85 cp $src/brscan/backend_brscan2/.libs/libsane-brother2.so.1.0.7 \
86 $fs/usr/lib/sane/libsane-brother2.so.1.0.7
87 ln -s libsane-brother2.so.1.0.7 $fs/usr/lib/sane/libsane-brother2.so.1
88 ln -s libsane-brother2.so.1 $fs/usr/lib/sane/libsane-brother2.so
89 cp $src/brscan/libbrscandec2/libbrscandec2.so.1.0.0 \
90 $fs/usr/lib/libbrscandec2.so.1.0.0
91 chmod 755 $fs/usr/lib/libbrscandec2.so.1.0.0
92 ln -s libbrscandec2.so.1.0.0 $fs/usr/lib/libbrscandec2.so.1
93 ln -s libbrscandec2.so.1 $fs/usr/lib/libbrscandec2.so
94 cp $src/brscan/libbrcolm2/libbrcolm2.so.1.0.0 \
95 $fs/usr/lib/libbrcolm2.so.1.0.0
96 chmod 755 $fs/usr/lib/libbrcolm2.so.1.0.0
97 ln -s libbrcolm2.so.1.0.0 $fs/usr/lib/libbrcolm2.so.1
98 ln -s libbrcolm2.so.1 $fs/usr/lib/libbrcolm2.so
99 while read line; do
100 echo $line
101 echo $line | grep -q 'Support Model' || continue
102 cat <<EOT
103 0x01eb,6,1,"MFC-7320",131,4
104 0x01e7,6,1,"MFC-7340",131,4
105 0x01e6,6,1,"MFC-7440N",131,4
106 0x01ee,6,1,"MFC-7450",131,4
107 0x01ed,6,1,"MFC-7840N",131,4
108 0x01e5,6,1,"MFC-7840W",131,4
109 0x01ea,6,1,"DCP-7030",131,4
110 0x01e9,6,1,"DCP-7040",131,4
111 0x01e8,6,1,"DCP-7045N",131,4
113 EOT
114 done < $src/brscan/mk_package/Brsane2.ini > \
115 $fs/usr/local/Brother/sane/Brsane2.ini
116 chmod 644 $fs/usr/local/Brother/sane/Brsane2.ini
117 cp $src/brscan/mk_package/brsanenetdevice2.cfg \
118 $fs/usr/local/Brother/sane/brsanenetdevice2.cfg
119 chmod 666 $fs/usr/local/Brother/sane/brsanenetdevice2.cfg
120 cp $src/brscan/netconfig/brsaneconfig2 \
121 $fs/usr/local/Brother/sane/brsaneconfig2
122 ln -s /usr/local/Brother/sane/brsaneconfig2 $fs/usr/bin/brsaneconfig2
123 cp $src/brscan/mk_package/setupSaneScan2 \
124 $fs/usr/local/Brother/sane/setupSaneScan2
125 chmod 755 $fs/usr/local/Brother/sane/setupSaneScan2
126 cp $src/brscan/mk_package/ext1.ini \
127 $fs/usr/local/Brother/sane/models2/ext1.ini
128 CAT="office|part 2"
129 DEPENDS="sane-backends"
130 TAGS="scanner driver"
131 ;;
132 esac
133 }
135 post_install_brscan() {
136 chroot "$1/" /usr/local/Brother/sane/setupSaneScan -i
137 }
139 pre_remove_brscan() {
140 chroot "$1/" /usr/local/Brother/sane/setupSaneScan -e
141 }
143 post_install_brscan2() {
144 chroot "$1/" /usr/local/Brother/sane/setupSaneScan2 -i
145 }
147 pre_remove_brscan2() {
148 chroot "$1/" /usr/local/Brother/sane/setupSaneScan2 -e
149 }