Lines 4-10
Link Here
|
4 |
|
4 |
|
5 |
EAPI="5" |
5 |
EAPI="5" |
6 |
|
6 |
|
7 |
inherit autotools eutils flag-o-matic multilib udev user toolchain-funcs |
7 |
AUTOTOOLS_AUTORECONF=1 |
|
|
8 |
inherit autotools-multilib eutils flag-o-matic udev user toolchain-funcs |
8 |
|
9 |
|
9 |
# gphoto and v4l are handled by their usual USE flags. |
10 |
# gphoto and v4l are handled by their usual USE flags. |
10 |
# The pint backend was disabled because I could not get it to compile. |
11 |
# The pint backend was disabled because I could not get it to compile. |
Lines 120-142
Link Here
|
120 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
121 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
121 |
|
122 |
|
122 |
RDEPEND=" |
123 |
RDEPEND=" |
123 |
sane_backends_dc210? ( virtual/jpeg ) |
124 |
sane_backends_dc210? ( virtual/jpeg[${MULTILIB_USEDEP}] ) |
124 |
sane_backends_dc240? ( virtual/jpeg ) |
125 |
sane_backends_dc240? ( virtual/jpeg[${MULTILIB_USEDEP}] ) |
125 |
sane_backends_dell1600n_net? ( virtual/jpeg |
126 |
sane_backends_dell1600n_net? ( virtual/jpeg[${MULTILIB_USEDEP}] |
126 |
media-libs/tiff ) |
127 |
media-libs/tiff[${MULTILIB_USEDEP}] ) |
127 |
avahi? ( >=net-dns/avahi-0.6.24 ) |
128 |
avahi? ( >=net-dns/avahi-0.6.24 ) |
128 |
sane_backends_canon_pp? ( sys-libs/libieee1284 ) |
129 |
sane_backends_canon_pp? ( sys-libs/libieee1284[${MULTILIB_USEDEP}] ) |
129 |
sane_backends_hpsj5s? ( sys-libs/libieee1284 ) |
130 |
sane_backends_hpsj5s? ( sys-libs/libieee1284[${MULTILIB_USEDEP}] ) |
130 |
sane_backends_mustek_pp? ( sys-libs/libieee1284 ) |
131 |
sane_backends_mustek_pp? ( sys-libs/libieee1284[${MULTILIB_USEDEP}] ) |
131 |
usb? ( virtual/libusb:1 ) |
132 |
usb? ( virtual/libusb:1[${MULTILIB_USEDEP}] ) |
132 |
gphoto2? ( |
133 |
gphoto2? ( |
133 |
media-libs/libgphoto2:= |
134 |
media-libs/libgphoto2:=[${MULTILIB_USEDEP}] |
134 |
virtual/jpeg |
135 |
virtual/jpeg[${MULTILIB_USEDEP}] |
135 |
) |
136 |
) |
136 |
v4l? ( media-libs/libv4l ) |
137 |
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] ) |
137 |
xinetd? ( sys-apps/xinetd ) |
138 |
xinetd? ( sys-apps/xinetd ) |
138 |
snmp? ( net-analyzer/net-snmp ) |
139 |
snmp? ( net-analyzer/net-snmp ) |
139 |
systemd? ( sys-apps/systemd ) |
140 |
systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] ) |
140 |
" |
141 |
" |
141 |
|
142 |
|
142 |
DEPEND="${RDEPEND} |
143 |
DEPEND="${RDEPEND} |
Lines 158-163
Link Here
|
158 |
enewuser saned -1 -1 -1 scanner |
159 |
enewuser saned -1 -1 -1 scanner |
159 |
} |
160 |
} |
160 |
|
161 |
|
|
|
162 |
PATCHES=( "${FILESDIR}"/niash_array_index.patch |
163 |
"${FILESDIR}"/${P}-unused-cups.patch |
164 |
"${FILESDIR}"/${P}-automagic_systemd.patch |
165 |
"${FILESDIR}"/${P}-saned_pidfile_location.patch) |
166 |
|
161 |
src_prepare() { |
167 |
src_prepare() { |
162 |
cat >> backend/dll.conf.in <<-EOF |
168 |
cat >> backend/dll.conf.in <<-EOF |
163 |
# Add support for the HP-specific backend. Needs net-print/hplip installed. |
169 |
# Add support for the HP-specific backend. Needs net-print/hplip installed. |
Lines 165-177
Link Here
|
165 |
# Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
171 |
# Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
166 |
epkowa |
172 |
epkowa |
167 |
EOF |
173 |
EOF |
168 |
epatch "${FILESDIR}"/niash_array_index.patch \ |
|
|
169 |
"${FILESDIR}"/${P}-unused-cups.patch \ |
170 |
"${FILESDIR}"/${P}-automagic_systemd.patch \ |
171 |
"${FILESDIR}"/${P}-saned_pidfile_location.patch |
172 |
# Fix for "make check". |
174 |
# Fix for "make check". |
173 |
sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html* |
175 |
sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html* |
174 |
AT_NOELIBTOOLIZE=yes eautoreconf |
176 |
autotools-multilib_src_prepare |
175 |
} |
177 |
} |
176 |
|
178 |
|
177 |
src_configure() { |
179 |
src_configure() { |
Lines 188-206
Link Here
|
188 |
fi |
190 |
fi |
189 |
done |
191 |
done |
190 |
|
192 |
|
191 |
local myconf="$(use_enable usb libusb_1_0) $(use_with snmp)" |
193 |
local myeconfargs=( |
|
|
194 |
$(use_with gphoto2) |
195 |
$(use_with systemd) |
196 |
$(use_with v4l) |
197 |
$(use_enable avahi) |
198 |
$(use_enable ipv6) |
199 |
$(use_enable threads pthread) |
200 |
$(use_enable usb libusb_1_0) |
201 |
$(use_with snmp) ) |
192 |
# you can only enable this backend, not disable it... |
202 |
# you can only enable this backend, not disable it... |
193 |
if use sane_backends_pnm; then |
203 |
if use sane_backends_pnm; then |
194 |
myconf="${myconf} --enable-pnm-backend" |
204 |
myeconfargs+=( --enable-pnm-backend ) |
195 |
fi |
205 |
fi |
196 |
if ! use doc; then |
206 |
if ! use doc; then |
197 |
myconf="${myconf} --disable-latex" |
207 |
myeconfargs+=( --disable-latex ) |
198 |
fi |
208 |
fi |
199 |
if use sane_backends_mustek_pp; then |
209 |
if use sane_backends_mustek_pp; then |
200 |
myconf="${myconf} --enable-parport-directio" |
210 |
myeconfargs+=( --enable-parport-directio ) |
201 |
fi |
211 |
fi |
202 |
if ! ( use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp ); then |
212 |
if ! ( use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp ); then |
203 |
myconf="${myconf} sane_cv_use_libieee1284=no" |
213 |
myeconfargs+=( sane_cv_use_libieee1284=no ) |
204 |
fi |
214 |
fi |
205 |
# if LINGUAS is set, just use the listed and supported localizations. |
215 |
# if LINGUAS is set, just use the listed and supported localizations. |
206 |
if [ "${LINGUAS-NoLocalesSet}" != NoLocalesSet ]; then |
216 |
if [ "${LINGUAS-NoLocalesSet}" != NoLocalesSet ]; then |
Lines 212-230
Link Here
|
212 |
done |
222 |
done |
213 |
fi |
223 |
fi |
214 |
SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
224 |
SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
215 |
BACKENDS="${BACKENDS}" econf \ |
225 |
BACKENDS="${BACKENDS}" autotools-multilib_src_configure |
216 |
$(use_with gphoto2) \ |
|
|
217 |
$(use_with systemd) \ |
218 |
$(use_with v4l) \ |
219 |
$(use_enable avahi) \ |
220 |
$(use_enable ipv6) \ |
221 |
$(use_enable threads pthread) \ |
222 |
${myconf} |
223 |
} |
226 |
} |
224 |
|
227 |
|
225 |
src_compile() { |
228 |
src_compile() { |
226 |
emake VARTEXFONTS="${T}/fonts" |
229 |
autotools-multilib_src_compile VARTEXFONTS="${T}/fonts" |
|
|
230 |
multilib_for_best_abi build_hotplug |
231 |
} |
227 |
|
232 |
|
|
|
233 |
build_hotplug() { |
234 |
pushd "${BUILD_DIR}" > /dev/null || die |
228 |
if use usb; then |
235 |
if use usb; then |
229 |
cd tools/hotplug |
236 |
cd tools/hotplug |
230 |
grep -v '^$' libsane.usermap > libsane.usermap.new |
237 |
grep -v '^$' libsane.usermap > libsane.usermap.new |
Lines 247-275
Link Here
|
247 |
udev/libsane.rules |
254 |
udev/libsane.rules |
248 |
) |
255 |
) |
249 |
mkdir -p "${dirs[@]}" || die |
256 |
mkdir -p "${dirs[@]}" || die |
250 |
emake "${targets[@]}" |
257 |
autotools-multilib_src_compile "${targets[@]}" |
251 |
fi |
258 |
fi |
|
|
259 |
popd > /dev/null || die |
252 |
} |
260 |
} |
253 |
|
|
|
254 |
src_install () { |
261 |
src_install () { |
255 |
emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
262 |
autotools-multilib_src_install INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
256 |
docdir="${EPREFIX}"/usr/share/doc/${PF} |
263 |
docdir="${EPREFIX}"/usr/share/doc/${PF} |
|
|
264 |
|
257 |
keepdir /var/lib/lock/sane |
265 |
keepdir /var/lib/lock/sane |
258 |
fowners root:scanner /var/lib/lock/sane |
266 |
fowners root:scanner /var/lib/lock/sane |
259 |
fperms g+w /var/lib/lock/sane |
267 |
fperms g+w /var/lib/lock/sane |
260 |
dodir /etc/env.d |
268 |
dodir /etc/env.d |
261 |
|
269 |
|
262 |
if use usb; then |
270 |
if use usb; then |
263 |
insinto /etc/hotplug/usb |
|
|
264 |
exeinto /etc/hotplug/usb |
271 |
exeinto /etc/hotplug/usb |
265 |
doins tools/hotplug/libsane.usermap |
|
|
266 |
doexe tools/hotplug/libusbscanner |
272 |
doexe tools/hotplug/libusbscanner |
267 |
newdoc tools/hotplug/README README.hotplug |
273 |
newdoc tools/hotplug/README README.hotplug |
268 |
fi |
274 |
fi |
269 |
udev_newrules tools/udev/libsane.rules 41-libsane.rules |
275 |
multilib_for_best_abi src_install_other_files |
270 |
insinto "/usr/share/pkgconfig" |
|
|
271 |
doins tools/sane-backends.pc |
272 |
|
273 |
dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux |
276 |
dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux |
274 |
find "${ED}" -name "*.la" | while read file; do rm "${file}"; done |
277 |
find "${ED}" -name "*.la" | while read file; do rm "${file}"; done |
275 |
if use xinetd; then |
278 |
if use xinetd; then |
Lines 281-286
Link Here
|
281 |
newconfd "${FILESDIR}"/saned.confd saned |
284 |
newconfd "${FILESDIR}"/saned.confd saned |
282 |
} |
285 |
} |
283 |
|
286 |
|
|
|
287 |
src_install_other_files() { |
288 |
pushd "${BUILD_DIR}" > /dev/null || die |
289 |
|
290 |
if use usb; then |
291 |
insinto /etc/hotplug/usb |
292 |
doins tools/hotplug/libsane.usermap |
293 |
fi |
294 |
udev_newrules tools/udev/libsane.rules 41-libsane.rules |
295 |
insinto "/usr/share/pkgconfig" |
296 |
doins tools/sane-backends.pc |
297 |
|
298 |
popd > /dev/null || die |
299 |
} |
300 |
|
284 |
pkg_postinst() { |
301 |
pkg_postinst() { |
285 |
if use xinetd; then |
302 |
if use xinetd; then |
286 |
elog "If you want remote clients to connect, edit" |
303 |
elog "If you want remote clients to connect, edit" |