aboutsummaryrefslogtreecommitdiff
path: root/osx.patch
blob: 7ad3f847a58a9cb0e1c9d13bcc3c422a8670f92d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
diff --git a/install b/install
index c175004..fab7ecb 100755
--- a/install
+++ b/install
@@ -17,6 +17,7 @@
 #     -v, --verbose               # verbose output
 #     -s, --system                # do a system install (needs root)
 #     -C, --csh              	  # install C-shell scripts
+#     -D, --accept-defaults       # accept all defaults
 # 
 #     -t, --term <term>           # set default terminal type
 #     -b, --bindir <dir>          # set local bin directory
@@ -24,6 +25,7 @@
 #     -i, --imdir <dir>           # set image directory
 #     -m, --mach <arch>           # set architecture
 #     -r, --root <dir>            # set iraf root directory
+#     -f, --fakehome <dir>        # set the non-home directory (think /home/user/.iraf)
 # 
 #     -C, --oldcache <dir>        # set old cache directory
 #     -I, --oldimdir <dir>        # set old image directory
@@ -79,6 +81,7 @@ err_count=0				# error count
 exec="yes"				# take action?
 old_links=0				# use old link method?
 extn="sh"				# shell script extension
+accept_defaults=0
 
 LS="/bin/ls"				# directory listing command
 W='\([ 	"]\)'                   	# match a blank, tab, or quote
@@ -95,6 +98,7 @@ p_cache=""				# <param> cache directory
 o_iraf=""				# old iraf root directory
 o_imdir=""				# old image directory
 o_cache=""				# old cache directory
+o_fakehome=""           # old fakehome directory?
 
 
 
@@ -115,6 +119,7 @@ install_help() {
     ECHO "    -v, --verbose             # verbose output"
     ECHO "    -s, --system              # do a system install (needs root)"
     ECHO "    -C, --csh              	# install C-shell scripts"
+    ECHO "    -d, --accept-defaults     # accept all defaults"
     ECHO ""
     ECHO "    -t, --term <term>         # set default terminal type"
     ECHO "    -b, --bindir <dir>        # set local bin directory"
@@ -122,6 +127,7 @@ install_help() {
     ECHO "    -i, --imdir <dir>         # set image directory"
     ECHO "    -m, --mach <arch>         # set architecture"
     ECHO "    -r, --root <dir>          # set iraf root directory"
+    ECHO "    -f, --fakehome <dir>      # set the non-home directory (think /home/user/.iraf)"
     ECHO ""
     ECHO "    -C, --oldcache <dir>      # set old cache directory"
     ECHO "    -I, --oldimdir <dir>      # set old image directory"
@@ -165,7 +171,9 @@ while [ -n "$1" ] ; do
     "-C"|"-csh"|"--csh")                   	# install C-shell scripts
         extn="csh"
         ;;
-
+    "-D"|"-accept-defaults"|"--accept-defaults")    # accept all defaults
+        accept_defaults=1 
+        ;;
     "-t"|"-term"|"--term")                 	# set default terminal type.
 	defterm=$2 ; 	shift
         ;;
@@ -194,6 +202,10 @@ while [ -n "$1" ] ; do
 	fi
         ;;
 
+    "-f"|"-fakehome"|"--fakehome")              # set the non-home directory
+    o_fakehome=$2; shift
+    export FAKEHOME=$o_fakehome
+        ;;
     "-C"|"-oldcache"|"--oldcache")              # set old cache directory
 	o_cache=$2 ; shift
         ;;
@@ -244,12 +256,15 @@ if [ "$o_cache" == "" ]; then
 fi
 o_cache=`echo $o_cache | sed -e 's+/\(["]*\)$+\1+'`
 
-
+#if [ "$o_fakehome" == "" ]; then
+#   o_fakehome=`grep "^fakehome=" $mkiraf | sed -e "s+fakehome=++" -e 's+"++g'`
+#fi
+#o_fakehome=`echo $o_fakehome| sed -e 's+/\(["]*\)$+\1+'`
 
 #=============================================================================
 #  User Check
 #
-#  If we're doing a private install, initialize the $HOME/.iraf directory.
+#  If we're doing a private install, initialize the ${FAKEHOME} directory.
 #=============================================================================
 
 # Get the current user name.
@@ -268,7 +283,10 @@ if [ "$WHOAMI" == "root" ]; then
 	BOLD_ON
 	ECHO "You are running as the root user: "
 	PROMPT "Install IRAF for all users on this machine?"
-	read ans
+
+    if (( $accept_defaults==0 )); then
+	    read ans
+    fi
 
 	do_proceed="no"
 	if [ -n $ans ]; then
@@ -307,15 +325,15 @@ if [ "$WHOAMI" == "root" ]; then
 fi
 
 if (( $do_system==0 )); then
-    if [ ! -e "$HOME/.iraf" ]; then
+    if [ ! -e "${FAKEHOME}" ]; then
         NEWLINE
-        ECHO "Initializing $HOME/.iraf directory ....."
+        ECHO "Initializing ${FAKEHOME} directory ....."
         NEWLINE
 
-        mkdir $HOME/.iraf
-        (cd $HOME/.iraf ; mkdir imdir cache bin)
+        mkdir ${FAKEHOME}
+        (cd ${FAKEHOME} ; mkdir imdir cache bin)
     fi
-    bindir="$HOME/.iraf/bin"
+    bindir="${FAKEHOME}/bin"
 fi
 
 
@@ -421,7 +439,10 @@ while [ $iraf_prompt == "yes" ]; do
     NEWLINE
     BOLD_ON ; ECHO -n "New iraf root directory " ; BOLD_OFF
     ECHO -n "($d_iraf): "
-    read iraf
+    
+    if (( $accept_defaults==0 )); then
+        read iraf
+    fi
 
     if [ "$iraf" == "" ]; then
         export iraf="$d_iraf"
@@ -462,7 +483,7 @@ done
 if [ "$imdir" == "" ]; then
 
   if (( $do_system==0 )); then
-      d_imdir="$HOME/.iraf/imdir/"
+      d_imdir="${FAKEHOME}/imdir/"
   elif [ -d "$o_imdir" ]; then
       d_imdir=$o_imdir
   elif [ -d "/iraf" ]; then
@@ -483,8 +504,10 @@ if [ "$imdir" == "" ]; then
     imdir_prompt="no"
     BOLD_ON ; ECHO -n "Default root image storage directory " ; BOLD_OFF
     ECHO -n "($d_imdir): "
-    read imdir
 
+    if (( $accept_defaults==0 )); then
+        read imdir
+    fi
     if [ "$imdir" == "" ]; then
         imdir="$d_imdir"
         imdir_prompt="no"
@@ -528,7 +551,7 @@ fi
 if [ "$cache" == "" ]; then
 
   if (( $do_system==0 )); then
-      d_cache="$HOME/.iraf/cache/"
+      d_cache="${FAKEHOME}/cache/"
   elif [ -d "/iraf" ]; then
       d_cache="/iraf/cache"
   elif [ -d "/home/iraf" ]; then
@@ -547,7 +570,9 @@ if [ "$cache" == "" ]; then
     cache_prompt="no"
     BOLD_ON ; ECHO -n "Default root cache directory " ; BOLD_OFF
     ECHO -n "($d_cache): "
-    read cache
+    if (( $accept_defaults==0 )); then
+        read cache
+    fi
     if [ "$cache" == "" ]; then
         cache="$d_cache"
         cache_prompt="no"
@@ -592,7 +617,7 @@ fi
 if [ "$lbin" == "" ]; then
   # Look around and come up with a likely candidate directory.
   if (( $do_system==0 )); then
-      d_lbin="$HOME/.iraf/bin/"
+      d_lbin="${FAKEHOME}/bin/"
   elif [ -d "/usr/local/bin" ]; then
       d_lbin="/usr/local/bin"
   elif [ -d "/opt/local/bin" ]; then
@@ -609,7 +634,10 @@ if [ "$lbin" == "" ]; then
     lbin_prompt="no"
     BOLD_ON ; ECHO -n "Local unix commands directory " ; BOLD_OFF
     ECHO -n "($d_lbin): "
-    read lbin
+
+    if (( $accept_defaults==0 )); then
+        read lbin
+    fi
     if [ "$lbin" == "" ]; then
         lbin="$d_lbin"
         lbin_prompt="no"
@@ -635,7 +663,9 @@ if [ "$lbin" == "" ]; then
             BOLD_ON ; 
 	    ECHO -n "    Sorry, but $lbin does not exist, create it? "
 	    BOLD_OFF
-            read ans
+            if (( $accept_defaults==0 )); then
+                read ans
+            fi
         fi
         if [ "$ans" == "" -o "$ans" == "y" -o "$ans" == "yes" ]; then
             ECHO "  Creating directory $lbin..."
@@ -670,7 +700,9 @@ if (( $do_system==0 )); then
     ECHO -n '): '
     BOLD_OFF
 
-    read myterm
+    if (( $accept_defaults==0 )); then
+        read myterm
+    fi
     if [ -z "$myterm" ]; then
         myterm=$defterm
     fi
@@ -803,7 +835,9 @@ NEWLINE ; NEWLINE
 do_proceed="yes"
 while [ "$do_proceed" == "yes" ]; do
   PROMPT "Proceed with installation? "
-  read ans
+  if (( $accept_defaults==0 )); then
+    read ans
+  fi
 
   do_proceed="no"
   if [ "$ans" == "" -o "$ans" == "y" -o "$ans" == "yes" ]; then
@@ -903,7 +937,9 @@ if (( $cl_found==1 )); then
       del_cmd_="yes"
       while [ "$del_cmd_" == "yes" ]; do
         PROMPT "Do you want to delete commands in the old directory? "
-        read ans
+        if (( $accept_defaults==0 )); then
+            read ans
+        fi
 
 	del_cmd_="no"
         if [ -n $ans ]; then
@@ -979,43 +1015,48 @@ ECHO "                             Editing Paths"
 ECHO "                             -------------"
 BOLD_OFF
 
-# Edit the $iraf pathname in the .login file for user 'iraf'.
-if (( $do_system==0 )); then
-  ECHO -n "Editing the iraf user .login/.cshrc paths ...                  "
-  pfiles=("$iraf/local/.cshrc $iraf/local/.login")
-else
-  ECHO -n "Editing the user .login/.cshrc paths ...                       "
-  if [ "$SHELL" == "/bin/sh" ]; then
-   pfiles=("$HOME/.bashrc $HOME/.profile $HOME/.bash_profile $HOME/.bash_login")
-  else
-   pfiles=("$HOME/.cshrc $HOME/.login")
-  fi
-fi
-for file in ${pfiles[@]}; do
-    if [ -e "$file" ]; then
-	if [ "$exec" == "yes" ]; then
-            RM $TEMP >& /dev/null
-            sed -e "s+$o_iraf+$iraf+" $file > $TEMP
-            cmp -s $file $TEMP
-            if (( $?==1 )); then
-                PUT $TEMP $file
-            fi
-            RM $TEMP >& /dev/null
-	fi
-    else
-        if (( "$err_seen"=0 )); then
-            DO_FAIL
-            err_seen=1
-            err_count=$(( err_count+1 ))
-        fi
-        MSG  "Cannot find the iraf $file file"
-        RM $TEMP >& /dev/null
-    fi
-done
+echo "Editing the user login paths... WILL NOT COMPLY..."
 if (( "$err_seen"==0 )); then
     DO_OK
 fi
 
+# Edit the $iraf pathname in the .login file for user 'iraf'.
+#if (( $do_system==0 )); then
+#  ECHO -n "Editing the iraf user .login/.cshrc paths ...                  "
+#  pfiles=("$iraf/local/.cshrc $iraf/local/.login")
+#else
+#  ECHO -n "Editing the user .login/.cshrc paths ...                       "
+#  if [ "$SHELL" == "/bin/sh" ]; then
+#   pfiles=("$FAKEHOME/.bashrc $FAKEHOME/.profile $FAKEHOME/.bash_profile $FAKEHOME/.bash_login")
+#  else
+#   pfiles=("$FAKEHOME/.cshrc $FAKEHOME/.login")
+#  fi
+#fi
+#for file in ${pfiles[@]}; do
+#    if [ -e "$file" ]; then
+#	if [ "$exec" == "yes" ]; then
+#            RM $TEMP >& /dev/null
+#            sed -e "s+$o_iraf+$iraf+" $file > $TEMP
+#            cmp -s $file $TEMP
+#            if (( $?==1 )); then
+#                PUT $TEMP $file
+#            fi
+#            RM $TEMP >& /dev/null
+#	fi
+#    else
+#        if (( "$err_seen"=0 )); then
+#            DO_FAIL
+#            err_seen=1
+#            err_count=$(( err_count+1 ))
+#        fi
+#        MSG  "Cannot find the iraf $file file"
+#        RM $TEMP >& /dev/null
+#    fi
+#done
+#if (( "$err_seen"==0 )); then
+#    DO_OK
+#fi
+
 # Edit the $iraf and $imdir paths in mkiraf.*sh, *cl.*sh, and libc/iraf.h
 # files.
 
@@ -1121,7 +1162,7 @@ fi
 	if (( "do_system"==1 )); then
           ECHO -n "Creating root imdir at $imdir ...                    "
 	else
-          ECHO -n 'Creating root imdir at $HOME/.iraf/imdir ...		'
+          ECHO -n 'Creating root imdir at ${FAKEHOME}/imdir ...		'
           ECHO -n '       '
 	fi
         if [ "$exec" == "yes" ]; then
@@ -1150,7 +1191,7 @@ fi
 	if (( "do_system"==1 )); then
           ECHO -n "Creating root cache at $cache ...                    "
 	else
-          ECHO -n 'Creating root cache at $HOME/.iraf/cach  ...		'
+          ECHO -n 'Creating root cache at ${FAKEHOME}/cach  ...		'
           ECHO -n '       '
 	fi
         if [ "$exec" == "yes" ]; then
@@ -1252,7 +1293,7 @@ if (( "$do_system"==1 )); then
 else			# else of 'do_system'
 
     ECHO -n "Creating <iraf.h> symlink ...                                  "
-    file1="$HOME/.iraf/iraf.h"
+    file1="${FAKEHOME}/iraf.h"
     file2="$iraf/unix/hlib/libc/iraf.h"
 
     err_seen=0
@@ -1280,10 +1321,10 @@ else			# else of 'do_system'
 
     ECHO -n 'Marking system architecture ...                                '
     if [ "$exec" == "yes" ]; then
-	if [ -e "$HOME/.iraf/arch" ]; then
-            RM $HOME/.iraf/arch
+	if [ -e "${FAKEHOME}/arch" ]; then
+            RM ${FAKEHOME}/arch
 	fi
-        echo $IRAFARCH >  $HOME/.iraf/arch
+        echo $IRAFARCH >  ${FAKEHOME}/arch
     fi
     DO_OK
 
@@ -1491,8 +1532,8 @@ if (( "$do_system"==1 )); then
     file1=/usr/local/lib/imtoolrc
     ECHO -n "Creating /usr/local/lib/imtoolrc link ...                      "
 else
-    file1=$HOME/.imtoolrc
-    ECHO -n 'Creating $HOME/.imtoolrc link ...                              '
+    file1=$FAKEHOME/.imtoolrc
+    ECHO -n 'Creating $FAKEHOME/.imtoolrc link ...                              '
 fi
 RM -f $file1
 file2=$iraf/dev/imtoolrc
@@ -1534,10 +1575,10 @@ if (( "$do_system"==0 )); then
     for f in ${xfiles[@]}; do
         if [ -e "$iraf/vendor/x11iraf/bin.$IRAFARCH/$f" ]; then
             if [ "$exec" == "yes" ]; then
-        	if [ -e "$HOME/.iraf/bin/$f" ]; then
-		    RM $HOME/.iraf/bin/$f
+        	if [ -e "${FAKEHOME}/bin/$f" ]; then
+		    RM ${FAKEHOME}/bin/$f
         	fi
-                ln -s $iraf/vendor/x11iraf/bin.$IRAFARCH/$f $HOME/.iraf/bin/$f
+                ln -s $iraf/vendor/x11iraf/bin.$IRAFARCH/$f ${FAKEHOME}/bin/$f
             fi
         fi
     done
@@ -1557,13 +1598,13 @@ if [ "$do_system" == 0 ]; then
   BOLD_OFF
 
   cur=$PWD
-  if [ ! -e $HOME/.iraf ]; then
-      mkdir $HOME/.iraf
+  if [ ! -e ${FAKEHOME} ]; then
+      mkdir ${FAKEHOME}
   fi
-  cd $HOME/.iraf
+  cd ${FAKEHOME}
   ECHO -n "Creating global login.cl and uparm directory ....              "
   $iraf/unix/hlib/mkiraf.sh --default --init --term=$myterm  >& /dev/null
-  if [ -e "$HOME/.iraf/login.cl" ]; then
+  if [ -e "${FAKEHOME}/login.cl" ]; then
       DO_OK
   else
       DO_FAIL
@@ -1572,8 +1613,8 @@ if [ "$do_system" == 0 ]; then
   cd $cur
 
   # Add the setup to the user's login files.
-  cfiles=("$HOME/.cshrc $HOME/.tcshrc $HOME/.login")
-  bfiles=("$HOME/.bashrc $HOME/.profile $HOME/.bash_profile $HOME/.bash_login")
+  cfiles=("$FAKEHOME/.cshrc $FAKEHOME/.tcshrc $FAKEHOME/.login")
+  bfiles=("$FAKEHOME/.bashrc $FAKEHOME/.profile $FAKEHOME/.bash_profile $FAKEHOME/.bash_login")
 
   for file in ${cfiles[@]}; do
     if [ -e "$file" ]; then
@@ -1585,8 +1626,8 @@ if [ "$do_system" == 0 ]; then
             if (( $?==1 )); then
 	        echo ""						>> $TEMP
 	        echo "# Add iraf setup commands"		>> $TEMP
- 	        echo "if ( -e $HOME/.iraf/setup.csh ) then"	>> $TEMP
- 	        echo "    source $HOME/.iraf/setup.csh"		>> $TEMP
+ 	        echo "if ( -e ${FAKEHOME}/setup.csh ) then"	>> $TEMP
+ 	        echo "    source ${FAKEHOME}/setup.csh"		>> $TEMP
  	        echo "endif"					>> $TEMP
 		cp $file ${file}.bak
                 PUT $TEMP $file
@@ -1597,8 +1638,8 @@ if [ "$do_system" == 0 ]; then
         RM -f $TEMP >& /dev/null
 	echo ""							 > $file
 	echo "# Add iraf setup commands"			>> $file
- 	echo "if ( -e $HOME/.iraf/setup.csh ) then"		>> $file
- 	echo "    source $HOME/.iraf/setup.csh"			>> $file
+ 	echo "if ( -e ${FAKEHOME}/setup.csh ) then"		>> $file
+ 	echo "    source ${FAKEHOME}/setup.csh"			>> $file
  	echo "endif"						>> $file
     fi
   done
@@ -1613,8 +1654,8 @@ if [ "$do_system" == 0 ]; then
             if (( $?==1 )); then
 	        echo ""						>> $TEMP
 	        echo "# Add iraf setup commands"		>> $TEMP
- 	        echo "if [ -e $HOME/.iraf/setup.sh ]; then"	>> $TEMP
- 	        echo "    source $HOME/.iraf/setup.sh"		>> $TEMP
+ 	        echo "if [ -e ${FAKEHOME}/setup.sh ]; then"	>> $TEMP
+ 	        echo "    source ${FAKEHOME}/setup.sh"		>> $TEMP
  	        echo "fi"					>> $TEMP
 		cp $file ${file}.bak
                 PUT $TEMP $file
@@ -1625,8 +1666,8 @@ if [ "$do_system" == 0 ]; then
         RM -f $TEMP >& /dev/null
 	echo ""							 > $file
 	echo "# Add iraf setup commands"			>> $file
- 	echo "if [ -e $HOME/.iraf/setup.sh ]; then"		>> $file
- 	echo "    source $HOME/.iraf/setup.sh"			>> $file
+ 	echo "if [ -e ${FAKEHOME}/setup.sh ]; then"		>> $file
+ 	echo "    source ${FAKEHOME}/setup.sh"			>> $file
  	echo "fi"						>> $file
     fi
   done
@@ -1678,7 +1719,7 @@ if (( "$err_count"==0 )); then
    BOLD_ON; ECHO    'cl    '; BOLD_OFF
    ECHO ""
    ECHO "From any directory to use the global login files created in the"
-   BOLD_ON ; ECHO -n "$HOME/.iraf " ; BOLD_OFF
+   BOLD_ON ; ECHO -n "${FAKEHOME} " ; BOLD_OFF
    ECHO "directory.   If you wish to have a login.cl/uparm that"
    ECHO "is specific to a particular directory, you will need to type"
    ECHO ""
diff --git a/unix/hlib/irafuser.csh b/unix/hlib/irafuser.csh
index 4ae5bb9..b150100 100755
--- a/unix/hlib/irafuser.csh
+++ b/unix/hlib/irafuser.csh
@@ -62,7 +62,6 @@ else		# old_method
 endif		# old_method
 
 
-
 setenv	hostid	unix
 setenv	host	${iraf}unix/
 setenv	hlib	${iraf}unix/hlib/
@@ -181,11 +180,13 @@ endsw
 # Prepend a user <iraf.h> file to the compile flags in case we don't
 # install as root.
 #
-setenv HSI_CF  	  "-I${HOME}/.iraf/ $HSI_CF"
-setenv HSI_FF  	  "-I${HOME}/.iraf/ $HSI_FF"
-setenv HSI_LF  	  "-I${HOME}/.iraf/ $HSI_LF"
-setenv HSI_XF  	  "-I${HOME}/.iraf/ $HSI_XF"
-setenv XC_CFLAGS  "-I${HOME}/.iraf/"
+set FAKEHOME="$iraf/fakehome"
+setenv HSI_CF  	  "-I${FAKEHOME}/.iraf/ $HSI_CF"
+setenv HSI_FF  	  "-I${FAKEHOME}/.iraf/ $HSI_FF"
+setenv HSI_LF  	  "-I${FAKEHOME}/.iraf/ $HSI_LF"
+setenv HSI_XF  	  "-I${FAKEHOME}/.iraf/ $HSI_XF"
+setenv XC_CFLAGS  "-I${FAKEHOME}/.iraf/"
+unset FAKEHOME
 
 
 # The following determines whether or not the VOS is used for filename mapping.
diff --git a/unix/hlib/irafuser.sh b/unix/hlib/irafuser.sh
index d71828d..a4d036c 100755
--- a/unix/hlib/irafuser.sh
+++ b/unix/hlib/irafuser.sh
@@ -126,11 +126,12 @@ esac
 # Prepend a user <iraf.h> file to the compile flags in case we don't
 # install as root.
 #
-export HSI_CF="-I${HOME}/.iraf/ $HSI_CF"
-export HSI_FF="-I${HOME}/.iraf/ $HSI_FF"
-export HSI_LF="-I${HOME}/.iraf/ $HSI_LF"
-export HSI_XF="-I${HOME}/.iraf/ $HSI_XF"
-
+FAKEHOME=$iraf/fakehome
+export HSI_CF="-I${FAKEHOME}/.iraf/ $HSI_CF"
+export HSI_FF="-I${FAKEHOME}/.iraf/ $HSI_FF"
+export HSI_LF="-I${FAKEHOME}/.iraf/ $HSI_LF"
+export HSI_XF="-I${FAKEHOME}/.iraf/ $HSI_XF"
+unset FAKEHOME 
 
 # The following determines whether or not the VOS is used for filename mapping.
 if [ -f ${iraf}lib/libsys.a ]; then
@@ -142,8 +143,8 @@ fi
 
 export HSI_LIBS="$HSI_LIBS $HSI_OSLIBS"
 
-alias	mkiraf=${hlib}mkiraf.csh
-alias	mkmlist=${hlib}mkmlist.csh
+alias	mkiraf=${hlib}mkiraf.sh
+alias	mkmlist=${hlib}mkmlist.sh
 #alias	mkz=${hbin}mkpkg.e "$mkzflags"
 
 alias	edsym=${hbin}edsym.e
diff --git a/unix/hlib/mkiraf.sh b/unix/hlib/mkiraf.sh
index e62072c..ff2a163 100755
--- a/unix/hlib/mkiraf.sh
+++ b/unix/hlib/mkiraf.sh
@@ -22,13 +22,15 @@ myterm="none"
 uparm_init=-1
 quiet=0
 def=0
+force=0
 defterm="xgterm"
 
 				# Paths edited by the install script.
-iraf="/iraf/iraf/" 		
-imdir="/iraf/imdir/"
-cachedir="/iraf/cache/"
-
+iraf="/srv/conda/sources/iraf/" 		
+imdir="/srv/conda/sources/iraf/fakehome/imdir//"
+cachedir="/srv/conda/sources/iraf/fakehome/cache//"
+# Bad hack - jhunk
+FAKEHOME=$(dirname $imdir)
 
 # ------------- (end of site dependent definitions) ------------------------
 
@@ -59,6 +61,9 @@ do
     -q|--quiet)				# Suppress output
         quiet=1
     	;;
+    -f|--force)             # Install in $iraf regardless
+        force=1
+        ;;
     *)
         /bin/echo "Error: unknown option '$i'"
 	exit 1
@@ -70,22 +75,22 @@ done
 
 # Protect against running mkiraf in an iraf system directory.
 irafdir=`cd $iraf ; pwd`
-if [ ! "`pwd | grep $irafdir`" = "" ]; then
-    if [ "`pwd | grep iraf/local`" = "" ]; then
-	/bin/echo "Error: current directory is not an iraf user login directory"
-	exit 1
+if (( $force==0 )); then
+    if [ ! "`pwd | grep $irafdir`" = "" ]; then
+        if [ "`pwd | grep iraf/local`" = "" ]; then
+	        /bin/echo "Error: current directory is not an iraf user login directory"
+	        exit 1
+        fi
     fi
 fi
 
 if (( $def == 1 )); then
-    imdir=`echo $HOME`"/.iraf/imdir/"
-    cachedir=`echo $HOME`"/.iraf/cache/"
     #myterm="xgterm"
-    cd $HOME
+    cd $FAKEHOME
     if [ ! -e .iraf ]; then
-	mkdir $HOME/.iraf
+	mkdir $FAKEHOME/.iraf
     fi
-    cd $HOME/.iraf
+    cd $FAKEHOME/.iraf
     if [ ! -e bin ]; then
         mkdir bin
     fi
diff --git a/unix/hlib/setup.csh b/unix/hlib/setup.csh
index b51a195..6a826c7 100755
--- a/unix/hlib/setup.csh
+++ b/unix/hlib/setup.csh
@@ -11,7 +11,7 @@ if ( ! ( $?IRAFARCH )) then
 endif
 source $iraf/unix/hlib/irafuser.csh
 
-set path = ($HOME/.iraf/bin $path)
+set path = ($FAKEHOME/bin $path)
 set cdpath  = ($iraf $iraf/pkg $iraf/noao $iraf/sys $iraf/unix $iraf/unix/boot)
 
 # The world'd most obvious alias ....
diff --git a/unix/hlib/setup.sh b/unix/hlib/setup.sh
index fc96eeb..882bf82 100755
--- a/unix/hlib/setup.sh
+++ b/unix/hlib/setup.sh
@@ -1,17 +1,17 @@
 #!/bin/bash
 
 # Allow a previously defined $iraf to be used.
-if [ -n $iraf ]; then
+if [ -z "$iraf" ]; then
     export iraf=/iraf/iraf/
 fi
 
 # Allow a previously defined $IRAFARCH to be used.
-if [ -n $IRAFARCH ]; then
+if [ -z "$IRAFARCH" ]; then
     export IRAFARCH=`$iraf/unix/hlib/irafarch.sh -actual`
 fi
 source $iraf/unix/hlib/irafuser.sh
 
-export PATH=$HOME/.iraf/bin:${PATH}
+export PATH=$iraf/fakehome/bin:$iraf/bin:${PATH}
 
 # The world'd most obvious alias ....
 alias iraf="xgterm -e cl &"
diff --git a/util/check_update b/util/check_update
index b1973b8..e42941a 100755
--- a/util/check_update
+++ b/util/check_update
@@ -6,8 +6,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/fget b/util/fget
index 828f246..95f51d1 100755
--- a/util/fget
+++ b/util/fget
@@ -42,8 +42,8 @@ if [ -n "$iraf" ]; then
 fi
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/iraf_latest b/util/iraf_latest
index 3246211..dde0e07 100755
--- a/util/iraf_latest
+++ b/util/iraf_latest
@@ -15,8 +15,8 @@ fi
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/iraf_update b/util/iraf_update
index fb0f1a3..81cde51 100755
--- a/util/iraf_update
+++ b/util/iraf_update
@@ -65,8 +65,8 @@ fi
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mkarch b/util/mkarch
index 733dc04..22d6589 100755
--- a/util/mkarch
+++ b/util/mkarch
@@ -6,8 +6,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
@@ -73,6 +73,6 @@ while [ "$loop_" == "yes" ]; do
   fi
 done
 
-if [ -e "$HOME/.iraf/arch" ]; then
-    echo $arch > $HOME/.iraf/arch
+if [ -e "$FAKEHOME/arch" ]; then
+    echo $arch > $FAKEHOME/arch
 fi
diff --git a/util/mkbindist b/util/mkbindist
index 0e1b978..abdf6b0 100755
--- a/util/mkbindist
+++ b/util/mkbindist
@@ -5,8 +5,8 @@ export 	PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/5bin:/usr/ucb:/etc:/usr/etc:$PAT
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mkclean b/util/mkclean
index 57aab39..fdb42f8 100755
--- a/util/mkclean
+++ b/util/mkclean
@@ -8,8 +8,8 @@ export 	PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/5bin:/usr/ucb:/etc:/usr/etc:$PAT
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mkproto b/util/mkproto
index 195bbba..71493df 100755
--- a/util/mkproto
+++ b/util/mkproto
@@ -16,8 +16,8 @@ tproto=/tmp/_vosproto.$$
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mksrc b/util/mksrc
index ba22dca..a57693e 100755
--- a/util/mksrc
+++ b/util/mksrc
@@ -6,8 +6,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mksysgen b/util/mksysgen
index 48c4b33..7e3679b 100755
--- a/util/mksysgen
+++ b/util/mksysgen
@@ -3,8 +3,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
@@ -22,12 +22,12 @@ if [ -z "$iraf" ]; then
     iraf=`pwd`/
 fi
 
-if [ -e "$HOME/.iraf/arch" ]; then
+if [ -e "$FAKEHOME/arch" ]; then
   if [ -n "$IRAFARCH" ]; then
-    iarch=`cat $HOME/.iraf/arch`
+    iarch=`cat $FAKEHOME/arch`
     if [ "$iarch" != "$IRAFARCH" ]; then
       /bin/echo ""
-      /bin/echo 'Error:  Your $IRAFARCH does not match $HOME/.iraf/arch,'
+      /bin/echo 'Error:  Your $IRAFARCH does not match $FAKEHOME/arch,'
       /bin/echo '        Please change $IRAFARCH or rerun install script.'
       /bin/echo ""
       exit 1
diff --git a/util/mkup b/util/mkup
index ed4499f..9867caa 100755
--- a/util/mkup
+++ b/util/mkup
@@ -3,8 +3,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/mkupx b/util/mkupx
index 126c3e8..71cace7 100755
--- a/util/mkupx
+++ b/util/mkupx
@@ -3,8 +3,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/pkgconfig b/util/pkgconfig
index e5e6c51..14b22b3 100755
--- a/util/pkgconfig
+++ b/util/pkgconfig
@@ -6,8 +6,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi
diff --git a/util/pkgdel b/util/pkgdel
index f7d5256..a2f47bc 100755
--- a/util/pkgdel
+++ b/util/pkgdel
@@ -8,8 +8,8 @@ irafdir=${bindir%/*}
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/pkgget b/util/pkgget
index fba02c0..ef3acc4 100755
--- a/util/pkgget
+++ b/util/pkgget
@@ -20,8 +20,8 @@ export 	PATH=../util:$PATH
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/pkginit b/util/pkginit
index a484d52..7259be7 100755
--- a/util/pkginit
+++ b/util/pkginit
@@ -8,8 +8,8 @@ irafdir=${bindir%/*}
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/pkginst b/util/pkginst
index d4a83a2..22672f1 100755
--- a/util/pkginst
+++ b/util/pkginst
@@ -13,8 +13,8 @@ irafdir=${bindir%/*}
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/pkgupdate b/util/pkgupdate
index ea73ec1..abf079d 100755
--- a/util/pkgupdate
+++ b/util/pkgupdate
@@ -35,8 +35,8 @@ irafdir=${bindir%/*}
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source ../unix/hlib/setup.sh
   fi
diff --git a/util/self_update b/util/self_update
index f5896d4..8e43890 100755
--- a/util/self_update
+++ b/util/self_update
@@ -5,8 +5,8 @@
 
 # Initialize the $iraf and environment.
 if [ -z "$iraf" ]; then
-  if [ -e "$HOME/.iraf/setup.sh" ]; then
-    source $HOME/.iraf/setup.sh
+  if [ -e "$FAKEHOME/setup.sh" ]; then
+    source $FAKEHOME/setup.sh
   else
     source unix/hlib/setup.sh
   fi