X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage5%2Fpkg%2Fsane-backends;h=695a11d77cc7e06b60bddd6c53e7ea492866a29c;hb=d0e5edd198015a62b0e89c7bfe2a4c60f68db44c;hp=09bc97cdc4bb539e81d4c43392f8d394fd9d7824;hpb=3dae4c554ec18f465eb6ee5e6efdbdbe8557e13c;p=hvlinux.git diff --git a/stage5/pkg/sane-backends b/stage5/pkg/sane-backends index 09bc97c..695a11d 100644 --- a/stage5/pkg/sane-backends +++ b/stage5/pkg/sane-backends @@ -1,63 +1,64 @@ -#!/bin/sh -set -o errexit +#!/bin/bash -# First argument of this script is the package name +hvconfig_pre() +{ + local USE_X_OPTION -# Reading system configuration informations, functions and package versions. -source ../sysinfos -source ../functions -source ../packages-list + if [ x${INST_TYPE} = "xworkstation" ]; then + USE_X_OPTION="yes" + else + USE_X_OPTION="no" + fi -# Applying patches (if any) -apply_patches ${1} + hv_groupadd saned + hv_useradd -c saned -d /dev/null -g saned -s /bin/false saned -if [ x${INST_TYPE} = "xworkstation" ]; then - USE_X_OPTION="yes" -else - USE_X_OPTION="no" -fi + # Fixes an obsolete udev parameter: + sed -i 's/SYSFS/ATTRS/g' ${LFS_TMP}/${PACKAGE}/tools/sane-desc.c -hv_groupadd saned -hv_useradd -c saned -d /dev/null -g saned -s /bin/false saned + CONFIGURE_OPTS=" \ + ${CONFIGURE_OPTS} \ + --with-x=${USE_X_OPTION}" +} -# Problem with build directory -cd ${LFS_TMP}/${1} +hvbuild_post() +{ + install -m 644 -v tools/udev/libsane.rules \ + /etc/udev/rules.d/65-scanner.rules -# Fixes an obsolete udev parameter: -sed -i 's/SYSFS/ATTRS/g' tools/sane-desc.c + # Addition to /etc/services (for both the client and server) + string_add "sane 6566/tcp saned # SANE Network Scanner Daemon" \ + /etc/services -./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-x=${USE_X_OPTION} -make -make install -install -m 644 -v tools/udev/libsane.rules /etc/udev/rules.d/65-scanner.rules + # Creating '/etc/sane.d/dll.conf' and adding entry 'net' + echo "net" > /etc/sane.d/dll.conf -# Addition to /etc/services (for both the client and server) -string_add "sane 6566/tcp saned # SANE Network Scanner Daemon" \ - /etc/services - -# Creating '/etc/sane.d/dll.conf' and adding entry 'net' -echo "net" > /etc/sane.d/dll.conf - -if [ -z "${SANE_SERVER}" ]; then - # If 'SANE_SERVER' is not defined, then we automatically configure for - # the SANE Network Daemon. + if [ -z "${SANE_SERVER}" ]; then + # If 'SANE_SERVER' is not defined, then we automatically configure for + # the SANE Network Daemon. - # Adding entry to '/etc/sane.d/dll.conf' - #######echo "${SANE_DRIVER}" >> /etc/sane.d/dll.conf + # Adding entry to '/etc/sane.d/dll.conf' + #######echo "${SANE_DRIVER}" >> /etc/sane.d/dll.conf - # Creating '/etc/sane.d/saned.conf' - echo "${LAN_NETWORK_MASK}" > /etc/sane.d/saned.conf + # Creating '/etc/sane.d/saned.conf' + echo "${LAN_NETWORK_MASK}" > /etc/sane.d/saned.conf - # Addition to /etc/inetd.conf - string_add "sane stream tcp nowait saned /usr/sbin/tcpd saned" \ - /etc/inetd.conf -else - # If 'SANE_SERVER' is defined, then we must specify the address of the - # remote SANE server to use. - echo "${SANE_SERVER}" > /etc/sane.d/net.conf -fi - -exit $? + # Addition to xinetd + cat > /etc/xinetd.d/saned << "EOF" +service sane +{ + disable = no + socket_type = stream + protocol = tcp + wait = no + user = saned + server = /usr/sbin/saned + log_type = SYSLOG local4 info +} +EOF + else + # If 'SANE_SERVER' is defined, then we must specify the address of the + # remote SANE server to use. + echo "${SANE_SERVER}" > /etc/sane.d/net.conf + fi +}