From: Eugeniy Meshcheryakov <eugen@debian.org>
Subject: Look for checker files under /usr/share/spark/checker
Forwarded: not-needed
--- a/checker/sicstus.pro
+++ b/checker/sicstus.pro
@@ -183,81 +183,27 @@
 /* with POPLOG-built checkers.                                          */
 /************************************************************************/
 fetch_environment_variables :-
-        current_prolog_flag(system_type, runtime),
-        !,
-        environ('SP_APP_DIR', CHECKER_ROOT),
-        atom_codes(CHECKER_ROOT, CR),
-        (
-           environ('SPADE_CHECKER', RULES_PATH),
-           atom_codes(RULES_PATH, RULES_PATH_STR),
-           append(RULES_PATH_STR, "/", RULES_PATH_STR2),
-           assertz(spade_checker_prefix(RULES_PATH_STR2))
-        ;
-           \+ environ('SPADE_CHECKER', _Y),
-           append(CR, "/../lib/checker/rules/", RULES_PATH),
-           assertz(spade_checker_prefix(RULES_PATH))
-        ),
-        (
-           environ('SPADE_CHKHELP', HELP_PATH),
-           atom_codes(HELP_PATH, HELP_PATH_STR),
-           append(HELP_PATH_STR, "/", HELP_PATH_STR2),
-           assertz(spade_chkhelp_prefix(HELP_PATH_STR2))
-        ;
-           \+ environ('SPADE_CHKHELP', _Y),
-           append(CR, "/../lib/checker/helptext/", HELP_PATH),
-           assertz(spade_chkhelp_prefix(HELP_PATH))
-        ).
-
-
-
-/************************************************************************/
-/* For a development build of the checker, the environment variable     */
-/* SPADE_CHECKER may be used to override the default.  The default is   */
-/* $CWD/../../customer/rules/ where $CWD is the current working         */
-/* directory - the normal place for rules to be located relative to the */
-/* checker source code.                                                 */
-/*                                                                      */
-/* Help files are similarly located in $CWD/../../customer/helptext/    */
-/* by default but this may also be overridden by setting SPADE_CHKHELP  */
-/*                                                                      */
-/* This version also reports its action to the standard output for      */
-/* convenicence and debugging                                           */
-/************************************************************************/
-fetch_environment_variables :-
-        current_prolog_flag(system_type, development),
-        !,
-        environ('SP_APP_DIR', CHECKER_ROOT),
-        working_directory(CWD, CWD),
-        atom_codes(CWD, CR),
-        print('!!! This is a SICSTUS Development System'), nl,
-        print('!!! SP_APP_DIR is '), print(CHECKER_ROOT), nl,
-        print('!!! CWD is '), print(CWD), nl,
-        (
-           environ('SPADE_CHECKER', RULES_PATH),
-           print('!!! Rules in '), print(RULES_PATH), nl,
-           atom_codes(RULES_PATH, RULES_PATH_STR),
-           append(RULES_PATH_STR, "/", RULES_PATH_STR2),
-           assertz(spade_checker_prefix(RULES_PATH_STR2))
-        ;
-           \+ environ('SPADE_CHECKER', _X),
-           append(CR, "/../../customer/rules/", RULES_PATH),
-           atom_codes(RP_STR, RULES_PATH),
-           print('!!! Rules in '), print(RP_STR), nl,
-           assertz(spade_checker_prefix(RULES_PATH))
-        ),
-        (
-           environ('SPADE_CHKHELP', HELP_PATH),
-           print('!!! Help  in '), print(HELP_PATH), nl,
-           atom_codes(HELP_PATH, HELP_PATH_STR),
-           append(HELP_PATH_STR, "/", HELP_PATH_STR2),
-           assertz(spade_chkhelp_prefix(HELP_PATH_STR2))
-        ;
-           \+ environ('SPADE_CHKHELP', _Y),
-           append(CR, "/../../customer/helptext/", HELP_PATH),
-           atom_codes(HP_STR, HELP_PATH),
-           print('!!! Help  in '), print(HP_STR), nl,
-           assertz(spade_chkhelp_prefix(HELP_PATH))
-        ).
+	CR = "/usr/bin",
+	(
+	   getenv('SPADE_CHECKER', RULES_PATH),
+	   atom_codes(RULES_PATH, RULES_PATH_STR),
+	   append(RULES_PATH_STR, "/", RULES_PATH_STR2),
+	   assertz(spade_checker_prefix(RULES_PATH_STR2))
+	;
+	   \+ getenv('SPADE_CHECKER', _Y),
+	   append(CR, "/../share/spark/checker/rules/", RULES_PATH),
+	   assertz(spade_checker_prefix(RULES_PATH))
+	),
+	(
+	   getenv('SPADE_CHKHELP', HELP_PATH),
+	   atom_codes(HELP_PATH, HELP_PATH_STR),
+	   append(HELP_PATH_STR, "/", HELP_PATH_STR2),
+	   assertz(spade_chkhelp_prefix(HELP_PATH_STR2))
+	;
+	   \+ getenv('SPADE_CHKHELP', _Y),
+	   append(CR, "/../share/spark/checker/helptext/", HELP_PATH),
+	   assertz(spade_chkhelp_prefix(HELP_PATH))
+	).
 
 printq(X) :-
    write_term(X, [portrayed(true), quoted(true), numbervars(true)]).
