Easily package and install source code in CentOS

Source: Internet
Author: User
Tags certmaster

We usually need more than a dozen installation packages when installing a platform in Linux/Unix. These source packages are from the network, local hard disk, and mobile devices. Sometimes it may cause a lot of trouble if the network is not smooth or becomes invalid. A good way is to download commonly used software packages to a local hard disk for storage. The problem is that over time, I don't even know which packages are suitable. Now it is a good solution to use makeself to implement self-resolution overwhelming installation. The following describes how to create the Func Client installation package.

I. Sort out software packages

# Cd/home
# Mkdir FuncPack1.0
Drop all required software packages to the FuncPack1.0 directory :)
# Ls FuncPack1.0

-Rw-r -- 1 root root50878 Sep 282009 certmaster-0.25.tar.gz
-Rw-r -- 1 root root249 Oct82009 certmaster. conf
-Rw-r -- 1 root 152871 Sep 282009 func-0.25.tar.gz
-Rw-r -- 1 root root=oct82009 minion. conf
-Rw-r -- 1 root 197981 Sep 282009 pyOpenSSL-0.9.tar.gz
-Rw-r -- 1 root 11060830 May 222008 Python-2.5.1.tgz

2. Compile and install shell
# Cd FuncPack1.0
# Vi install. sh
View plainprint?

  1. #! /Bin/sh
  2. #
  3. #---------------------------------------------------
  4. # Apython & funcinstallshell
  5. #---------------------------------------------------
  6. #
  7. # WritedbyLiutiansi
  8. # Mail: liutiansi@gmail.com
  9. # Blog: http://blog.liuts.com
  10. # QQgroups: 106651547
  11. #---------------------------------------------------
  12. _ Pwd = $ (pwd)
  13. Cd $ _ pwd/FuncPack1.0
  14. Echo "============================= * installpython2.5 * ====================== ============"
  15. // Bin/tar-zxvfPython-2.5.1.tgz
  16. CdPython-2.5.1
  17. ./Configure & make & makeinstall
  18. Echo "exportPATH =\$ PATH:/usr/local/bin">/etc/profile
  19. Source/etc/profile
  20. Cd ..
  21. Echo "=========================== * installFunc/certmaster/pyOpenSSL * ================== ==="
  22. // Bin/tar-zxvfpyOpenSSL-0.9.tar.gz
  23. CdpyOpenSSL-0.9
  24. /Usr/local/bin/pythonsetup. pyinstall
  25. Cd ..
  26. // Bin/tar-zxvfcertmaster-0.25.tar.gz
  27. Cdcertmaster-0.25
  28. /Usr/local/bin/pythonsetup. pyinstall
  29. Cd ..
  30. // Bin/tar-zxvffunc-0.25.tar.gz
  31. Cdfunc-0.25
  32. /Usr/local/bin/pythonsetup. pyinstall
  33. Cd ..
  34. /Bin/ln-s/usr/local/bin/certmaster/usr/bin/certmaster
  35. /Bin/ln-s/usr/local/bin/funcd/usr/bin/funcd
  36. /Bin/sed-I's/''hostname'' // G'/etc/hosts
  37. /Bin/rm-rf/etc/certmaster. conf
  38. /Bin/rm-rf/etc/certmaster/minion. conf
  39. /Bin/cpcertmaster. conf/etc/certmaster
  40. /Bin/cpminion. conf/etc/certmaster
  41. /Bin/sed-I-e '/^ listen_port/{s/51234/1999/;}'/etc/func/minion. conf
  42. /Bin/sed-I-e "/^ minion_name/{s = 'hostname';}"/etc/func/minion. conf
  43. /Sbin/chkconfig -- level345certmasteron
  44. /Sbin/servicecertmasterstart
  45. /Sbin/chkconfig -- level345funcdon
  46. /Sbin/servicefuncdstart
  47. Echo "Installover! "

# Chmod + x install. sh

3. Packaging
# Cd/home
# Wget http://megastep.org/makeself/makeself-2.1.5.run
# Chmod + x makeself-2.1.5.run
#./Makeself-2.1.5.run
# Cd makeself-2.1.5
Start packaging!
#./Makeself. sh -- notemp.../FuncPack1.0/FuncPack1.0.bin "system start install..."./install. sh
Running result:

Header is 402 lines long

About to compress 11280 KB of data...
Adding files to archive named "FuncPack1.0.bin "...
./
/Func-0.25.tar.gz
/Python-2.5.1.tgz
/PyOpenSSL-0.9.tar.gz
./Install. sh
./Minion. conf
./Certmaster. conf
/Certmaster-0.25.tar.gz
CRCs: 853861468
MD5: 14463177b627f0e85f3591e88fb02b1d

Self-extractible archive "FuncPack1.0.bin" successfully created.

Command description:
1. -- notemp does not generate a temporary directory. Create a new directory under the current directory (recommended)
2../FuncPack1.0/package source directory
3. Generate a self-run decompressed file using FuncPack1.0.bin
4. "system start install..." installation prompt
5. The installation script to be executed after./install. sh is decompressed
6. CRC and MD5 (prevent tampering)

For more information, see the official http://megastep.org/makeself/.

4. Running package
1. scp the generated FuncPack1.0.bin file to other hosts
2. Run FuncPack1.0.bin.

If you have any questions or interested topics, you can communicate with me through weibo: http://t.qq.com/yorkoliu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.