µ±Ç°Î»ÖãºLinux½Ì³Ì - Linux×ÛºÏ - Óà RPM ´ò°üÈí¼þ£¬µÚ 2 ²¿·Ö

Óà RPM ´ò°üÈí¼þ£¬µÚ 2 ²¿·Ö

¡¡¡¡ÔÚ²»¾ß±¸ root ȨÏÞµÄÇé¿öϹ¹½¨¡¢¸øÈí¼þ´ò²¹¶¡ºÍ·Ö·¢ RPM Dan Poirier£¨[email protected]£© Èí¼þ¹¤³Ìʦ£¬IBM 2001 Äê 12 Ô RPM ÊÇÒ»Öֹ㷺ÓÃÓÚ·¢²¼ Linux Èí¼þµÄ¹¤¾ß£»Óû§¿ÉÒÔÇáËɵذ²×°Óà RPM ´ò°üµÄ²úÆ·¡£ ÔÚ±¾ÎÄ£¨¸ÃϵÁÐÎÄÕÂµÄµÚ 2 ƪ£©ÖУ¬Dan ˵Ã÷ÁËÔÚ²»¾ß±¸ root ȨÏÞµÄÇé¿öÏÂÈçºÎ¶ÔÈí¼þ½øÐдò°ü£¬ÔÚ²»×ö¸ü¸ÄµÄÇé¿öÏÂÈçºÎ´¦Àí²»ÔÚ Linux ÉϹ¹½¨µÄÈí¼þ£¬ÒÔ¼°ÈçºÎ·Ö·¢ÄúµÄ¹¤×÷½á¹û¡£ Èç¹ûÄúûÓÐÔĶÁ¹ý±¾ÏµÁÐÎÄÕÂµÄµÚ 1 ²¿·Ö£¬ ÄÇôÄú¿ÉÄÜÏ£ÍûÔÚ¼ÌÐøÔĶÁ±¾ÎÄ֮ǰÏÈÔĶÁÄÇƪÎÄÕ¡£ ²»×÷Ϊ root Óû§À´¹¹½¨ RPM °ü ÕýÈçÄúÔÚµÚ 1 ²¿·ÖÖп´µ½µÄÄÇÑù£¬¹¹½¨ RPM Èí¼þ°üͨ³£ÒªÇóÄúÒÔ root Óû§µÇ¼¡£ ÆäÔ­ÒòÈçÏ£º 1. RPM ÔÚ´ò°ü¹ý³ÌÖа²×°Èí¼þ£¬²¢ÇÒͨ³£Ö»ÓÐ root Óû§¿ÉÒÔдµ½°²×°Ä¿Â¼ÖС£ 2. RPM ÐèÒª¶Áд /usr/src/redhat£¨Ò»°ãÓû§²»ÄÜÐÞ¸ÄËü£©ÏµÄĿ¼¡£ ÎÒÃÇÔÚµÚ 1 ²¿·ÖÖÐ̽ÌÖÁËͨ¹ýÓà RPM ¹¹½¨¸ù£¨build root£©À´½â¾öµÚÒ»¸öÎÊÌâ¡£ Òª½â¾öµÚ¶þ¸öÎÊÌ⣬¿ÉÒÔͨ¹ý¸ü¸Ä %_topdir ÉèÖÃÀ´¸æËß RPM ²éÕҺʹ´½¨²»Í¬Ä¿Â¼¼¯ÖеÄÎļþ¡£°´ÕÕÏÂÃæµÄ·½·¨ÔÚÄúµÄÖ÷Ŀ¼Ï´´½¨Ò»¸öÃûΪ .rpmmacrosµÄÎļþ£º %_topdir /home/your_userid/rpm Õâ¸öÎļþ»á¸æËß RPM£ºËüÏÈÇ°ÔÚ /usr/src/redhat ϲéÕÒµÄËùÓÐĿ¼Ӧ¸Ã¸ÄΪÔÚ /home/your_userid/rpm ϲéÕÒ¡£ ÏÖÔÚ£¬ÄúÓ¦¸Ã´´½¨ÕâÑùÒ»¸öÍêÕûµÄĿ¼Ê÷£º ~/rpm ~/rpm/SOURCES ~/rpm/SPECS ~/rpm/BUILD ~/rpm/RPMS ~/rpm/RPMS/i386 ~/rpm/SRPMS £¨Èç¹ûÔ¸Ò⣬¿ÉÒÔͨ¹ýÔÚ RPM ÖÐÖØж¨ÒåÆäËüºê£¬À´½«ÆäÖÐÈκÎĿ¼·ÅÔÚÄúÏë·ÅµÄÈκεط½¡£Äú¿ÉÄÜÐèÒª¿¼ÂǸü¸ÄµÄһЩºê°üÀ¨ %_sourcedir¡¢%_specdir¡¢%_srcrpmdir¡¢%_builddir ºÍ %_rpmdir¡£ ÓйØÕâЩºêµÄȱʡֵ£¬Çë²é¿´ /usr/lib/rpm/macros¡£ ¶ÔÓÚÕâ¸öʾÀý£¬ÎÒÃǽö½ö½«ËüÃǶ¼·ÅÔÚ ~/rpm Ï¡££© ÏÖÔÚ£¬½« indent-2.2.6.tar.gz Îļþ£¨Çë²ÎÔı¾ÎĺóÃæµÄ²Î¿¼×ÊÁÏ£©¸´ÖƵ½ ~/rpm/SOURCES£¬ÕâÀïûÓÐÒÔ root Óû§µÇ¼£¬ÔËÐÐ rpm -ba indent-2.spec£¨ÕâЩÎļþ¾ÍÊÇµÚ 1 ²¿·ÖÖеÄÄÇЩÎļþ£©¡£RPM ½« °Ñ indent ¹¹½¨ÔÚ ~/rpm/BUILD Ŀ¼Ï£¬²¢½«¶þ½øÖÆµÄ RPM °ü·ÅÔÚ ~/rpm/RPMS/i386 ÖУ¬½«Ô´´úÂë°ü·ÅÔÚ ~/rpm/SRPMS ÖС£ ÓëÖ®Ïà¶ÔÕÕ£¬ÔÚûÓй¹½¨¸ùµÄÇé¿öÏ£¬³¢ÊÔʹÓà spec Îļþ indent-1.spec¡£RPM ÔÚ³¢ÊÔ½« indent °²×°µ½ /usr/local/bin ÖÐʱ»áʧ°Ü¡£ ¸æ½ë ʹÓù¹½¨¸ùºÍÉèÖà RPM µÄ i%_topdir ʹÄúÄÜÔÚ²»×÷Ϊ root ÔËÐеÄÇé¿öϹ¹½¨Ðí¶àÈí¼þ°ü£¬µ«Õâ²¢²»×ÜÊǺÜÈÝÒס£ Ê×ÏÈ£¬Ò»Ð©°ü²¢²»Ïó indent ÄÇÑù¿ÉÒÔÈÝÒ׵ذ²×°µ½¹¹½¨¸ùĿ¼ÖС£¶ÔÓÚÄÇЩÈκÎδÓà GNU autoconf À´¿ª·¢µÄ°ü£¬Äú±ØÐëÒª×Ðϸ²é¿´Ò»Ï£¬¿´ÊÇ·ñÓÐÒ»ÖÖ·½·¨£¬¿ÉÒÔ½«°ü°²×°µ½ÁíÒ»¸öĿ¼ÖУ¬ ÕâÒ²Ðí¿ÉÒÔÐÞ¸Ä Makefile À´Ç¿ÖÆÕâÑù×ö¡£ÔÚÏÂÒ»²¿·ÖÖУ¬ÎÒ½«ÏòÄúÑÝʾÈçºÎʹÓà RPM À´¹¹½¨ÒÑÐ޸ĵijÌÐò¡£ Æä´Î£¬Ö»ÓÐÏ൱ÉÙ²¿·Ö°ü½«ÔÚÆäÕý³£°²×°ÆÚ¼äÊÔͼ×öһЩֻÓÐ root Óû§²Å¿ÉÒÔ×öµÄÊÂÇ飬È磺 * ´´½¨ÌØÊâÎļþ£¨¹ÜµÀ¡¢É豸ÎļþµÈµÈ£© * ÐÞ¸ÄϵͳÅäÖÃÎļþ` Äú±ØÐëÖð¸ö´¦ÀíÕâЩÎÊÌ⡣ͨ³££¬Äú¿ÉÒÔÔÚ post-install ½Å±¾£¨ÔÚ°²×° RPM Ö®ºóÔËÐеĽű¾£©ÖÐ×öһЩ±ØÒª¹¤×÷¡£ÎÒ½«ÔÚÒÔºóµÄÎÄÕÂÖÐÌÖÂÛËüÃÇ£¬µ«¼ò¶øÑÔÖ®£¬¿ÉÒÔ½«¡°%post¡±½ÚÌí¼Óµ½ spec ÎļþÖУ¬ ²¢ÔڸýÚÖзÅÖÃһЩ Linux ÃüÁÒÔ±ãÔÚ°²×° RPM Ö®ºóÔËÐÐÕâЩÃüÁî¡£ ¸øÈí¼þ´ò²¹¶¡ ¼ÙÉèÄúÓÐһЩҪ´ò³É RPM °üµÄÈí¼þ£¬ µ«Èç¹û²»¶ÔËü×öһЩ¸ü¸Ä£¬¾Í²»ÄÜÔÚ Linux ÉϹ¹½¨Ëü¡£ È»¶ø£¬ÄúÓÖûÓÐÓµÓиÃÈí¼þ£¬ËùÒÔ²»ÄÜÕýʽµØ¸ü¸ÄËü¡£ ÄúËùÐèÒª×öµÄ¾ÍÊǶԸÃÈí¼þµÄÕýʽ°æ±¾½øÐдò²¹¶¡»ò×öһЩÐ޸ġ£ µ«ÊÇ£¬¶ÔÆäËûÈ˵ÄÈí¼þ½øÐÐÐ޸ģ¬È»ºóÔÙ·Ö·¢´ËÐ޸ĹýµÄ°æ±¾Í¨³£±»ÈÏΪÊDz»ÀñòµÄ£¬ËùÒÔÄúÏ£ÍûÄú×Ô¼ºËù×öµÄ¸ü¸Ä¶Ô±ðÈËÀ´ËµÒ²ÊÇ¿ÉÓõġ£ ÕâÑù£¬Ê¹ÓÃÄúµÄ°üµÄÈκÎÈ˶¼¿ÉÒÔ¿´µ½Äú×öÁËÄÄЩÊÂÇéÒÔ¼°È·¶¨ÄúËù×öµÄ¸ü¸ÄÊÇ·ñÊǿɽÓÊܵġ£ ÕâÊdz£ÓеÄÊ£¬¶øÇÒ RPM Ò²ÌṩһЩ°ïÖú¡£ Äú¿ÉÒÔ½¨Á¢Ò»¸ö RPM °ü£¬ÒÔ±ã¶þ½øÖÆ RPM Îļþ°üº¬Äú¶Ô³ÌÐòËù×öµÄÐ޸ģ¬²¢ÇÒÔ´ RPM ²»½ö°üº¬Ô­Ê¼µÄÔ´´úÂ룬 ¶øÇÒ»¹°üº¬ÄúËù×öµÄ¸ü¸ÄÒÔ¼°ÓйØÈçºÎÓ¦Óú͹¹½¨ÕâЩ¸ü¸ÄµÄËùÓÐÏêϸÐÅÏ¢¡£ ÕâЩ²½ÖèÈçÏ£º 1. ¶Ï¶¨¶ÔÔ´´úÂë×öÄÄЩ¸ü¸Ä¾Í¿ÉʹÈí¼þ¹¤×÷¡£ 2. ´´½¨Ò»¸ö²¹¶¡ÎļþÀ´²¶»ñÄúËù×öµÄ¸ü¸Ä¡£ 3. ½«¸Ã²¹¶¡Ìí¼Óµ½ RPM spec Îļþ¡£ µÚ 1 ²½. ¶Ï¶¨Òª¶ÔÔ´´úÂë×öÄÄЩ¸ü¸Ä
[1] [2] [3] [4] ÏÂÒ»Ò³ 

ͨ³££¬Òª×öµÄµÚÒ»¼þÊÂÊÇ£¬ÔÚûÓÐ RPM µÄÇé¿öϱàÒë²¢ÔËÐÐÈí¼þ¡£Ã÷Á˱ØÐëÒª¸ü¸ÄµÄÄÇЩÎļþ¡£ Èç¹ûÓбØÒª£¬¿É´´½¨Ò»Ð©ÐÂÎļþ»ò³ýÈ¥ÓëԭʼԴ´úÂëÒ»Æ𽻸¶µÄһЩÎļþ¡£ ¶ÔÓÚÕâ¸öʾÀý£¬ÎÒ½«´úÂë³éÈ¡µ½Ä¿Â¼ indent-2.2.6-working ÖС£ÎÒÐÞ¸ÄÁË indent.c£¬ ÒÔ±ãÔÚ³ÌÐòÆô¶¯Ê±´òÓ¡Ò»Ìõ±íʾÓѺõÄÏûÏ¢£¬È»ºóÑéÖ¤¸Ã³ÌÐòÊÇ·ñÈÔ¿ÉÒÔ¹¹½¨ÒÔ¼°¸Ã³ÌÐòÊÇ·ñÈÔÄܹ¤×÷¡£ µÚ 2 ²½. ´´½¨²¹¶¡ÎļþÀ´²¶»ñÄúËù×öµÄ¸ü¸Ä ÏÖÔÚ£¬ÄúÏ£Íû´´½¨Ò»¸ö½ö²¶»ñÄúËù×ö¸ü¸ÄµÄ²¹¶¡Îļþ¡£ ÕâÀïÓÐÒ»ÖÖ¿ÉÒÔʵÏÖÕâµÄ·½·¨¡£ËäÈ»ÕâÓеã¶ù·¦Î¶£¬µ«Äܹ»È·±£Äú²¶»ñËùÓиü¸Ä¡£ 1. ½«Èí¼þÍêÈ«³éÈ¡µ½Ò»¸öÐÂĿ¼ÖУ¬È»ºó¸´ÖÆÄúÒѶÔÆä×ö¹ý¸ü¸ÄµÄÎļþ£¬Ê¹Æ串¸Ç¸Õ³éÈ¡³öµÄÄÇЩÎļþ¡£ ÕâÑù£¬ÔÚ±¾À´Ó¦¸ÃÔÚÄúÏÈÇ°¹¹½¨ºÍ²âÊÔÈí¼þʱ´´½¨µÄĿ¼ÖоͲ»»áÓÐÈκζàÓàµÄÎļþ¡£ ÀàËƵأ¬¸´ÖÆÄú´´½¨µÄÈκÎÐÂÎļþ£¬²¢É¾³ýÈκÎÄúÏÈǰɾ³ý¹ýµÄÎļþ¡£ ¶ÔÓÚÕâ¸öʾÀý£¬ÎÒÒÑÍêÈ«³éÈ¡µ½Ä¿Â¼ indent-2.2.6-my£¬²¢¸²¸ÇÎļþ indent.c¡£ 2. ÔÙÒ»´Î½«Èí¼þ³éÈ¡µ½ÁíÒ»¸öĿ¼¡£ÕâÑù¾ÍÌṩÁËÒ»¸öԭʼÈí¼þµÄ¸±±¾À´ÓëÄúµÄÈí¼þ½øÐбȽϡ£¶ÔÓÚÕâ¸öʾÀý£¬ÎÒÊǽ«Èí¼þ³éÈ¡µ½ indent-2.2.6 Ŀ¼¡£ ÏÖÔÚ£¬ÒÑÓÐÈý¸öĿ¼£º indent-2.2.6-working ¹¤×÷Ŀ¼ indent-2.2.6-my ¾­¹ý¸ü¸ÄµÄÈí¼þ£¬ÆäÖк¬ÓÐÎÒËù×öµÄ¸ü¸Ä indent-2.2.6 δ¸ü¸ÄµÄÈí¼þ 3. ´ÓÕâÈý¸öĿ¼µÄ¸¸Ä¿Â¼ÖÐÓÃÀàËÆÓÚÒÔϵÄÃüÁîÉú³É²¹¶¡Îļþ£º diff -uNr indent-2.2.6 indent-2.2.6-my >indent-2.2.6.patch ×¢Ò⣬ʹÓà diff ʱÔËÓÃÁËÑ¡Ïî -uNr¡£-u ÒÔͳһ¸ñʽ´´½¨²¹¶¡Îļþ£¬ÕâÖÖ¸ñʽ±Èȱʡ¸ñʽ¸ü½ô´ÕЩ¡£-N È·±£²¹¶¡Îļþ½«ÕýÈ·µØ´¦ÀíÒѾ­´´½¨»òɾ³ýÎļþµÄÇé¿ö¡£-r ±È½ÏÃüÁîÐÐÉÏËù¸ø³öµÄÁ½¸öĿ¼µÄËùÓÐ×ÓĿ¼ÖеÄËùÓÐÎļþ¡£ ÁíÍ⻹ҪעÒ⣺ֻҪÄúÍêÈ«°´ÉÏÊöÀ´×ö£¬ÕâЩĿ¼ÃûÊÇÎ޹ؽôÒªµÄ¡£ ²¹¶¡ÎļþÖн«ÓÐÕâЩĿ¼Ãû£¬µ«ÎÒÃǽ«Í¨Öª²¹¶¡³ÌÐòºöÂÔËüÃÇ¡£ ÏÖÔÚ£¬¼ì²éһϲ¹¶¡Îļþ indent-2.2.6.patch¡£ÏÂÃæÊÇÎÒµÄʾÀý£º Çåµ¥ 1. indent-2.2.6.patch diff -uNr indent-2.2.6/indent.c indent-2.2.6-my/indent.c --- indent-2.2.6/indent.c Thu Nov 16 22:01:04 2000 +++ indent-2.2.6-my/indent.c Wed Sep 26 14:33:11 2001 @@ -1864,6 +1864,8 @@ int using_stdin = false; enum exit_values exit_status; + printf("Hello from Dan "); + #ifdef _WIN32 /* wildcard eXPansion of commandline arguments, see wildexp.c */ extern void wildexp (int *argc, char ***argv); ÓÐʱºò£¬Äú»á×¢Òâµ½ diff ¼ì²é³öÁËÄúÎÞÒâÒª×öµÄ¸ü¸Ä¡£ Õâʱ£¬Äú¿ÉÄÜÐèÒª»Ø¹ýÈ¥£¬Çå³ýÄúµÄ´úÂë²¢ÔÙ´ÎÉú³É²¹¶¡£¬Ö±µ½»ñµÃÒ»¸ö¸É¾»µÄ¡¢ÁîÄúÂúÒâµÄ²¹¶¡ÎļþΪֹ¡£ Ò»µ©°´ÄúËùÏ£ÍûµÄÄÇÖÖ·½Ê½Íê³É²¹¶¡Ö®ºó£¬×îºÃÌí¼Ó×¢ÊÍÒÔ˵Ã÷ÄúËù×öµÄ¸ü¸Ä¡£ ÔÚ²»Ëðº¦ÈκÎÄÚÈݵÄÇé¿öÏ£¬ÔÚ²¹¶¡ÎļþµÄ¿ªÊ¼´¦»ò½áÊø´¦Ìí¼ÓÎı¾¡£ Çåµ¥ 2. ´ø×¢Ê굀 indent-2.2.6.patch Dan Poirier - 2001-09-26 - added a friendly greeting as indent starts. This is just an example. diff -uNr indent-2.2.6/indent.c indent-2.2.6-my/indent.c --- indent-2.2.6/indent.c Thu Nov 16 22:01:04 2000 +++ indent-2.2.6-my/indent.c Wed Sep 26 14:33:11 2001 @@ -1864,6 +1864,8 @@ int using_stdin = false; enum exit_values exit_status; + printf("Hello from Dan "); + #ifdef _WIN32 /* wildcard expansion of commandline arguments, see wildexp.c */ extern void wildexp (int *argc, char ***argv); µÚ 3 ²½. ½«¸Ã²¹¶¡Ìí¼Óµ½ RPM spec ÎļþÖÐ ÏÖÔÚ£¬¸ÃÈà RPM ʹÓÃÄúµÄ²¹¶¡ÁË¡£½«¸Ã²¹¶¡Îļþ¸´ÖƵ½ÄúµÄ SOURCES Ŀ¼£¨Èç¹ûÄú×ñÑ­ÁËÏÈÇ°µÄ½¨Ò飬Ôò»òÐíÊÇ ~/rpm/SOURCES£©£¬È»ºó¶Ô spec Îļþ×öÏÂÁиü¸Ä£º Çåµ¥ 3. indent-3.spec£ºÊ¹Óà indent-2.2.6.patch Summary: GNU indent Name: indent Version: 2.2.6 Release: 3 Source0: %{name}-%{version}.tar.gz
ÉÏÒ»Ò³ [1] [2] [3] [4] ÏÂÒ»Ò³ 

Patch0: %{name}-2.2.6.patch License: GPL Group: Development/Tools BuildRoot: %{_builddir}/%{name}-root %description The GNU indent program reformats C code to any of a variety of formatting standards, or you can define your own. %prep %setup -q %patch -p1 %build ./configure make %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) /usr/local/bin/indent %doc /usr/local/info/indent.info %doc %attr(0444,root,root) /usr/local/man/man1/indent.1 %doc COPYING AUTHORS README NEWS ÏÖÔÚ£¬Óà rpm -ba indent-3.spec ÃüÁî¹¹½¨ÄúµÄ°ü¡£ Èç¹ûÄúÃÜÇйØ×¢¹¹½¨¹ý³ÌµÄ»°£¬»á¿´µ½ÔÚ¹¹½¨ÆÚ¼ä RPM Ó¦ÓÃÁËÄúµÄ²¹¶¡¡£ %Patch0: %{name}-2.2.6.patch ÕâÒ»ÐиæËß RPM µÚÒ»¸ö²¹¶¡ÎļþÃû¡£ Èç¹ûÓбØÒª£¬¿ÉÒÔÌí¼Ó %Patch1¡¢%Patch2 µÈ¡£ ÔÚ %prep ²¿·ÖÖÐµÄ %patch -p1 ÐÐÊÇÒ»¸ö RPM ºê£¬ Ëü½«ÔÚÄúϵͳµÄ¹¹½¨Ä¿Â¼ÖÐÔËÐв¹¶¡³ÌÐò£¬ÆäÖаѵÚÒ»¸ö²¹¶¡Îļþ×÷ΪÊäÈë¡£ ÐèÒª½« -p1 ´«µÝ¸ø²¹¶¡³ÌÐò£¬¸æËßËü´Ó²¹¶¡ÎļþÖеÄ·¾¶ÖаþÈ¥Ò»²ãĿ¼£¬ÒòΪ¸Ã²¹¶¡Îļþ°üº¬ indent-2.2.6 Ŀ¼Ãû£¬¶ø RPM ½«ÔÚ¸ÃĿ¼ÄÚÔËÐиò¹¶¡Îļþ¡£ ͨ¹ýʾÀýѧϰ ¼ÈÈ»£¬ÄúÀí½âÁËÓйØÈçºÎ¹¹½¨ RPM °üµÄ»ù´¡ÖªÊ¶£¬Ôò¿ÉÒÔͨ¹ýÑо¿Ò»Ð©Ê¾ÀýÀ´Ñ§Ï°¸ü¶àµÄ֪ʶ¡£ ×îºÃµÄÔ´´úÂëʾÀýÖ®Ò»ÊÇÄú×Ô¼ºµÄ Linux ·Ö·¢°æ¡£ÀýÈ磬RedHat ´øÓаüº¬Ô´ RPM °üµÄÕûÕÅ CD¡£ ÒÔÏÂÊÇÈçºÎʹÓÃËüÃÇ¡£ Ô´ RPM °ü°üº¬£º * Ò»¸ö .spec Îļþ * Ò»¸ö»ò¶à¸öÔ´Îļþ * ËùÓÐʹÓùýµÄ²¹¶¡Îļþ Óë°²×°¶þ½øÖÆ RPM °üÀàËÆ£¬¿ÉÒÔʹÓà rpm -i filename.rpm °²×°Ô´ RPM °ü¡£ °²×°ÍêÖ®ºó£¬.spec Îļþ½«ÔÚÄúµÄ %_specdir Ŀ¼ÖУ¬Ô´ÎļþºÍ²¹¶¡Îļþ½«ÔÚÄúµÄ %_sourcedir Ŀ¼ÖС£ Èç¹û´´½¨ÁËÉÏÃæÃèÊöµÄ .rpmmacros Îļþ£¬ÄÇôÕâЩĿ¼Ϊ ~/rpm/SPECS ºÍ ~/rpm/SOURCES¡£ ÏÖÔÚ£¬¿ÉÒÔ¶ÁÈ¡ Red Hat ×Ô¼º·Ö·¢µÄÕâЩ°üµÄ .spec Îļþ¡£ ¿ÉÒÔ³¢ÊÔÓà rpm -ba foo.spec ¹¹½¨ÕâЩ .spec Îļþ£¬²¢¹Û²ìËù·¢ÉúµÄÊÂÇ飬ÒÔ¼°°ÚŪ spec ÎļþÒÔ³¢ÊÔһЩеÄÊÂÎï¡£ ¶ÔÓÚ GNU indent ³ÌÐò£¬Ò»¸öºÃµÄ·½·¨ÊÇ´Ó Red Hat µÄÔ´ RPM °ü¿ªÊ¼¡£¿´Ò»ÏÂÄúÊÇ·ñ¿ÉÒÔÏë³öΪʲôËüÃÇµÄ .spec Îļþ²»Í¬ÓÚ±¾ÎÄÖÐµÄ .spec Îļþ¡£ ¶þ½øÖÆ RPM °üµÄ¿ÉÒÆÖ²ÐÔ ²»ÐÒµÄÊÇ£¬¶þ½øÖÆ RPM °üÔÚ¿ÉÒÆÖ²ÐÔ·½Ãæ²»ÊǺܺ᣶àÊýÇé¿öÏ£¬¹¹½¨ÔÚij¸ö Linux ·Ö·¢°æÉ쵀 RPM ²»ÄÜÓ¦Óõ½ÁíÒ»¸ö Linux ·Ö·¢°æ¡£ ¸ü²»ÒªËµÓ¦Óõ½Í¬Ò»¸ö·Ö·¢°æµÄÁíÒ»¸ö°æ±¾ÉÏ£¡ Ô­ÒòÓкܶ࣬°üÀ¨»ù±¾Äں˰汾¡¢¿â°æ±¾ºÍĿ¼½á¹¹·½ÃæµÄ²îÒì¡£ ÕâºÜ²»ÐÒ£¬µ«Ïó Linux Standard Base£¨Çë²ÎÔIJο¼×ÊÁÏ£©ÕâÑùµÄ×éÖ¯ÕýÔÚ³¢ÊÔ´ïµ½·Ö·¢°æÖ®¼äµÄÒ»Ö£¬ ÒÔ½â¾öÄÑÒÔÒÆÖ²µÄÎÊÌâ¡£Ò²ÐíÓÐÒ»Ì죬¹¹½¨ÔÚÒ»¸öÖ÷Á÷ Linux ·Ö·¢°æÉϵÄÈκΠRPM ¶¼¿ÉÒÔ°²×°ºÍÔËÐÐÔÚÏàͬµÄ´¦ÀíÆ÷Ö®ÉϵÄÈκΠÆäËüÖ÷Á÷ Linux ·Ö·¢°æÉÏ¡£ ÖÁÓÚÏÖÔÚ£¬ÄúÓ¦¸Ã×öºÃ¼Æ»®£¬ÓжàÉÙ¸ö RPM ½«ÒªÔÚÆäÉÏÔËÐеķַ¢°æ£¬¾Í¿ÉÄܹ¹½¨ÓжàÉÙ¸ö RPM£¬»òÕßÑ°ÕÒÖ¾Ô¸ÕßÀ´ÎªÄúÍê³ÉÕâ¼þÊ¡£ ·Ö·¢ÄúµÄ¹¤×÷½á¹û£ºtar ÎļþºÍÔ´ RPM °ü ΪÁËʹÆäËûÈËÔÚ¾¡¿ÉÄܶàµÄ·Ö·¢°æÉϹ¹½¨ÄúµÄÈí¼þ£¬¾ÍҪʹ .spec ÎļþºÍ²¹¶¡Îļþ³ÉΪ¿ÉÓõÄÎļþ¡£ Èç¹ûÓбØÒª£¬×îºÃµÄ·½·¨ÊÇÖ±½Ó¸ü¸ÄÈí¼þ£¬ËùÒԸ÷½·¨½«ÔÚ Linux ÉϽøÐй¹½¨£¬²¢½« .spec Îļþ°üº¬ÔÚ·Ö·¢°æÖС£ Èç¹û .spec ÎļþÔÚ´øÓÐÔ´ÂëµÄ tar ѹËõ°ü£¨.tar.gz Îļþ£©ÖУ¬ÄÇôÓû§Ö»ÐèÔËÐУº rpm -tb foo.tar.gz ²¢¹¹½¨¸Ã°üµÄ¶þ½øÖÆ RPM ¡ª ÉõÖÁÎÞÐè½âѹ¸Ã tar Îļþ! Èç¹ûÎÞ·¨Ê¹ .spec Îļþ°üº¬ÔÚÈí¼þÖУ¬Ôò¿ÉÒÔ·Ö·¢Ò»¸öÔ´ RPM °ü¡£ ÓÐÁËÕ⣬Óû§¾Í¿ÉÒÔÔËÐУº rpm --rebuild foo.src.rpm ²¢ÔÚËûÃǵÄϵͳÉϹ¹½¨¶þ½øÖÆ RPM¡£ ²Î¿¼×ÊÁÏ * ±¾ÏµÁеÄÏÈÇ°ÎÄÕ½éÉÜÁËÓà RPM ¹¹½¨Èí¼þ°üµÄ¹ý³Ì¡£ * ±¾ÎÄÖÐÃèÊöµÄÎļþÔ´´úÂ룺 o indent-2.2.6.patch o ´ø×¢Ê굀 indent-2.2.6.patch o indent-3.spec * RPM ÍøÕ¾ÉÏÓÐÖ¸ÏòÐí¶àÓÐÓÃ×ÊÔ´µÄÁ´½Ó¡£RPM µç×ÓÓʼþÁбíÊÇÌáÎÊÌâµÄºÃµØ·½¡£
ÉÏÒ»Ò³ [1] [2] [3] [4] ÏÂÒ»Ò³ 

* Maximum RPM ÊÇÒ»±¾¹ØÓÚʹÓà RPM µÄÊé¡£ËüÏ൱¹ýʱÁË£¬µ«ÏÖÔÚÕý´¦ÔÚ¸üÐÂÖС£ * RPM HOWTO Ò²Õý±äµÃÓÐЩ¹ýʱÁË¡£Ëü½²ÊöÁËһЩºÍ±¾ÎÄÒ»ÑùµÄ֪ʶ·¶Î§¡£ * Eric S. Raymond µÄ Software Release Practice HOWTO Îĵµ²¢²»ÊÇרÃÅÕë¶Ô RPM »ò Linux¡£µ«ËüÔÚÈçºÎ·¢²¼Èí¼þÒÔ·½±ãÓû§Ê¹Óúͷ½±ã³ÌÐòÔ±Ìṩ²¹¶¡ºÍÍêÉÆ·½Ã棬ÓкܶàºÃµÄ¼¼ÇÉ¡£ * ÇëÔĶÁ Linux Standard Base£¨LSB£©£¬ËüµÄÄ¿µÄÊÇÒª¡°¿ª·¢ºÍÌᳫһ×é±ê×¼£¬ ÒÔÔö¼Ó Linux ·Ö·¢°æÖ®¼äµÄ¼æÈÝÐÔ²¢Ê¹Èí¼þÓ¦ÓóÌÐòÄܹ»ÔËÐÐÔÚÈκμæÈÝµÄ Linux ϵͳÉÏ¡£¡± * ×ÔÓÉÈí¼þ»ù½ð»á£¨The Free Software Foundation£©ÊÇÒ»¸öÌṩ GNU Indent ºÍÐí¶àÆäËüÓÐÓÃÈí¼þ°üµÄ×éÖ¯¡£ * Çë»ñÈ¡ IBM Developer Kit for Linux on Itanium¡¢IBM Developer Kit for Linux£¬Java 2 °æ£¬°æ±¾ 1.3 »òÕß IBM Software Evaluation Kit for Linux¡£ * ÇëÔÚ developerWorks ÉÏä¯ÀÀ¸ü¶à Linux ²Î¿¼×ÊÁÏ¡£ * ÇëÔÚ developerWorks ÉÏä¯ÀÀ¸ü¶à¿ª·ÅÔ´Âë²Î¿¼×ÊÁÏ¡£ ¹ØÓÚ×÷Õß Dan Poirier ÊÇ IBM µÄ¹ËÎÊÈí¼þ¹¤³Ìʦ¡£ËûÄ¿Ç°ÔÚÃÀ¹ú±±¿¨ÂÞÀ³ÄÉÖÝµÄ Research Triangle Park ¹¤×÷£¬´ÓÊÂÔËÐÐ Linux µÄÍøÂçÉ豸µÄÑо¿¡£¿ÉÒÔͨ¹ý [email protected] ÓëËûÁªÏµ À´×Ô£ºwww-900.ibm.com

£¨³ö´¦£ºhttp://www.sheup.com£©


ÉÏÒ»Ò³ [1] [2] [3] [4] 

£¨³ö´¦£ºhttp://www.sheup.com£©


ÉÏÒ»Ò³ [1] [2] [3] [4] [5] 

£¨³ö´¦£ºhttp://www.sheup.com/£©


ÉÏÒ»Ò³ [1] [2] [3] [4] [5] [6]