Centos7 uses checkinstall to make RPM packages

Checkinstall can easily build RPM packages and DEB packages from source packages. For
more information , please refer to http://linux.cn/article-4090-1.html

1. Install checkinstall on centos7 and build RPM packages to
    download checkinstall, There is no such package in the centos7 source, the checkinstall package on centos6 can also run well on centos7
      wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/ikoinoba /CentOS_CentOS-6/x86_64/checkinstall-1.6.2-3.el6.1.x86_64.rpm
    install checkinstall
      yum install checkinstall-1.6.2-3.el6.1.x86_64.rpm     2.

Syntax for building RPM packages./
configure
    make
    checkinstall Replace the last make install of the compilation and installation with checkinstall
   
3. Use checkinstall to build an example of an RPM package (take ms-sys-2.4.0-1 as an example)
    1. Copy the source package to /usr/local cp ms-sys-2.4.0-1.tar.gz on /src
      /usr/local/src
    2. Enter /usr/local/src directory
      cd /usr/local/src
    3. Unzip the tar package
      tar -zxvf ms-sys-2.4.0-1.tar.gz
    4. Enter ms-sys-2.4.0-1 Directory
      cd ms-sys-2.4.0-1
    5. Compile, install and build the RPM package for your own computer platform (ms-sys-2.4.0-1 contains makefile files and does not require the ./configure step)
      make
      checkinstall
   6." Should I create a default set of package docs?", answer "Y":
      checkinstall 1.6.2, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
      This software is licensed under the GNU GPL


      The package documentation directory ./doc-pak does not exist.
      Should I create a default set of package docs? [y]: y
    7. Answer "Y" After that, the following message will appear, we can write a document for the software to be compiled and installed to build the RPM package.
    You can enter a short description of the package and press enter twice:
      Prepare documentation for the package...OK

      please write a description for this package.
      End your description with a blank line or EOF.
      >> ms-syss-2.4.0 of microsoft
      >> EOF
      >>
    8. Enter a number to modify any of the values ​​below or ENTER to continue:
      The package will be created with the following values:

      1 - Summary: [ ms-sys- 2.4.0-1 of microsoft ]
      2 - Name: [ ms-sys ]
      3 - Version: [ 2.4.0 ]
      4 - Release: [ 1 ]
      5 - License: [ GPL ]
      6 - Group: [ Applications/System ]
      7 - Architecture: [ x86_64 ]
      8 - Source location: [ ms-sys-2.4.0 ]
      9 - Alternate source location: [ ]
      10 - Requires: [ ]
      11 - Provides: [ ms-sys ]

      Enter a number to change them, or press enter to continue:
    9. Then checkinstall will automatically create a .rpm or .deb package, depending on what your linux system is:
    On CentOS7:
      ********* **************************************************** **********

      Done. The new package has been installed and saved to

      /root/rpmbuild/RPMS/x86_64/ms-sys-2.4.0-1.x86_64.rpm

      You can remove it from your system anytime using:

    rpm -e ms-sys-2.4.0-1

      ************************************ ****************************************
    10. Enter the "ms-sys" command to test if
      Usage is available:
        ms-sys [options] [device]
      Options:
  -1, --fat12 Write a FAT12 floppy boot record to device
  -2, --fat32nt   Write a FAT32 partition NT boot record to device
  -3, --fat32     Write a FAT32 partition DOS boot record to device
  -4, --fat32free Write a FAT32 partition FreeDOS boot record to device
  -5, --fat16free Write a FAT16 partition FreeDOS boot record to device
  -6, --fat16     Write a FAT16 partition DOS boot record to device
  -n, --ntfs      Write a NTFS partition Windows 7 boot record to device
  -l, --wipelabel Reset partition disk label in boot record
  -p, --partition Write partition info (hidden sectors, heads and drive id)
  to boot record
  -H, --heads <n> Manually set number of heads if partition info is written
  -7, --mbr7      Write a Windows 7 MBR to device
  -i, --mbrvista  Write a Windows Vista MBR to device
  -m, --mbr       Write a Windows 2000/XP/2003 MBR to device
  -9, --mbr95b    Write a Windows 95B/98/98SE/ME MBR to device
  -d, --mbrdos    Write a DOS/Windows NT MBR to device
  -s, --mbrsyslinux    Write a syslinux MBR to device
  -t, --mbrgptsyslinux Write a syslinux GPT MBR to device
  -z, --mbrzero   Write an empty (zeroed) MBR to device
  -f, --force     Force writing of boot record
  -h, --help      Display this help and exit
  -v, --version   Show program version
  -w, --write     Write automatically selected boot record to device

  Default Inspect current boot record

      Warning: Writing the wrong kind of boot record to a device might
      destroy partition information or file system!
    11. Uninstall the installed ms-sys-2.4.0-1
      rpm -e ms-sys-2.4.0- 1
    12. Check the built RPM package
      cd /root/rpmbuild/RPMS/x86_64
      ls
      The result is
      ms-sys-2.4.0-1.x86_64.rpm
      Then you can copy this rpm package to other centos7 systems for use
     

   

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326677828&siteId=291194637