IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Linux Discussion :

Installation automatique d'un programme sous Linux


Sujet :

Linux

  1. #1
    Rédacteur/Modérateur
    Avatar de troumad
    Homme Profil pro
    Enseignant
    Inscrit en
    Novembre 2003
    Messages
    5 607
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Novembre 2003
    Messages : 5 607
    Par défaut Installation automatique d'un programme sous Linux
    Bonjour

    J'ai fait un installateur automatique de programmes sous Windows : http://www.developpez.net/forums/d10...ramme-windows/
    Je me dois de faire la même chose sous Linux ! J'aimerai générer un ./configure, un make et le make install. À moins qu'il y ait quelque chose d'équivalent à ce que j'ai fait pour windows ! Vous me direz : faire un rpm, ou un deb ou... J'aimerai que ce soit indépendant de la distribution !
    Modérateur Mageia/Mandriva Linux
    Amicalement VOOotre
    Troumad Alias Bernard SIAUD à découvrir sur http://troumad.org
    Mes tutoriels : xrandr, algorigramme et C, xml et gtk...

  2. #2
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 308
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 308
    Billets dans le blog
    5
    Par défaut
    Si tu recherches l'indépendance alors il te faudra passer par les autotools.

    Mais ca génère une forte poussée d'allergie cutanée à bon nombre d'utilisateurs. La création de paquets dédiés à chaque distribution est la solution la plus souple pour les utilisateurs finaux.

  3. #3
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 070
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 070
    Billets dans le blog
    144
    Par défaut
    Bonjour,

    Vous pouvez peut être vous inspiré des solutions des grands développeurs (genre Qt disons). Qui arrivent à fournir un exécutable (graphique en plus) qui installe Qt (sont fort, n'est ce pas?). Après, c'est plus ou moins un script ... et un installateur qui copie/décompresse des fichiers compilé. Comme toujours donc
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  4. #4
    Rédacteur/Modérateur
    Avatar de troumad
    Homme Profil pro
    Enseignant
    Inscrit en
    Novembre 2003
    Messages
    5 607
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Novembre 2003
    Messages : 5 607
    Par défaut
    Citation Envoyé par LittleWhite Voir le message
    (sont fort, n'est ce pas?)
    Et moi, un peu moins
    Modérateur Mageia/Mandriva Linux
    Amicalement VOOotre
    Troumad Alias Bernard SIAUD à découvrir sur http://troumad.org
    Mes tutoriels : xrandr, algorigramme et C, xml et gtk...

  5. #5
    Membre prolifique
    Avatar de Sve@r
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2006
    Messages
    12 815
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Février 2006
    Messages : 12 815
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par LittleWhite Voir le message
    Bonjour,

    Vous pouvez peut être vous inspiré des solutions des grands développeurs (genre Qt disons). Qui arrivent à fournir un exécutable (graphique en plus) qui installe Qt (sont fort, n'est ce pas?). Après, c'est plus ou moins un script ... et un installateur qui copie/décompresse des fichiers compilé. Comme toujours donc
    Perso je n'ai jamais vu d'installateur Qt pour Linux. Je me paluche les install à la main à base de tar + configure + make + make install (que j'ai encapsulé dans un script shell pour l'occasion...)
    Mon Tutoriel sur la programmation «Python»
    Mon Tutoriel sur la programmation «Shell»
    Sinon il y en a pleins d'autres. N'oubliez pas non plus les différentes faq disponibles sur ce site
    Et on poste ses codes entre balises [code] et [/code]

  6. #6
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 070
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 070
    Billets dans le blog
    144
    Par défaut
    Citation Envoyé par Sve@r Voir le message
    Perso je n'ai jamais vu d'installateur Qt pour Linux. Je me paluche les install à la main à base de tar + configure + make + make install (que j'ai encapsulé dans un script shell pour l'occasion...)
    http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp

    (Et y a aussi pour la version 32 bits)
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  7. #7
    Expert confirmé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Billets dans le blog
    2
    Par défaut
    sinon un simple petit script bien paramétré suffit...

  8. #8
    Rédacteur/Modérateur
    Avatar de troumad
    Homme Profil pro
    Enseignant
    Inscrit en
    Novembre 2003
    Messages
    5 607
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Novembre 2003
    Messages : 5 607
    Par défaut
    Citation Envoyé par souviron34 Voir le message
    sinon un simple petit script bien paramétré suffit...
    Une idée ?
    Un exemple ?
    Modérateur Mageia/Mandriva Linux
    Amicalement VOOotre
    Troumad Alias Bernard SIAUD à découvrir sur http://troumad.org
    Mes tutoriels : xrandr, algorigramme et C, xml et gtk...

  9. #9
    Expert confirmé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Billets dans le blog
    2
    Par défaut
    oui, mais je te mettrais un code tout à l'heure (là je suis sous ma partie Win)..

    En gros, un script où tu psoes 2 3 questions (emplacement désré, racine par exemple, etc), puis quelques petites fonctions d'install.

    Je te poste ça un peu plus tard..

  10. #10
    Expert confirmé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par troumad Voir le message
    Une idée ?
    Un exemple ?
    un truc un peu comme ça (j'ai pas fait le ménage et c'était un assez gros truc)


    install.sh :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    #! /bin/ksh
    #------------------------------------------------------------
    #General installation script for software
    #------------------------------------------------------------
    #
    #Definition of variables
    #
    #SOFTWARE  :  name of software being installed
    #VERSION :   current version of the software for name of root directory
    #LOGVERSION : current version of software
    #SOFT_ROOT : absolute path where software will be installed (e.g., /usr/contrib/)
    #ROOTDIRNAME : name of  target directory for installation (${DIR_ROOT}/${SOFTWARE}${VERSION})
    #SOFT_RAWDB: path to raw database directories
    #SOFT_OPDB : path to operationnali lightning database directory
    #SOFT_OPDB : path to operationnal sensor status database directory
    #SOFT_MAN  : path to manpages
    #SOFT_HTML : path to html documentation
    #SOFT_BIN  : directory where executables will be installed
    #SOFT_LOG  : directory where log files will be kept
    #
    DISTRIBBIN=./bin
    DISTRIBCONF=./config
    DISTRIBMAN=./doc/man
    DISTRIBHTML=./doc/html
    DISTRIBRAWDB=./data/bdbrute
    DISTRIBOPDB=./data/coups
    DISTRIBOPSN=./data/sensors
    DISTRIBLOG=./log
    #
    #------------------------------------------------------------
    #Function createdir
    #------------------------------------------------------------
    #
    createdir()
    {
        if [ -d $1 ]
        then
    	echo Directory $1 already exists
        else
    	mkdir $1
    	chmod 755 $1
        fi
    }
     
     
    #
    #------------------------------------------------------------
    #Function createdirorlink
    #------------------------------------------------------------
    #
    createdirorlink()
    {
        if [ "$1" = "$2" ]
        then
    	if [ -d $1 ]
    	then
    	    echo $1 already exist
    	else
    	    createdir $1
    	fi
        else
    	if [ -d $2 ]
    	then
    	    echo $2 already exist! 
    	else
    	    ln -s $1 $2
    	fi
        fi
     
    }
     
    install_files()
    {
        sourced=$1
        targetd=$2
        shift;shift
     
        for file in $*
        do
    	cp -f -p ${sourced}/${file} ${targetd}
        done
    }
     
    install_sh()
    {
        sourced=$1
        targetd=$2
        fconf=$3
        shift;shift;shift
     
        for file in $*
        do
    	cat ${sourced}/${file} | sed "s+_ENVIRONNEMENT_+${fconf}+g" > ${targetd}/${file}
    	chmod 755 ${targetd}/${file}
        done
     
    }
     
    install_files_no_overwrite()
    {
        sourced=$1
        targetd=$2
        shift;shift
     
        for file in $*
        do
            if [ ! -s ${targetd}/${file} ] 
    	    then cp ${sourced}/${file} ${targetd}
    	fi
        done
    }
     
    install_sh_no_overwrite()
    {
        sourced=$1
        targetd=$2
        fconf=$3
        shift;shift;shift
     
        for file in $*
        do
            if [ ! -s ${targetd}/${file} ]
    	    then cat ${sourced}/${file} | sed "s+_ENVIRONNEMENT_+${fconf}+g" > ${targetd}/${file}
    	    chmod 755 ${targetd}/${file}
    	fi
        done
     
    }
     
    install_telquel()
    {
        targetd=$1
        shift;
        for file in $*
        do
    	cp -f -p -R ${file} ${targetd}
        done
    }
    #------------------------------------------------------------
    #Initializing the installation environnement
    #------------------------------------------------------------
    #
     
    #Get initial config
    if [ -f install.ini ]
    then
    . ./install.ini
        ROOTDIRNAME=${SOFT_ROOT}/${SOFTWARE}${VERSION}
        SOFT_RAWDB=${ROOTDIRNAME}/data/bdbrute
        SOFT_OPDB=${ROOTDIRNAME}/data/coups
        SOFT_OPSN=${ROOTDIRNAME}/data/sensors
        SOFT_MAN=${ROOTDIRNAME}/doc/man
        SOFT_HTML=${ROOTDIRNAME}/doc/html
        SOFT_BIN=${ROOTDIRNAME}/bin
        SOFT_CONFIG=${ROOTDIRNAME}/config
        SOFT_LOG=${ROOTDIRNAME}/log
     
    fi
     
    #Overwrite with user defined config
    if [ -f install.cfg ]
    then
    . ./install.cfg
    fi
     
    if [ "${SOFTWARE:-rien}" = "rien" ]
    then
    echo "ERROR: files install.ini and install.cfg are missing"
    exit 1
    fi
     
    NBMENUS=0
        # initialiser les menus disponibles
        echo ${MENULIST} | grep -q 1
        if [ "$?" = "0" ]
        then 
    	MENU1="OUI"
    	NBMENUS=`expr ${NBMENUS} + 1`
        else
    	MENU1="NON"
        fi
     
        echo ${MENULIST} | grep -q 2
        if [ "$?" = "0" ]
        then 
    	MENU2="OUI"
    	NBMENUS=`expr ${NBMENUS} + 1`
        else
    	MENU2="NON"
        fi
     
        echo ${MENULIST} | grep -q 3
        if [ "$?" = "0" ]
        then 
    	MENU3="OUI"
    	NBMENUS=`expr ${NBMENUS} + 1`
        else
    	MENU3="NON"
        fi
     
    clear
    echo " "
    echo " ------- INSTALLATION SCRIPT FOR ${SOFTWARE} VERSION ${LOGVERSION} -------"
    echo " "
    echo "                      CONFIGURATION SECTION"
    echo " "
    echo "To accept default value just type return"
    echo "To modify, just enter new value"
    echo " "
    echo "Type return to continue"
    read reponse
     
     
    echo "Path where the root directory of ${SOFTWARE} will be created:"
    echo "NB., YOU MUST SUPPLY AN ABSOLUTE PATH NAME"
    echo "-----> " ${SOFT_ROOT}   
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    if [ -d ${reponse} ]
    then
    SOFT_ROOT=${reponse}
    ROOTDIRNAME=${SOFT_ROOT}/${SOFTWARE}${VERSION}
    SOFT_BIN=${ROOTDIRNAME}/bin
    SOFT_CONFIG=${ROOTDIRNAME}/config
    SOFT_RAWDB=${ROOTDIRNAME}/data/bdbrute
    SOFT_OPDB=${ROOTDIRNAME}/data/coups
    SOFT_OPSN=${ROOTDIRNAME}/data/sensors
    SOFT_MAN=${ROOTDIRNAME}/doc/man
    SOFT_HTML=${ROOTDIRNAME}/doc/html
    SOFT_LOG=${ROOTDIRNAME}/log
    else
    echo "ERROR: Directory ${reponse} does not exist"
    exit 1
    fi
    fi
     
    echo "Directory where the excutables will be located "
    echo "-----> " ${SOFT_BIN}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_BIN=${reponse}
    fi
     
     
    echo "Directory where the configuration files will be located "
    echo "-----> " ${SOFT_CONFIG}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_CONFIG=${reponse}
    fi
     
    echo "Directory where the raw database will be located "
    echo "-----> " ${SOFT_RAWDB}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_RAWDB=${reponse}
    fi
     
     
    echo "Directory where the operational lightning database will be located "
    echo "-----> " ${SOFT_OPDB}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_OPDB=${reponse}
    fi
     
     
    echo "Directory where the operational sensor status database will be located "
    echo "-----> " ${SOFT_OPSN}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_OPSN=${reponse}
    fi
     
     
    echo "Directory where the manpages will be located "
    echo "-----> " ${SOFT_MAN}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_MAN=${reponse}
    fi
     
     
    echo "Directory where the html documentation will be located "
    echo "-----> " ${SOFT_HTML}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_HTML=${reponse}
    fi
     
     
    echo "Directory where the log files will be located "
    echo "-----> " ${SOFT_LOG}
    echo "return to accept, or new path"
    read reponse
     
    if [ "${reponse:-rien}" != "rien" ]
    then
    SOFT_LOG=${reponse}
    fi
     
    #
    #------------------------------------------------------------
    #Saving the user's preferences to file install.cfg
    #Next time install.sh is run, these values will
    #take precedence
    #------------------------------------------------------------
    #
    echo SOFT_ROOT=${SOFT_ROOT} > ./install.cfg
    echo ROOTDIRNAME=${ROOTDIRNAME} >> ./install.cfg
    echo SOFT_BIN=${SOFT_BIN} >> ./install.cfg
    echo SOFT_CONFIG=${SOFT_CONFIG} >> ./install.cfg
    echo SOFT_RAWDB=${SOFT_RAWDB} >> ./install.cfg
    echo SOFT_OPDB=${SOFT_OPDB} >> ./install.cfg
    echo SOFT_OPSN=${SOFT_OPSN} >> ./install.cfg
    echo SOFT_MAN=${SOFT_MAN} >> ./install.cfg
    echo SOFT_HTML=${SOFT_HTML} >> ./install.cfg
    echo SOFT_LOG=${SOFT_LOG} >> ./install.cfg
    echo MENULIST='"'"${MENULIST}"'"'  >> ./install.cfg
    chmod 755 ./install.cfg
     
    clear
    echo " "
    echo "----- This is your configuration ------"
    echo " "
    echo "Path to executables="${SOFT_BIN}
    echo "Path to configuration files="${SOFT_CONFIG}
    echo "Path to raw database =" ${SOFT_RAWDB}
    echo "Path to operational lightning database=" ${SOFT_OPDB}
    echo "Path to operational sensor status database=" ${SOFT_OPSN}
    echo "Path to manpages="${SOFT_MAN}
    echo "Path to html documentation="${SOFT_HTML}
    echo "Path to log files="${SOFT_LOG}
    echo " "
    echo "To modify any of these values, just edit the file ./install.cfg"
    echo "or rerun the install.sh script"
    echo " "
    echo "Continue installation  y|n  [y]"
    read reponse
     
    if [ "${reponse}" = "n" ]
    then
    exit 1
    fi
     
    echo "Proceding with installation of ${SOFTWARE} VERSION ${VERSION}"
    #
    #------------------------------------------------------------
    #Creation of root directory
    #------------------------------------------------------------
    #
    createdir ${SOFT_ROOT}
    createdir ${ROOTDIRNAME}
     
    #
    #------------------------------------------------------------
    #Creation of bin directory or link to true bin directory
    #------------------------------------------------------------
    #
     
    createdirorlink ${SOFT_BIN} ${ROOTDIRNAME}/bin
     
    #
    #------------------------------------------------------------
    #Creation of config directory or link to config directory
    #------------------------------------------------------------
    #
     
    createdirorlink ${SOFT_CONFIG} ${ROOTDIRNAME}/config
     
     
    #
    #------------------------------------------------------------
    #Creation of doc directory
    #------------------------------------------------------------
    #
    createdir ${ROOTDIRNAME}/doc
    #
    #------------------------------------------------------------
    #Creation of manpages directory or link to it
    #------------------------------------------------------------
    #
    createdirorlink ${SOFT_MAN} ${ROOTDIRNAME}/doc/man
    createdirorlink ${SOFT_HTML} ${ROOTDIRNAME}/doc/html
    #
    #------------------------------------------------------------
    #Creation of log file directory or link to it
    #------------------------------------------------------------
    #
    createdirorlink ${SOFT_LOG} ${ROOTDIRNAME}/log
     
    echo "                  CONFIGURATION COMPLETED"
    echo " "
    if [ ${NBMENUS} -gt 1 ]
    then
    echo " CHOOSE THE TYPE OF INSTALLATION YOU WANT"
    echo " "
    if [ "${MENU1}" = "OUI" ]
    then
    	echo " 1 - INSTALL RAW DATABASE AND RELATED SOFTWARE"
    fi
    if [ "${MENU2}" = "OUI" ]
    then
    	echo " 2 - INSTALL OPERATIONAL DATABASE AND RELATED SOFTWARE"
    fi
    if [ "${MENU3}" = "OUI" ]
    then
    	echo " 3 - INSTALL  CLIENT PROGRAMS"
    fi
     
    echo " "
    echo " ENTER THE NUMBER CORRESPONDING TO YOUR CHOICE OR RETURN TO QUIT: "
    read reponse
    else
    if [ "${MENU1}" = "OUI" ]
    then reponse=1
    elif [ "${MENU2}" = "OUI" ]
    then reponse=2
    elif [ "${MENU3}" = "OUI" ]
    then reponse=3
    fi
    fi
    if [ "${reponse}" = "1"  -a "${MENU1}" = "OUI" ]
    then
    echo "Proceding with installation of raw database and related software"
    echo "Please wait"
     
    createdir ${ROOTDIRNAME}/data
    createdirorlink ${SOFT_RAWDB} ${ROOTDIRNAME}/data/bdbrute
     
    install_telquel ${ROOTDIRNAME}/data/bdbrute ${RAWDBTQ}
     
    install_files ${DISTRIBBIN} ${SOFT_BIN} ${RAWDBBIN}
    install_files_no_overwrite ${DISTRIBCONF} ${SOFT_CONFIG} ${RAWDBCONF}
    install_sh ${DISTRIBBIN} ${SOFT_BIN} ${ROOTDIRNAME} ${RAWDBSH}
    install_sh_no_overwrite ${DISTRIBCONF}  ${SOFT_CONFIG}  ${ROOTDIRNAME} ${RAWDBDAT}
     
    if [ -d ${DISTRIBMAN} ]
    then
    cp -R ${DISTRIBMAN}/* ${SOFT_MAN}
    fi
    if [ -d ${DISTRIBHTML} ]
    then
    cp -R ${DISTRIBHTML}/* ${SOFT_HTML}
    fi
     
    echo "install.sh ends"
    echo " "
    echo "Make sure you clean up the installation directory and tar file"
    echo "               once all installations are completed"
    exit 0
    fi
     
    if [ "${reponse}" = "2"  -a "${MENU2}" = "OUI" ]
    then
    echo "Proceding with installation of operational database and related software"
    echo "Please wait"
    createdir ${ROOTDIRNAME}/data
    createdirorlink ${SOFT_OPDB} ${ROOTDIRNAME}/data/coups
    createdirorlink ${SOFT_OPSN} ${ROOTDIRNAME}/data/sensors
     
    install_telquel ${ROOTDIRNAME}/data/sensors ${OPDBTQ}
    install_files ${DISTRIBBIN} ${SOFT_BIN} ${OPDBBIN}
    install_files_no_overwrite ${DISTRIBCONF} ${SOFT_CONFIG} ${OPDBCONF}
    install_sh ${DISTRIBBIN} ${SOFT_BIN} ${ROOTDIRNAME} ${OPDBSH}
    install_sh_no_overwrite ${DISTRIBCONF}  ${SOFT_CONFIG}  ${ROOTDIRNAME} ${OPDBDAT}
     
    if [ -d ${DISTRIBMAN} ]
    then
    cp -R ${DISTRIBMAN}/* ${SOFT_MAN}
    fi
    if [ -d ${DISTRIBHTML} ]
    then
    cp -R ${DISTRIBHTML}/* ${SOFT_HTML}
    fi
     
    echo "install.sh ends"
    echo " "
    echo "Make sure you clean up the installation directory and tar file"
    echo "               once all installations are completed"
    exit 0
    fi 
     
    if [ "${reponse}" = "3" -a "${MENU3}" = "OUI" ]
    then
    echo "Proceding with installation of client programs"
    echo "Please wait"
     
    install_telquel ${ROOTDIRNAME} ${CLIENTTQ}
    install_files ${DISTRIBBIN} ${SOFT_BIN} ${CLIENTBIN}
    install_files_no_overwrite ${DISTRIBCONF} ${SOFT_CONFIG} ${CLIENTCONF}
    install_sh ${DISTRIBBIN} ${SOFT_BIN} ${ROOTDIRNAME} ${CLIENTSH}
    install_sh_no_overwrite ${DISTRIBCONF}  ${SOFT_CONFIG}  ${ROOTDIRNAME} ${CLIENTDAT}
     
    if [ -d ${DISTRIBMAN} ]
    then
    cp -R ${DISTRIBMAN}/* ${SOFT_MAN}
    fi
    if [ -d ${DISTRIBHTML} ]
    then
    cp -R ${DISTRIBHTML}/* ${SOFT_HTML}
    fi
     
    echo "install.sh ends"
    echo " "
    echo "Make sure you clean up the installation directory and tar file"
    echo "               once all installations are completed"
    exit 0
    fi

    install.ini :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    #!/bin/ksh
    #
    #This is the initial configuration file for the installation script
    #Definition of variables
    #
    #SOFTWARE :  name of software being installed
    #VERSION :   current version of the software  for name of root directory
    #LOGVERSION :   current version of the software 
    #SOFT_ROOT : absolute path where software will be installed (e.g., /usr/contrib/)
    #ROOTDIRNAME : directory where the software will be installed
    #
     
    SOFTWARE=foudre
    VERSION=2
    LOGVERSION=2.0
     
    MENULIST="1 2 3"
     
    SOFT_ROOT=/usr/local
     
    ROOTDIRNAME=${SOFT_ROOT}/${SOFTWARE}${VERSION}
     
     
    RAWDBBIN="lire_foudreb ajouter_bdfoudreb nettoyer_foudreb.pl foudrebruted mnfoudreb test_foudrebruted"
    RAWDBSH="gerer_ingestion_foudre.sh foudrebruted.sh mnfoudreb.sh check_raw_data_ingest.sh debug_device.sh" 
    RAWDBCONF="foudrebrute.conf"
    RAWDBDAT="env.sh"
    RAWDBTQ="data/bdbrute/limite_courante"
     
    OPDBBIN="foudreb2bd sensorsb2bd test_foudrebruted"
    OPDBSH="foudreb2bd.sh sensorsb2bd.sh check_op_data_ingest.sh"
    OPDBCONF="foudrebrute.conf"
    OPDBDAT="env.sh"
    OPDBTQ="data/sensors/bddetecteurs"
     
    CLIENTBIN="mnfoudreb"
    CLIENTSH="mnfoudreb.sh"
    CLIENTCONF="foudrebrute.conf"
    CLIENTDAT="env.sh"
    CLIENTTQ=""

    env.sh

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
    #!/bin/ksh
    #
    #---------------------------------------------------------------------
    # Fichier de configuration pour le logiciel
    #---------------------------------------------------------------------
    #
     
    export FOUDRE_HOME=_ENVIRONNEMENT_
    export FOUDRE_BD=$FOUDRE_HOME/data/coups
    export FOUDRE_BDBRUTE=$FOUDRE_HOME/data/bdbrute
    export FOUDRE_COUPS=$FOUDRE_HOME/data/coups
    export FOUDRE_SENSORS=$FOUDRE_HOME/data/sensors
    export FOUDRE_BIN=$FOUDRE_HOME/bin
     
    export TZ=UTC0
     
    export PATH=${PATH}:${FOUDRE_BIN}
     
    umask 022

    Alors ne tiens pas compte des noms, mais juste du style de structure, en particulier pour install.sh .. Tu peux en tirer un squelette simple...


    Sinon tu peux aussi te référer à par exemple le "makefile" d'une distrib comme libtiff : organisée entre outils, bibliothèques, docs, man pages, elle fait un "run config" puis un "make" puis un "make install"...

  11. #11
    Rédacteur/Modérateur
    Avatar de troumad
    Homme Profil pro
    Enseignant
    Inscrit en
    Novembre 2003
    Messages
    5 607
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Novembre 2003
    Messages : 5 607
    Par défaut
    Merci
    Dans 15 jours, j'aurais plus de temps Et encore, j'au rais des copies à corriger ! On dira 21 jours !
    Modérateur Mageia/Mandriva Linux
    Amicalement VOOotre
    Troumad Alias Bernard SIAUD à découvrir sur http://troumad.org
    Mes tutoriels : xrandr, algorigramme et C, xml et gtk...

Discussions similaires

  1. installation de la lib BLT sous Linux
    Par tarantella dans le forum Tkinter
    Réponses: 1
    Dernier message: 12/09/2006, 10h23
  2. Installation apache 2.2.3 sous linux
    Par Vlacar dans le forum Apache
    Réponses: 2
    Dernier message: 11/09/2006, 13h51
  3. Faire fonctionner des programmes sous Linux
    Par vviivvii dans le forum Mandriva / Mageia
    Réponses: 14
    Dernier message: 29/08/2006, 19h41
  4. [16F84a] Programmation sous linux
    Par Michaël dans le forum Autres architectures
    Réponses: 2
    Dernier message: 25/02/2006, 12h05
  5. GDB/Recherche EDI - Debugguer un programme sous linux
    Par Rodrigue dans le forum Applications et environnements graphiques
    Réponses: 6
    Dernier message: 17/01/2006, 23h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo