1.准备工作
2.salt关于gcc-c++的部署脚本:
gcc-mkdir: cmd.run: - name: 'cd /opt && mkdir gcc' gcc-file: file.managed: - source: salt://gcc/gcc-5.2.0.tar.gz - name: /opt/gcc/gcc-5.2.0.tar.gz - user: root - group: root gcc-install: cmd.run: - name: 'cd /opt/gcc && tar -xf gcc-5.2.0.tar.gz && cd gcc-5.2.0 && tar -xf gmp-4.3.2.tar.bz2 && tar -xf isl-0.14.tar.bz2 && tar -xf mpfr-2.4.2.tar.bz2 && tar -xf mpc-0.8.1.tar.gz && ./contrib/download_prerequisites && ./configure --prefix=/usr/local --enable-checking=release --enable-languages=c,c++ --disable-multilib && make -j23 && make install && rm -r /usr/lib64/libstdc++.so.6 && ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64/libstdc++.so.6 && rm -r /usr/local/lib64/libstdc++.so && ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/local/lib64/libstdc++.so && rm -r /usr/local/lib64/libstdc++.so.6 && ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/local/lib64/libstdc++.so.6' - unless: 'test -d /opt/gcc/gcc-5.2.0' - require: - file: gcc-file gcc-rmtgz: file.absent: - name: /opt/gcc/gcc-5.2.0.tar.gz - require: - cmd: gcc-install /etc/profile: file.append: - text: - export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH - require: - file: gcc-rmtgz source-profile: cmd.run: - name: 'source /etc/profile' - require: - file: /etc/profile
3.其余的操作步骤和之前jdk,python类似这里就不写啦。