use the new flexcat's source description file
[AROS.git] / tools / flexcat / dist / FlexCat / Install
blobaf370b120710b9de3721aac89b45c73e72551451
2 ; $VER: Install 1.1 (30.06.2010)
4 ; $Id: Install 228 2012-12-20 14:51:09Z damato $
6 ; History:
8 ;   1.0   29.06.2010: initial release
9 ;   1.1   30.06.2010: ask the user whether the *.sd files should be installed
10 ;   1.2   20.12.2012: added 3.x to MorphOS install decription
12 ;----------------------------------------------------------------------------
13 ; /// language bit definition, do not change these!!
14 (set #lang_english             0)
15 (set #lang_german              1)
16 (set #lang_french              2)
17 (set #lang_spanish             3)
18 (set #lang_danish              4)
19 (set #lang_italian             5)
20 (set #lang_dutch               6)
21 (set #lang_norwegian           7)
22 (set #lang_swedish             8)
23 (set #lang_polish              9)
24 (set #lang_finnish             10)
25 (set #lang_hungarian           11)
26 (set #lang_greek               12)
27 (set #lang_turkish             13)
28 (set #lang_russian             14)
29 (set #lang_czech               15)
30 (set #lang_croatian            16)
31 (set #lang_portuguese          17)
32 (set #lang_serbian             18)
33 (set #lang_slovenian           19)
34 (set #lang_english_british     20)
35 (set #lang_maximum             21)
36 ; ///
37 ;----------------------------------------------------------------------------
38 ; /// default language detection
39 (set #i 0)
40 (while (<> @language (select #i "deutsch" @language))
41     (set #i (+ #i 1))
43 (if (= #i 2) ; LANGUAGE
44     (set #language "english")
45     (set #language @language)
48 (set #i 0)
49 (set #defaultLanguages %10000000000000000000)
50 (while (<> #language (select #i "slovensko" "srpski" "português" "hrvatski" "czech" "russian" "türkçe" "greek" "magyar" "suomi" "polski" "svenska" "norsk" "nederlands" "italiano" "dansk" "español" "français" "deutsch" #language))
51     (
52         (set #i (+ #i 1))
53         (set #defaultLanguages (shiftright #defaultLanguages 1))
54     )
56 ; always add english as default language
57 (set #defaultLanguages (bitor #defaultLanguages (shiftleft 1 #lang_english)))
59 ; scan the Locale/Catalogs directory for supported languages
60 (set #supportedLanguages %00000000000000000000)
61 (foreach "Locale/Catalogs" "#?"
62     (set #i 0)
63     (while (<> @each-name (select #i "english" "german" "french" "spanish" "danish" "italian" "dutch" "norwegian" "swedish" "polish" "finnish" "hungarian" "greek" "turkish" "russian" "czech" "croatian" "portuguese" "serbian" "slovenian" @each-name))
64         (set #i (+ #i 1))
65     )
66     (if (<> #lang_maximum #i)
67         (set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #i)))
68     )
70 ; always add english as default supported language
71 (set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #lang_english)))
72 ; ///
73 ;----------------------------------------------------------------------------
74 ; /// ***** English
75 (if (= #language "english")
76     (
77         (set #acknowledgeOS (cat "Please acknowledge the automatic\n"
78                                  "detection of your operating system:"))
79         (set #FlexCat_dir  (cat "Please select a directory for FlexCat\n"
80                                 "(NO extra drawer will be created!)"))
81         (set #installSDFiles (cat "Do you want to install the #?.sd files?\n"
82                                   "\n"
83                                   "These are only required if you want to\n"
84                                   "use FlexCat to generate source code.\n"
85                                   "\n"
86                                   "Translators usually don't need these files."))
87         (set #done          (cat "\n"
88                                  @app-name " has been successfully installed."))
89     )
92 ; ///
93 ; /// ***** Deutsch
94 (if (= #language "deutsch")
95     (
96         (set #acknowledgeOS (cat "Bitte bestätigen Sie die automatische\n"
97                                  "Ermittlung Ihres Betriebssystems:"))
98         (set #FlexCat_dir  (cat "Wählen Sie ein Verzeichnis für FlexCat\n"
99                                 "(es wird KEIN eigenes Verzeichnis erstellt!)"))
100         (set #installSDFiles (cat "Wollen Sie die #?.sd Dateien installieren?\n"
101                                   "\n"
102                                   "Diese werden nur benötigt, wenn Sie FlexCat\n"
103                                   "zum Erstellen von Quellcode benutzen wollen.\n"
104                                   "\n"
105                                   "Übersetzer benötigen diese Dateien\n"
106                                   "üblicherweise nicht."))
107         (set #done          (cat "\n"
108                                  @app-name " wurde erfolgreich installiert."))
109     )
111 ; ///
112 ;----------------------------------------------------------------------------
113 ; /// Checking environment
114 (set EXEC_ver (getversion "exec.library" (resident)))
115 (set NEWLIB_ver (getversion "newlib.library" (resident)))
116 (set AROS_ver (getversion "aros.library" (resident)))
118 ; we use newlib.library to check whether we are running on AmigaOS 4.x
119 (if (>= NEWLIB_ver (* 4 65536))
120     (set #detectedSystem 1)
121     (
122         ; we are not running on AmigaOS 4.x
123         (if (>= AROS_ver (* 40 65536))
124             (set #detectedSystem 3)
125             (
126                 ; we are not running on AROS
127                 ; now check if we are running on MorphOS (exec.library V50+) or on AmigaOS 3.x
128                 (if (>= EXEC_ver (* 50 65536))
129                     (set #detectedSystem 2)
130                     (set #detectedSystem 0)
131                 )
132             )
133         )
134     )
137 (set #detectedSystem
138     (askchoice
139         (prompt #acknowledgeOS)
140         (help @askchoice-help)
141         (choices "AmigaOS 3.x"
142                  "AmigaOS 4.x"
143                  "MorphOS 1.x/2.x/3.x"
144                  "AROS i386"
145                  "AROS PPC"
146                  "AROS x86_64"
147         )
148         (default #detectedSystem)
149     )
151 ; finally convert the system number into a string for easier understanding
152 (set #detectedSystem
153     (select #detectedSystem "os3" "os4" "mos" "aros-i386" "aros-ppc" "aros-x86_64")
156 (if (= #detectedSystem "os4")
157     ; AmigaOS 4.x uses english locale names only
158     (
159         (set #cat_name_english               "english")
160         (set #cat_name_german                "german")
161         (set #cat_name_french                "french")
162         (set #cat_name_spanish               "spanish")
163         (set #cat_name_danish                "danish")
164         (set #cat_name_italian               "italian")
165         (set #cat_name_dutch                 "dutch")
166         (set #cat_name_norwegian             "norwegian")
167         (set #cat_name_swedish               "swedish")
168         (set #cat_name_polish                "polish")
169         (set #cat_name_finnish               "finnish")
170         (set #cat_name_hungarian             "hungarian")
171         (set #cat_name_greek                 "greek")
172         (set #cat_name_turkish               "turkish")
173         (set #cat_name_russian               "russian")
174         (set #cat_name_czech                 "czech")
175         (set #cat_name_croatian              "croatian")
176         (set #cat_name_portuguese            "portuguese")
177         (set #cat_name_serbian               "serbian")
178         (set #cat_name_slovenian             "slovenian")
179         (set #cat_name_english_british       "english-british")
180     )
181     ; all other systems use localized locale names
182     (
183         (set #cat_name_english               "english")
184         (set #cat_name_german                "deutsch")
185         (set #cat_name_french                "français")
186         (set #cat_name_spanish               "español")
187         (set #cat_name_danish                "dansk")
188         (set #cat_name_italian               "italiano")
189         (set #cat_name_dutch                 "nederlands")
190         (set #cat_name_norwegian             "norsk")
191         (set #cat_name_swedish               "svenska")
192         (set #cat_name_polish                "polski")
193         (set #cat_name_finnish               "suomio")
194         (set #cat_name_hungarian             "magyar")
195         (set #cat_name_greek                 "greek")
196         (set #cat_name_turkish               "türkçe")
197         (set #cat_name_russian               "russian")
198         (set #cat_name_czech                 "czech")
199         (set #cat_name_croatian              "hrvatski")
200         (set #cat_name_portuguese            "português")
201         (set #cat_name_serbian               "srpski")
202         (set #cat_name_slovenian             "slovensko")
203         (set #cat_name_english_british       "english-british")
204     )
207 ; set up the source and destination path
208 (if (= #detectedSystem "os3")
209     (set #EXE_source "AmigaOS3")
211 (if (= #detectedSystem "os4")
212     (set #EXE_source "AmigaOS4")
214 (if (= #detectedSystem "mos")
215     (set #EXE_source "MorphOS")
217 (if (= #detectedSystem "aros-i386")
218     (set #EXE_source "AROS-i386")
220 (if (= #detectedSystem "aros-ppc")
221     (set #EXE_source "AROS-ppc")
223 (if (= #detectedSystem "aros-x86_64")
224     (set #EXE_source "AROS-x86_64")
227 ; ///
228 ; /// Let's ask user for anything
229 (complete 10)
231 (set #FlexCat_dest
232     (askdir
233         (prompt  #FlexCat_dir)
234         (default "SYS:")
235         (help    @askdir-help)
236     )
239 (set #installSD
240     (askbool
241         (prompt  #installSDFiles)
242         (default 0)
243         (help    #installSDFiles)
244     )
247 (set catalog_lang
248     (askoptions
249         (prompt #lang_catalog)
250         (help @askoptions-help)
251         (choices
252             (if (in #supportedLanguages #lang_english)
253                 (cat #prop "English")
254                 ("")
255             )
256             (if (in #supportedLanguages #lang_german)
257                 (cat #prop "Deutsch")
258                 ("")
259             )
260             (if (in #supportedLanguages #lang_french)
261                 (cat #prop "Français")
262                 ("")
263             )
264             (if (in #supportedLanguages #lang_spanish)
265                 (cat #prop "Español")
266                 ("")
267             )
268             (if (in #supportedLanguages #lang_danish)
269                 (cat #prop "Dansk")
270                 ("")
271             )
272             (if (in #supportedLanguages #lang_italian)
273                 (cat #prop "Italiano")
274                 ("")
275             )
276             (if (in #supportedLanguages #lang_dutch)
277                 (cat #prop "Nederlands")
278                 ("")
279             )
280             (if (in #supportedLanguages #lang_norwegian)
281                 (cat #prop "Norsk")
282                 ("")
283             )
284             (if (in #supportedLanguages #lang_swedish)
285                 (cat #prop "Svenska")
286                 ("")
287             )
288             (if (in #supportedLanguages #lang_polish)
289                 (cat #prop "Polski")
290                 ("")
291             )
292             (if (in #supportedLanguages #lang_finnish)
293                 (cat #prop "Suomi")
294                 ("")
295             )
296             (if (in #supportedLanguages #lang_hungarian)
297                 (cat #prop "Magyar")
298                 ("")
299             )
300             (if (in #supportedLanguages #lang_greek)
301                 (cat #prop "ÅëëçíéêÜ")
302                 ("")
303             )
304             (if (in #supportedLanguages #lang_turkish)
305                 (cat #prop "Türkçe")
306                 ("")
307             )
308             (if (in #supportedLanguages #lang_russian)
309                 (cat #prop "Russian")
310                 ("")
311             )
312             (if (in #supportedLanguages #lang_czech)
313                 (cat #prop "Czech")
314                 ("")
315             )
316             (if (in #supportedLanguages #lang_croatian)
317                 (cat #prop "Hrvatski")
318                 ("")
319             )
320             (if (in #supportedLanguages #lang_portuguese)
321                 (cat #prop "Português")
322                 ("")
323             )
324             (if (in #supportedLanguages #lang_serbian)
325                 (cat #prop "Srpski")
326                 ("")
327             )
328             (if (in #supportedLanguages #lang_slovenian)
329                 (cat #prop "Slovensko")
330                 ("")
331             )
332             (if (and (in #supportedLanguages #lang_english_british) (= #detectedSystem "os4"))
333                 (cat #prop "English (british)")
334                 ("")
335             )
336         )
337         (default #defaultLanguages)
338     )
341 ; ///
342 ; /// Here we go!
343 (complete 33)
345 ; copy the executable files
346 (foreach #EXE_source "#?"
347     (copyfiles
348         (prompt @each-name)
349         (source (tackon #EXE_source @each-name))
350         (dest #FlexCat_dest)
351         (confirm)
352         (help @copyfiles-help)
353     )
356 ; copy the docs
357 (if (not (exists (tackon #FlexCat_dest "Docs")))
358     (
359         (makedir (tackon #FlexCat_dest "Docs"))
360         (copyfiles
361             (prompt "Docs.info")
362             (source "Docs.info")
363             (dest (tackon #FlexCat_dest "Docs.info"))
364             (help @copyfiles-help)
365         )
367         (foreach "Docs" "#?.guide"
368             (copyfiles
369                 (prompt @each-name)
370                 (source (tackon "Docs" @each-name))
371                 (dest (tackon #FlexCat_dest "Docs"))
372                 (help @copyfiles-help)
373             )
374         )
375     )
378 ; copy the .sd files
379 (if (<> 0 #installSD)
380     (
381         (makedir (tackon #FlexCat_dest "Lib"))
382         (foreach "Lib" "#?.sd"
383             (copyfiles
384                 (prompt @each-name)
385                 (source (tackon "Lib" @each-name))
386                 (dest (tackon #FlexCat_dest "Lib"))
387                 (help @copyfiles-help)
388             )
389         )
390     )
393 (complete 66)
395 ; check if there were any catalogs selected at all
396 (if (<> 0 catalog_lang)
397     (
398         ; copy the .cd files for people wanting to translate
399         (foreach "Locale" "#?.cd"
400             (copyfiles
401                 (source (tackon "Locale" @each-name))
402                 (dest "LOCALE:Catalogs")
403                 (help @copyfiles-help)
404             )
405         )
407         ; german catalog file
408         (if (in catalog_lang #lang_german)
409             (
410                 (makedir (tackon "LOCALE:Catalogs" #cat_name_german))
412                 (foreach "Locale/Catalogs/german" "#?.catalog"
413                     (copyfiles
414                         (source (tackon "Locale/Catalogs/german" @each-name))
415                         (dest (tackon "LOCALE:Catalogs" #cat_name_german))
416                         (help @copyfiles-help)
417                     )
418                 )
419             )
420         )
422         ; french catalog file
423         (if (in catalog_lang #lang_french)
424             (
425                 (makedir (tackon "LOCALE:Catalogs" #cat_name_french))
427                 (foreach "Locale/Catalogs/french" "#?.catalog"
428                     (copyfiles
429                         (source (tackon "Locale/Catalogs/french" @each-name))
430                         (dest (tackon "LOCALE:Catalogs" #cat_name_french))
431                         (help @copyfiles-help)
432                     )
433                 )
434             )
435         )
437         ; spanish catalog file
438         (if (in catalog_lang #lang_spanish)
439             (
440                 (makedir (tackon "LOCALE:Catalogs" #cat_name_spanish))
442                 (foreach "Locale/Catalogs/spanish" "#?.catalog"
443                     (copyfiles
444                         (source (tackon "Locale/Catalogs/spanish" @each-name))
445                         (dest (tackon "LOCALE:Catalogs" #cat_name_spanish))
446                         (help @copyfiles-help)
447                     )
448                 )
449             )
450         )
452         ; danish catalog file
453         (if (in catalog_lang #lang_danish)
454             (
455                 (makedir (tackon "LOCALE:Catalogs" #cat_name_danish))
457                 (foreach "Locale/Catalogs/danish" "#?.catalog"
458                     (copyfiles
459                         (source (tackon "Locale/Catalogs/danish" @each-name))
460                         (dest (tackon "LOCALE:Catalogs" #cat_name_danish))
461                         (help @copyfiles-help)
462                     )
463                 )
464             )
465         )
467         ; italian catalog file
468         (if (in catalog_lang #lang_italian)
469             (
470                 (makedir (tackon "LOCALE:Catalogs" #cat_name_italian))
472                 (foreach "Locale/Catalogs/italian" "#?.catalog"
473                     (copyfiles
474                         (source (tackon "Locale/Catalogs/italian" @each-name))
475                         (dest (tackon "LOCALE:Catalogs" #cat_name_italian))
476                         (help @copyfiles-help)
477                     )
478                 )
479             )
480         )
482         ; dutch catalog file
483         (if (in catalog_lang #lang_dutch)
484             (
485                 (makedir (tackon "LOCALE:Catalogs" #cat_name_dutch))
487                 (foreach "Locale/Catalogs/dutch" "#?.catalog"
488                     (copyfiles
489                         (source (tackon "Locale/Catalogs/dutch" @each-name))
490                         (dest (tackon "LOCALE:Catalogs" #cat_name_dutch))
491                         (help @copyfiles-help)
492                     )
493                 )
494             )
495         )
497         ; norwegian catalog file
498         (if (in catalog_lang #lang_norwegian)
499             (
500                 (makedir (tackon "LOCALE:Catalogs" #cat_name_norwegian))
502                 (foreach "Locale/Catalogs/norwegian" "#?.catalog"
503                     (copyfiles
504                         (source (tackon "Locale/Catalogs/norwegian" @each-name))
505                         (dest (tackon "LOCALE:Catalogs" #cat_name_norwegian))
506                         (help @copyfiles-help)
507                     )
508                 )
509             )
510         )
512         ; swedish catalog file
513         (if (in catalog_lang #lang_swedish)
514             (
515                 (makedir (tackon "LOCALE:Catalogs" #cat_name_swedish))
517                 (foreach "Locale/Catalogs/swedish" "#?.catalog"
518                     (copyfiles
519                         (source (tackon "Locale/Catalogs/swedish" @each-name))
520                         (dest (tackon "LOCALE:Catalogs" #cat_name_swedish))
521                         (help @copyfiles-help)
522                     )
523                 )
524             )
525         )
527         ; polish catalog file
528         (if (in catalog_lang #lang_polish)
529             (
530                 (makedir (tackon "LOCALE:Catalogs" #cat_name_polish))
532                 (foreach "Locale/Catalogs/polish" "#?.catalog"
533                     (copyfiles
534                         (source (tackon "Locale/Catalogs/polish" @each-name))
535                         (dest (tackon "LOCALE:Catalogs" #cat_name_polish))
536                         (help @copyfiles-help)
537                     )
538                 )
539             )
540         )
542         ; finnish catalog file
543         (if (in catalog_lang #lang_finnish)
544             (
545                 (makedir (tackon "LOCALE:Catalogs" #cat_name_finnish))
547                 (foreach "Locale/Catalogs/finnish" "#?.catalog"
548                     (copyfiles
549                         (source (tackon "Locale/Catalogs/finnish" @each-name))
550                         (dest (tackon "LOCALE:Catalogs" #cat_name_finnish))
551                         (help @copyfiles-help)
552                     )
553                 )
554             )
555         )
557         ; hungarian catalog file
558         (if (in catalog_lang #lang_hungarian)
559             (
560                 (makedir (tackon "LOCALE:Catalogs" #cat_name_hungarian))
562                 (foreach "Locale/Catalogs/hungarian" "#?.catalog"
563                     (copyfiles
564                         (source (tackon "Locale/Catalogs/hungarian" @each-name))
565                         (dest (tackon "LOCALE:Catalogs" #cat_name_hungarian))
566                         (help @copyfiles-help)
567                     )
568                 )
569             )
570         )
572         ; greek catalog file
573         (if (in catalog_lang #lang_greek)
574             (
575                 (makedir (tackon "LOCALE:Catalogs" #cat_name_greek))
577                 (foreach "Locale/Catalogs/greek" "#?.catalog"
578                     (copyfiles
579                         (source (tackon "Locale/Catalogs/greek" @each-name))
580                         (dest (tackon "LOCALE:Catalogs" #cat_name_greek))
581                         (help @copyfiles-help)
582                     )
583                 )
584             )
585         )
587         ; turkish catalog file
588         (if (in catalog_lang #lang_turkish)
589             (
590                 (makedir (tackon "LOCALE:Catalogs" #cat_name_turkish))
592                 (foreach "Locale/Catalogs/turkish" "#?.catalog"
593                     (copyfiles
594                         (source (tackon "Locale/Catalogs/turkish" @each-name))
595                         (dest (tackon "LOCALE:Catalogs" #cat_name_turkish))
596                         (help @copyfiles-help)
597                     )
598                 )
599             )
600         )
602         ; russian catalog file
603         (if (in catalog_lang #lang_russian)
604             (
605                 (makedir (tackon "LOCALE:Catalogs" #cat_name_russian))
607                 (foreach "Locale/Catalogs/russian" "#?.catalog"
608                     (copyfiles
609                         (source (tackon "Locale/Catalogs/russian" @each-name))
610                         (dest (tackon "LOCALE:Catalogs" #cat_name_russian))
611                         (help @copyfiles-help)
612                     )
613                 )
614             )
615         )
617         ; czech catalog file
618         (if (in catalog_lang #lang_czech)
619             (
620                 (makedir (tackon "LOCALE:Catalogs" #cat_name_czech))
622                 (foreach "Locale/Catalogs/czech" "#?.catalog"
623                     (copyfiles
624                         (source (tackon "Locale/Catalogs/czech" @each-name))
625                         (dest (tackon "LOCALE:Catalogs" #cat_name_czech))
626                         (help @copyfiles-help)
627                     )
628                 )
629             )
630         )
632         ; croatian catalog file
633         (if (in catalog_lang #lang_croatian)
634             (
635                 (makedir (tackon "LOCALE:Catalogs" #cat_name_croatian))
637                 (foreach "Locale/Catalogs/croatian" "#?.catalog"
638                     (copyfiles
639                         (source (tackon "Locale/Catalogs/croatian" @each-name))
640                         (dest (tackon "LOCALE:Catalogs" #cat_name_croatian))
641                         (help @copyfiles-help)
642                     )
643                 )
644             )
645         )
647         ; portuguese catalog file
648         (if (in catalog_lang #lang_portuguese)
649             (
650                 (makedir (tackon "LOCALE:Catalogs" #cat_name_portuguese))
652                 (foreach "Locale/Catalogs/portuguese" "#?.catalog"
653                     (copyfiles
654                         (source (tackon "Locale/Catalogs/portuguese" @each-name))
655                         (dest (tackon "LOCALE:Catalogs" #cat_name_portuguese))
656                         (help @copyfiles-help)
657                     )
658                 )
659             )
660         )
662         ; serbian catalog file
663         (if (in catalog_lang #lang_serbian)
664             (
665                 (makedir (tackon "LOCALE:Catalogs" #cat_name_serbian))
667                 (foreach "Locale/Catalogs/serbian" "#?.catalog"
668                     (copyfiles
669                         (source (tackon "Locale/Catalogs/serbian" @each-name))
670                         (dest (tackon "LOCALE:Catalogs" #cat_name_serbian))
671                         (help @copyfiles-help)
672                     )
673                 )
674             )
675         )
677         ; slovenian catalog file
678         (if (in catalog_lang #lang_slovenian)
679             (
680                 (makedir (tackon "LOCALE:Catalogs" #cat_name_slovenian))
682                 (foreach "Locale/Catalogs/slovenian" "#?.catalog"
683                     (copyfiles
684                         (source (tackon "Locale/Catalogs/slovenian" @each-name))
685                         (dest (tackon "LOCALE:Catalogs" #cat_name_slovenian))
686                         (help @copyfiles-help)
687                     )
688                 )
689             )
690         )
692         ; english-british catalog file, only AmigaOS4.x can handle this
693         (if (and (in catalog_lang #lang_english_british) (= #detectedSystem "os4"))
694             (
695                 (makedir (tackon "LOCALE:Catalogs" #cat_name_english_british))
697                 (foreach "Locale/Catalogs/english-british" "#?.catalog"
698                     (copyfiles
699                         (source (tackon "Locale/Catalogs/english-british" @each-name))
700                         (dest (tackon "LOCALE:Catalogs" #cat_name_english_british))
701                         (help @copyfiles-help)
702                     )
703                 )
704             )
705         )
706      )
709 (complete 100)
711 (message #done)
713 ; /// ********************
714 ;----------------------------------------------------------------------------
715 (exit (QUIET))