Everyone is rpm

zhaozj2021-02-08  228

We do RPM Author: Unknown ○, Preface - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - This should be a dream of many Linux players, now, with the Red Hat Linux and RPM system gradually attaches great importance, realizing the process of dreaming No longer suffering. "The former people plant trees, the future generation is cold", are you enjoying a cool enjoyment, I have risen a self, I hope "good things can be shared with good friends?" I hope that this article has an opportunity to provide guidance function, through the brick The effect, let more Linux on the Internet, can contribute your heart together. I. Prepare for work - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - What is rpm If you really don't know, or you don't know what is rpm, you should first do the following homework: 1. Read RPM-HOWTO for RPM RPM-HOWTO in China can be obtained by http://www.linux.org.tw/cldp/rpm-howto.html. Please read the first three chapters first. 2. Reactive Red Hat Linux actually installed the best job platform for the RPM system and allows you to feel the overall RPM operation. Note: If you are familiar with Debian Linux DPKG system, please rest assured that RPM should be easy than DPKG, familiar with Debian Linux friends, I believe that the above basic skills have been fully covered. With your weapons, we are ready to go on, so you must check the following "Portable Weapons", if you miss any one, I am sorry, please make somewhere: 1. At least one handy editor, writer. 2. Familiar with Bash / KSH Script syntax, and its importance is really difficult. 3. Familiar with the use of tools such as GREP, SED, AWK, INSTALL, LDCONFIG, will have a lot of benefits. 4. Familiar with the four basic functions of RPM: INSTALL, UPGRADE, Query, Verify5. Basic C language compile skills, at least Makefile Writing Concept, Diff, Patch. Note: How many related techniques do you have, I can't say it, strictly speaking, and it is an idiot. Therefore, it will be based on the situation. If you want to make a difficult package file, then the superb compilation is unpredictable. If the original code is used, you have long written a perfect makefile, then directly make, make install, but . Perhaps some language specializing in Perl, Python, TK / TCL, Java, which is also a good thing, especially when making such a parcel file related to "alternative languages", you should feel well.

However, once again, shell Script is the basic language of RPM, and C is RPM's normal language, like Perl, Python, TK / TCL, Java, although almost all problems, but considering portability and program volume, you Don't think about it. Moreover, don't underestimate GREP, SED, AWK these small tools, their power to Bash, should meet the needs of all RPM production. Second, the reference materials - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - Perhaps RPM-HOWTO should be the first document that needs to be referred to, but the suggestion "The purpose is only the basic concept", or if you can read this file from the head, 80% can understand the content of RPM-HOWTO Because I have tried in this article, I imagine "to tell the key points of RPM-HOWTO" with a way you can understand the teaching and harvest. Of course, you can also complain that Chinese version of RPM-HOWTO translation is too bad, so that smart is like you have to understand. This kind of saying is indeed, because RPM-HOWTO is also known in the lower hand, honestly said, I didn't dare to know RPM after I was finished. Maximum rpm is a "book" recommended by the following, which should be the most detailed and complete RPM special book with existing, in-depth, led the reader to understand the RPM system. The book originally written by Red Hat, written by Ed Bailey, enthusiastic him, extra on the Internet, POSTScript file is available, and let us offer the highest pay. If the entire PostScript file is printed, there are four hundred pages, with a heart excitement, can be printed, otherwise, you can read it with GhostScript online. If you want to buy a book directly, you can go http://www.redhat.com/ query. Http://www.rpm.org/ with rpm Mailing List, the inner line knows :-) Third, the process of making RPM - = - = - = - = - = - = - = - = - = - = = - = - = - = - = - = - = - = - = - The basic steps to build the RPM package file are as follows: 1. Determine your / etc / rpmrc already needed to complete the settings. 2. Retrieve the Source Code to be built. 3. Make the desired Source archive Patch action so that we can smoothly build the entire program. 4. Write a SPEC file for the parcel file. 5. Confirm that each file is in the correct directory location. 6. Use RPM to build the entire parcel file. / etc / rpmrc file RPM system control file, System-Wide set file is / usr / lib / rpmrc, and the set file of Customized is / etc / rpmrc. In general, the content of the / usr / lib / rpmrc file is completely unhappy, if there is any new settings, write in / etc / rpmrc, because it will "cover" / usr / lib / rpmrc Value.

The following is the example of my / etc / rpmrc file: # - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - ## / etc / rpmrc ## ## local customizations Are Made to override / usr / lib / rpmrc. ## = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - # Distribution: ManhattanRequire_Distribution: 1 vendor: twlugRequire_vendor: 1Packager: PENELOPE MARR Other additional important information about the production process of the RPM package file, in fact there are many important details, must Keep in mind, this part please refer to RPM-HOWTO [Building RPMS]. Fourth, a simplest example - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - Let us Let's learn from a HelloWorld RPM package file to ensure simplicity to spicy day. You can exercise your own examples, because they are both small and simple, should not affect your system. Let's "pure" SOURCE assumptions: This helloworld-1.0-1.tgz file has only two files, one is Readme, the content is as follows (in fact, it is not important): Simple Example for rpm package building demo. One is HelloWorld.c, the content is as follows (it is simple, it is not important): main () {printf ("Hello, World / N");} Ok, you must put this TGZ file / usr / src / redhat / Sources under the bottom.

Write spec files must be written helloworld-1.0-1.spec in / usr / src / redhat / SPECS underneath, content examples: Summary: Simple Example for RPM Building DEMO.Name: helloworldVersion: 1.0Release: 1Copyright: Open SourceGroup: Extensions / ChineseSource : helloworld-1.0-1.tgzPackager: Penelope Marr% description This package is used as a demo for RPM building only% changelog * Thu Jul 16 1998 Penelope Marr - build for the first time% prep% setup -c% buildmake helloworld.. % Install Install -M 755 HelloWorld / USR / local / bin / helloworld% Files% DOC README / USR / local / bin / helloworld □ Startup RPM -BA ... EXAMPLE # CD / USR / SRC / RedHat / SpecSexample # rpm - Ba HelloWorld-1.0-1.Spec 1> / TMP / OUT 2> / TMP / ERR can be convenient for us to make it easier to master relevant information. V. Making the package file with "installation" - = - = - = - = - = - = - = - = - = - = - = - = - = - = - "Relocatable Package", For "package files that can be installed), the relevant detailed description, you can refer to Maximum RPM Chapter 15. Due to the multi-prefix setting function, this type of package file adds greater elasticity, very practical, but at the same time, additional packing file production is added.

转载请注明原文地址:https://www.9cbs.com/read-1817.html

New Post(0)