kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'stateless-conf' into 'master'
Read configuration files from /etc and /usr See merge request sane-project/backends!859
commit
7621f5f17e
|
@ -115,15 +115,15 @@ install-becfg: becfg
|
|||
@# installed library in $(execsanelibdir) to libsane.*, which
|
||||
@# causes a conflict with the actual libsane.* in $(libdir).
|
||||
-rm -f $(DESTDIR)$(execsanelibdir)/libsane.*
|
||||
test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
|
||||
test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d"
|
||||
test -z "$(defaultconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(defaultconfigdir)"
|
||||
test -z "$(defaultconfigdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(defaultconfigdir)/dll.d"
|
||||
@list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \
|
||||
if test ! -r $${cfg}; then continue; fi; \
|
||||
if test -f $(DESTDIR)$(configdir)/$${cfg}; then \
|
||||
echo NOT overwriting $${cfg} in $(configdir)...; \
|
||||
if test -f $(DESTDIR)$(defaultconfigdir)/$${cfg}; then \
|
||||
echo NOT overwriting $${cfg} in $(defaultconfigdir)...; \
|
||||
else \
|
||||
echo installing $${cfg} in $(configdir)/$${cfg}...; \
|
||||
$(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \
|
||||
echo installing $${cfg} in $(defaultconfigdir)/$${cfg}...; \
|
||||
$(INSTALL_DATA) $${cfg} $(DESTDIR)$(defaultconfigdir)/$${cfg} \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
@ -137,7 +137,7 @@ install-lockpath:
|
|||
$(mkinstalldirs) -m 775 $(DESTDIR)$(locksanedir)
|
||||
|
||||
uninstall-hook:
|
||||
rm -rf $(DESTDIR)$(libdir)/sane $(DESTDIR)$(configdir) $(DESTDIR)$(locksanedir)
|
||||
rm -rf $(DESTDIR)$(libdir)/sane $(DESTDIR)$(defaultconfigdir) $(DESTDIR)$(locksanedir)
|
||||
rm -f $(DESTDIR)$(libdir)/libsane.*
|
||||
-for dir in $(FIRMWARE_DIRS) ; do \
|
||||
rmdir $(DESTDIR)$(datadir)/sane/$${dir} ; \
|
||||
|
|
|
@ -643,12 +643,16 @@ AC_SUBST(locksanedir)
|
|||
configdir="${sysconfdir}/sane.d"
|
||||
AC_SUBST(configdir)
|
||||
|
||||
defaultconfigdir="${prefix}/lib/sane.d"
|
||||
AC_SUBST(defaultconfigdir)
|
||||
|
||||
dnl ***********************************************************************
|
||||
dnl enable/disable backends and features based on previous tests and user's
|
||||
dnl choice
|
||||
dnl ***********************************************************************
|
||||
|
||||
AM_CPPFLAGS="${AM_CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \
|
||||
-DPATH_SANE_DEFAULT_CONFIG_DIR=\$(defaultconfigdir) \
|
||||
-DPATH_SANE_DATA_DIR=\$(datadir) \
|
||||
-DPATH_SANE_LOCK_DIR=\$(locksanedir) \
|
||||
-DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}"
|
||||
|
@ -842,7 +846,7 @@ echo AM_CXXFLAGS=\"${AM_CXXFLAGS}\"
|
|||
echo AM_LDFLAGS=\"${AM_LDFLAGS}\"
|
||||
echo LIBS=\"${LIBS}\"
|
||||
echo "-> Installation directories:"
|
||||
echo "Configuration: `eval eval echo ${sysconfdir}`"
|
||||
echo "Configuration: `eval eval echo ${defaultconfigdir}` and `eval eval echo ${configdir}`"
|
||||
echo "Libraries: `eval eval echo ${libdir}`"
|
||||
echo "Binaries: `eval eval echo ${bindir}` and `eval eval echo ${sbindir}`"
|
||||
echo "Manpages: `eval eval echo ${mandir}`"
|
||||
|
|
|
@ -99,6 +99,7 @@ MAN2HTML = nroff -c -man |\
|
|||
@if $(AM_V_P); then echo "Generating manpage $@..."; fi
|
||||
@sed -e 's|@DATADIR@|$(datadir)|g' \
|
||||
-e 's|@CONFIGDIR@|$(configdir)|g' \
|
||||
-e 's|@DEFAULTCONFIGDIR@|$(defaultconfigdir)|g' \
|
||||
-e 's|@DOCDIR@|$(docdir)|g' \
|
||||
-e 's|@LIBDIR@|$(libdir)/sane|g' \
|
||||
-e 's|@BINDIR@|$(bindir)|g' \
|
||||
|
|
|
@ -115,6 +115,9 @@ If there's no configuration file, the backend defaults to
|
|||
.I @CONFIGDIR@/u12.conf
|
||||
The backend configuration file
|
||||
.TP
|
||||
.I @DEFAULTCONFIGDIR@/u12.conf
|
||||
The backend default configuration file
|
||||
.TP
|
||||
.I @LIBDIR@/libsane\-u12.a
|
||||
The static library implementing this backend.
|
||||
.TP
|
||||
|
@ -130,8 +133,10 @@ contain the configuration file. On *NIX systems, the directories are
|
|||
separated by a colon (`:'), under OS/2, they are separated by a
|
||||
semi-colon (`;'). If this variable is not set, the configuration file
|
||||
is searched in two default directories: first, the current working
|
||||
directory (".") and then in
|
||||
.IR @CONFIGDIR@ .
|
||||
directory ("."), then in
|
||||
.IR @CONFIGDIR@
|
||||
and then in
|
||||
.IR @DEFAULTCONFIGDIR@ .
|
||||
If the value of the
|
||||
environment variable ends with the directory separator character, then
|
||||
the default directories are searched after the explicitly specified
|
||||
|
@ -140,8 +145,9 @@ directories. For example, setting
|
|||
to "/tmp/config:" would result in directories
|
||||
.IR tmp/config ,
|
||||
.IR . ,
|
||||
.IR @CONFIGDIR@ ,
|
||||
and
|
||||
.I @CONFIGDIR@
|
||||
.I @DEFAULTCONFIGDIR@
|
||||
being searched (in this order).
|
||||
.TP
|
||||
.B SANE_DEBUG_U12
|
||||
|
|
|
@ -716,7 +716,11 @@ that work is not duplicated.
|
|||
.SH "FILES"
|
||||
.TP
|
||||
.I @CONFIGDIR@/*.conf
|
||||
The backend configuration files.
|
||||
The backend configuration files (preferred to the default configuration
|
||||
files, if present).
|
||||
.TP
|
||||
.I @DEFAULTCONFIGDIR@/*.conf
|
||||
The backend default configuration files (read-only).
|
||||
.TP
|
||||
.I @LIBDIR@/libsane\-*.a
|
||||
The static libraries implementing the backends.
|
||||
|
|
|
@ -138,7 +138,8 @@ is used to include an ICC profile into a TIFF file.
|
|||
requests a (partial) list of devices that are available. The
|
||||
list may not be complete since some devices may be available, but are not
|
||||
listed in any of the configuration files (which are typically stored
|
||||
in directory
|
||||
in
|
||||
.IR @DEFAULTCONFIGDIR@ and
|
||||
.IR @CONFIGDIR@ ).
|
||||
This is particularly the case when accessing scanners through the network. If
|
||||
a device is not listed in a configuration file, the only way to access it is
|
||||
|
@ -478,8 +479,9 @@ filename
|
|||
The default device-name.
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @CONFIGDIR@
|
||||
This directory holds various configuration files. For details, please
|
||||
.IR @CONFIGDIR@ , \ \&\c
|
||||
.I @DEFAULTCONFIGDIR@
|
||||
These directories holds various configuration files. For details, please
|
||||
refer to the manual pages listed below.
|
||||
.TP
|
||||
.I ~/.sane/pass
|
||||
|
|
|
@ -59,8 +59,11 @@ extern "C" {
|
|||
*
|
||||
* The following directory list is used:
|
||||
* 1st: SANE_CONFIG_DIR environment variable.
|
||||
* 2nd: PATH_SANE_CONFIG_DIR set during configuration.
|
||||
* 3rd: Current directory.
|
||||
* 2nd: PATH_SANE_CONFIG_DIR with admin-managed files (usually
|
||||
* /etc/sane.d).
|
||||
* 3rd: PATH_SANE_DEFAULT_CONFIG_DIR with distro-managed files (usually
|
||||
* /usr/lib/sane).
|
||||
* 4th: Current directory.
|
||||
* @param name filename with extension but without path (such as "mustek.conf")
|
||||
*
|
||||
* @return file pointer, or NULL if not found
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
# define PATH_SEP '/'
|
||||
#endif
|
||||
|
||||
#define DEFAULT_DIRS "." DIR_SEP STRINGIFY(PATH_SANE_CONFIG_DIR)
|
||||
#define DEFAULT_DIRS "." DIR_SEP STRINGIFY(PATH_SANE_CONFIG_DIR) DIR_SEP STRINGIFY(PATH_SANE_DEFAULT_CONFIG_DIR)
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <FindDirectory.h>
|
||||
|
|
Ładowanie…
Reference in New Issue