¡¡¡¡SRPM ÐèÒªµÄÌ×¼þ£º ¡¡¡¡ÔÚÉÏÒ»½Úµ±ÖУ¬ÎÒÃǽéÉÜÁË RPM Õâ¸ö¼È¿É°®Óֿɺ޵ļһRPM µÄ¿É°®ÔÚÓÚËûµÄ×ÊÁÏ¿â¹ÜÀí·½Ê½£¬ºÜÈÝÒ×È¥²éѯÓëÉý¼¶£¬¶øËûµÄ¿ÉºÞÄØ£¿ºÇºÇ£¡¾ÍÊÇÔÚÓÚËûµÄ binary µÄµµ°¸²»ÄÜÔٸıäËûµÄÔʼÉ趨ÄÚÈÝ ( ¾ÍÊÇ *.rpm µÄµµ°¸²»ÄÜÔÙÖØбàÒëµÄÒâ˼ )£¬ÓëÌ×¼þ¼°Ì×¼þÖ®¼äµÄÊôÐÔÏàÒÀµÄÎÊÌâ¡«»¹ÕæÊÇÉËÄÔ½î…È£¡¡¡¡¡Ã»ÓйØϵ£¬ÏÖÔÚÓнâ¾öµÄ·½·¨ÁË£¡ÎÒÃÇ¿ÉÒÔÀûÓẺ¬ÓÐ source code µÄ SRPM ¡»À´ÖØбàÒë *.rpm µÄµµ°¸³ÉΪÎÒÃÇËùÏ£ÍûµÄÑùʽÁË£¡¾ÍÒòΪÔÚ SRPM ÀïÃ溬ÓеIJ»ÊÇ binary µÄµµ°¸£¬¶øÊǺ¬ÓÐ source code £¬Òò´Ë SRPM ÊDz»ÄÜÖ±½ÓÄÃÀ´°²×°³ÉΪ¿ÉÖ´Ðеĵµ°¸µÄ¡£±ØÐèÒª½«ËûÖØбàÒ룬²¢ÇÒ´ò°ü³ÉΪÀàËÆ i386, i586, i686 µÈµÈ RPM µÄµµ°¸Ö®ºó£¬²ÅÄܹ»°²×°ÔÚÎÒÃǵÄϵͳµ±ÖÐÁ¨£¡Õâ¸öʱºòÄã¾ÍÓ¦¸Ã»áÏëÏóÀ²£¬ß×£¡¼ÈÈ»Èç´ËµÄ»°£¬ÄÇôÔÚ±àÒëµÄ¹ý³Ìµ±ÖУ¬ÎÒÃÇÊÇ·ñ¿ÉÒÔ¼ÓÈëÆäËûµÄÉ趨²ÎÊý£¬À´ÈÃÎÒÃÇµÄ SRPM ¿ÉÒÔÒÀÕÕÎÒµÄÏë·¨À´±àÒëÄØ£¡£¿¹þ¹þ£¡´ð¶ÔÁË£¡ËùÒÔÄØ£¬Õâ¸öʱºòÎÒÃǾÍÒªÀ´Ð޸ıðÈ赀 SRPM ÒÔ¼°±àÒë×Ô¼ºµÄÌ×¼þÀ²£¡¡¡¡¡²»¹ýÕâÀïÐèÒªÌرðÁôÒâµÄ¾ÍÊÇ£¬ÒòΪ SRPM ÐèÒªÖØбàÒ룬¶ø±àÒëµÄ¹ý³Ìµ±ÖУ¬ÎÒÃÇÖÁÉÙÐèÒªÓÐ make ÓëÆäÏà¹ØµÄ³Ìʽ£¬¼° gcc, c, c++ µÈÆäËûµÄ±àÒëÓõijÌʽÓïÑÔÀ´½øÐбàÒ룬ËùÒÔ£¬Èç¹ûÄúÔÚ°²×°µÄ¹ý³Ìµ±ÖÐûÓÐÑ¡È¡ÈíÌ忪·¢¹¤¾ßÖ®ÀàµÄÌ×¼þ£¬ºÇºÇ£¡µÃÖØÐÂÄóöÄãµÄ¹âµú£¬È»ºóÔÙ°²×°à¸£¡¹þ¹þ£¡Ö»ÊǵÃÒª¿Ë·þÒ»´ó¶ÑµÄÊôÐÔÏàÒÀµÄÎÊÌâ¾ÍÊÇÁË¡«àÅ£¡»¹Êǽ¨ÒéÄúÔٴεĿ´Ò»ÏÂÈçºÎ°²Ñb°É£¡¡¡¡¡SRPM ʹÓõ½µÄĿ¼£º ¡¡¡¡SRPM ¼ÈÈ»º¬ÓÐ source code £¬ÄÇôÆäÖбض¨ÓÐÉ趨µµ†ª£¬ËùÒÔÊ×ÏÈÎÒÃDZØÐèÒªÖªµÀ£¬Õâ¸ö SRPM ÔÚ½øÐбàÒëµÄʱºò£¬»áʹÓõ½ÄÄЩĿ¼ÄØ£¿ÕâÑùÒ»À´²ÅÄܹ»À´ÐÞ¸ÄÂÄã¿ÉÒÔµ½ÄãµÄ /usr/src Õâ¸öĿ¼ÀïÃæÈ¥²é¿´Ò»Ï£¬Í¨³£Ã¿¸ö distribution ÌṩµÄĿ¼¶¼²»Ì«Ïàͬ£¬ÒÔ Mandrake 9.0 ΪÀý£¬ËûÊÇÒÔ /usr/src/RPM Ϊ¹¤×÷Ŀ¼£¬ Red Hat ÊÇÒÔ /usr/src/redhat Ϊ¹¤×÷Ŀ¼£¬ OpenLinux ÔòÊÇÒÔ /usr/src/openlinux Ϊ¹¤×÷Ŀ¼£¡ÎÞÂÛÈçºÎ£¬·´Õý¾ÍÊÇÔÚ /usr/src Õâ¸öĿ¼Ï¾ͶÔÁË£¡ºÃÁ˵½ /usr/src/redhat ÀïÍ·È¥¿´Ò»¿´ßÏ£º ¡¡¡¡¡¤ /usr/src/redhat/SPEC£ºÕâ¸öĿ¼µ±ÖзÅÖõÄÊǸÃÌ×¼þµÄÉ趨µµ£¬ÀýÈçÕâ¸öÌ×¼þµÄ×ÊѶ²ÎÊý¡¢É趨ÏîÄ¿µÈµÈ¶¼·ÅÖÃÔÚÕâÀ ¡¡¡¡¡¤ /usr/src/redhat/SOURCE£ºÕâ¸öĿ¼µ±ÖзÅÖõÄÊǸÃÌ×¼þµÄÔʼµµ£¨*.tar.gzµÄµµ°¸£©ÒÔ¼° config Õâ¸öÉ趨µµ£» ¡¡¡¡¡¤ /usr/src/redhat/BUILD£ºÔÚ±àÒëµÄ¹ý³ÌÖУ¬ÓÐЩÔÝ´æµÄ×ÊÁ϶¼»á·ÅÖÃÔÚÕâ¸öĿ¼µ±ÖУ» ¡¡¡¡¡¤ /usr/src/redhat/RPMS£º¾¹ý±àÒëÖ®ºó£¬²¢ÇÒ˳ÀûµÄ±àÒë³É¹¦Ö®ºó£¬½«´ò°üÍê³ÉµÄµµ°¸·ÅÖÃÔÚÕâ¸öĿ¼µ±ÖС£ÀïÍ·Óаüº¬ÁË i386, i586, i686, noarch.... µÈµÈµÄ´ÎĿ¼¡£ ¡¡¡¡´ËÍ⣬ÔÚ±àÒëµÄ¹ý³Ìµ±ÖУ¬¿ÉÄܻᷢÉú²»Ã÷µÄ´íÎ󣬻òÕßÊÇÉ趨µÄ´íÎó£¬Õâ¸öʱºò¾Í»áÔÚ /tmp µ×ϲúÉúÒ»¸öÏà¶ÔÓ¦µÄ´íÎóµµ£¬Äú¿ÉÒÔ¸ù¾Ý¸Ã´íÎóµµ½øÐгý´íµÄ¹¤×÷ÄØ£¡µÈµ½ËùÓеÄÎÊÌⶼ½â¾öÖ®ºó£¬Ò²±àÒë³É¹¦ÁË£¬ÄÇô¸Õ¸Õ½âѹËõÖ®ºóµÄµµ°¸£¬¾ÍÊÇÔÚ /usr/src/redhat/SPEC, SOURCE, BUILD µÈµÈµÄµµ°¸¶¼»á±»É±µô£¬¶øֻʣÏ·ÅÖÃÔÚ /usr/src/redhat/RPMS µ×ϵĵµ°¸ÁË£¡¡¡¡¡É趨µµµÄÖ÷ÒªÄÚÈÝ£º ¡¡¡¡¸Õ¸ÕÎÒÃÇÔÚÉÏÃæÌá¹ýÁË£¬SRPM»¹¿ÉÒÔ¸ü¸ÄһЩÉ趨µÄÄÚÈÝ£¬ÄÇôҪÈçºÎÐÞ¸ÄÕâЩÉ趨µÄÄÚÈÝÄØ£¿ÎÒÃÇÒÔ¼òµ¥µÄ rp-pppoe Õâ¸öÌ×¼þÀ´ËµÃ÷ºÃÁË£¬Äã¿ÉÒÔÁ¬ÉÏ Internet ÉÏÃæµÄ rp-pppoe ¹Ù·½ÍøÕ¾ÏÂÔØ SRPM £¬»òÕßÓÉÒÔϵķ½Ê½À´ÏÂÔØÕâ¸öÌ×¼þ(Çë×¢Òâµ×ϵĵµ°¸ÊÇ 2002/11 ×îеĵµ°¸×ÊÁÏ£¬ÓпÉÄÜÔÚÄú¿´µ½±¾ÎÄʱ£¬Õâ¸öÌ×¼þÒѾ¸üÐÂÁË£¬ËùÒÔÇëÖ±½ÓÉϵ×ϵÄÍøÖ·À´ÏÂÔØ°É£¡http://www.roaringpenguin.com/pppoe/)¡£ÖÁÓÚ»ù±¾µÄ¹ý³ÌÈçÏ£º ¡¡¡¡1. ÏÂÔØ SRPM ÈíÌ壺 [root @test root]# wget http://www.roaringpenguin.com/pppoe/rp-pppoe-3.5-1.src.rpm 2. ½« SRPM ½â¿ªÔÚ/usr/src/redhat µ×ϵÄĿ¼µ±ÖÐ [root @test root]# rpm ¨Ci rp-pppoe-3.5-1.src.rpm 3. ¹Û²ìÒ»ÏÂÓÐÄÄЩÔʼÂëÄØ£¿ [root @test root]# cd /usr/src/redhat/SOURCES [root @test SOURCE]# ls ¨Cl -rw-rw-r-- 1 root root 189321 Jul 8 22:38 rp-pppoe-3.5.tar.gz ºÇºÇ£¡ÉÏÃæÏÔʾÎÒÃǵÄÔʼÂë¾ÍÊÇÕâ¸öµµ°¸À²£¡¡¡¡¡ºÃÁË£¬À´¿´¿´ÎÒÃǵÄÉ趨²ÎÊýµµ£¬Ò༴ÊÇÔÚ /usr/src/redhat/SPECS ÄÚµÄ *.spec µµ°¸†ª£¡ ¡¡¡¡¹Û²ìÒ»ÏÂÔ¤ÉèµÄÉ趨µµ°¸ÄÚÈÝ£º [root @test root]# cd /usr/src/redhat/SPECS [root @test SPECS]# vi rp-pppoe.spec û´í£¡Õâ¸ö¾ÍÊÇSRPMµÄÔ¤ÉèÉ趨ÄÚÈݵµ°¸†ª£¬½øÈ¥ÐÞ¸Äһϣ¬ÀïÃæµÄ×ÊÁÏÓеãÏñÕâÑù£º Summary: PPP Over Ethernet (xDSL support) Name: rp-pppoe Version: 3.5 %if %(%{eXPand:test %{_vendor} != mandrake ; echo $?}) Release: 1mdk %else Release: 1 %endif Copyright: GPL Group: System Environment/Daemons Source: http://www.roaringpenguin.com/pppoe/rp-pppoe-3.5.tar.gz Url: http://www.roaringpenguin.com/pppoe/ Packager: David F. Skoll BuildRoot: /tmp/pppoe-build Vendor: Roaring Penguin Software Inc. Requires: ppp >= 2.3.7 # LIC: GPL %description PPPoE (Point-to-Point Protocol over Ethernet) is a protocol used by many ADSL Internet Service Providers. Roaring Penguin has a free client for Linux systems to connect to PPPoE service providers. The client is a user-mode program and does not require any kernel modifications. It is fully compliant with RFC 2516, the official PPPoE specification. %prep %setup cd src ./configure --mandir=%{_mandir} %build cd src make cd ../gui make %install cd src make install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT cd ../gui make install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc doc/CHANGES doc/HOW-TO-CONNECT doc/LICENSE doc/KERNEL-MODE-PPPOE README SERVPOET %config(noreplace) /etc/ppp/pppoe.conf ×¢£ºÖм仹Óкܶà×ÊѶ£¬±»ÎÒÊ¡ÂÔµôÁË£¡ÖªµÀÁ˾ͺÃร¡ %changelog * Thu Jul 21 2001 Shigechika AIKAWA - merged rp-pppeo.spec and rp-pppoe-gui.spec¡¡¡¡×¢Òâµ½µÄÊÇrp-pppoe.sepcÕâ¸öµµ°¸£¬ÕâÊÇÖ÷ÒªµÄ½«SRPM±àÒë³ÉRPMµÄÉ趨µµ£¬ËûµÄ»ù±¾¹æÔò¿ÉÒÔÕâÑù¿´£º ¡¡¡¡1.Õû¸öµµ°¸µÄ¿ªÍ·ÒÔSummaryΪ¿ªÊ¼£¬Õⲿ·ÝµÄÉ趨¶¼ÊÇ×î»ù´¡µÄ˵Ã÷ÄÚÈÝ£» ¡¡¡¡2.È»ºóÿ¸ö²»Í¬µÄ¶ÎÂäÖ®¼ä£¬¶¼ÒÔ%À´×öΪ¿ªÍ·£¬ÀýÈç%prepÓë%installµÈ£» ¡¡¡¡ÎÒÃÇÀ´Ì¸Ò»Ì¸¼¸¸ö³£¼ûµÄSRPMÉ趨¶ÎÂ䣺 ¡¡¡¡¡¤ÏµÍ³ÕûÌå×ÊѶ·½Ã棺 ¡¡¡¡oSummary£ºÖ÷ÒªµÄÌ×¼þ˵Ã÷£¬ÀýÈçÉϱíÖУ¬ÎÒÃÇ˵Ã÷ÁËËûÊÇpppµÄ²¦½ÓÓÃ;À²£¡ ¡¡¡¡oName£ºÕâ¸ö¾ÍÊÇÌ×¼þµÄÃû³Æ£» ¡¡¡¡oVersion£ºÕâ¸öÊÇÌ×¼þµÄ°æ±¾×ÊѶ£» ¡¡¡¡oRelease£ºÕâ¸öÊǸð汾´ò°üµÄ´ÎÊý˵Ã÷£¬ÔÚMandrakeÀïÃ棬»á×Ô¶¯µÄ°ïÄãÉ趨´ò°üµÄ´ÎÊýร¡¾ÍÊÇ1mdkÄǸößËßË£» ¡¡¡¡oCopyright£ºÕâ¸öÌ×¼þµÄÊÚȨģʽ£¬ÎÒÃÇÊÇʹÓÃGPLÀ²£¡ ¡¡¡¡oGroup£ºÕâ¸öÌ×¼þµÄ·¢Õ¹ÍÅÌåÃû³Æ£» ¡¡¡¡oSource£ºÕâ¸öÌ×¼þµÄÀ´Ô´£¬Èç¹ûÊÇÍø·ÉÏÏÂÔصÄÌ×¼þ£¬Í¨³£Ò»¶¨»áÓÐÕâ¸ö×ÊѶÀ´¸æËß´ó¼ÒÕâ¸öÔʼµµµÄÀ´Ô´£¡ ¡¡¡¡oUrl£ºÕâ¸öÔʼÂëµÄÖ÷Òª¹Ù·½ÍøÕ¾£» Packager£ºÕâ¸öÌ×¼þÊǾÓÉËÀ´´ò°üµÄÄØ£¿ ¡¡¡¡oVender£º·¢Õ¹µÄ³§ÉÌÄÄ£» ¡¡¡¡oExclusiveArch£ºÕâ¸öÊÇ˵Ã÷Õâ¸öÌ×¼þµÄÊʺϰ²×°µÄÓ²Ì壬ͨ³£Ô¤ÉèΪi386£¬µ±È»£¬ÄãÒ²¿ÉÒÔµ÷ÕûΪi586À²µÈµÈµÄ£¡ ¡¡¡¡oRequires£ºÈç¹ûÄãÕâ¸öÌ×¼þ»¹ÐèÒªÆäËûµÄÌ×¼þµÄÖ§Ô®£¬ÄÇôÕâÀï¾Í±ØÐèдÉÏÀ´£¬Ôòµ±ÄãÖÆ×÷³ÉRPMÖ®ºó£¬ÏµÍ³¾Í»á×Ô¶¯µÄÈ¥¼ì²éÀ²£¡Õâ¾ÍÊÇ¡ºÏàÒÀÊôÐÔ¡»µÄÖ÷ÒªÀ´Ô´†ª£¡ ¡¡¡¡ÉÏÃ漸¸ö×ÊÁÏͨ³£¶¼±ØÐèҪдÀ²£¡µ«ÊÇÈç¹ûÄãµÄÈíÌåûÓÐÏàÒÀÊôÐԵĹØϵʱ£¬ÄÇô¾Í¿ÉÒÔ²»ÐèÒªÄǸöRequires†ª£¡ ¡¡¡¡¡¤%description ¡¡¡¡½«ÄúµÄÌ×¼þ×öÒ»¸ö¼ò¶ÌµÄ˵Ã÷£¡Õâ¸öÒ²ÊDZØÐèÒªµÄ¡£¡¡¡¡¡¤%prep ¡¡¡¡Õⲿ·ÝµÄÉ趨ÔÚÓÚ¡ºÉÐδ½øÐÐÉ趨»ò°²×°Ö®Ç°£¬ÄãÒª±àÒëÍê³ÉµÄRPM°ïÄãÊÂÏÈ×öµÄÊÂÇé¡»£¬¾ÍÊÇprepareµÄ¼òд†ª£¡ÄÇôËûµÄ¹¤×÷ÊÂÏîÖ÷ÒªÓУº ¡¡¡¡1.Ñ°ÕÒÌ×¼þËùÐèÒªµÄĿ¼ÊÇ·ñÒѾ´æÔÚ£¿È·ÈÏÓõģ¡ ¡¡¡¡2.ÊÂÏȽ¨Á¢ÄúµÄÌ×¼þËùÐèÒªµÄĿ¼£¬»òÕßÊÂÏÈÐèÒª½øÐеÄÈÎÎñ£» ¡¡¡¡3.Èç¹û´ý°²×°µÄLinuxϵͳÄÚÒѾÓа²×°µÄʱºò¿ÉÄܻᱻ¸²¸ÇµôµÄµµ°¸Ê±£¬ÄÇô¾Í±ØÐèÒª½øÐб¸·Ý(backup)µÄ¹¤×÷ÁË£¡ ¡¡¡¡´óֵŤ×÷¾ÍÊÇÕâЩÀ²£¡¡¡¡¡¡¤%setup ¡¡¡¡Õâ¸ö¶ÎÂä¾ÍÊÇÔÚ½¨Á¢ÎÒÃÇÔÚTarballµ±ÖÐ˵Ã÷µÄÄǸöMakefileµµ°¸À²£¡ËùÒÔÄØ£¬µ±È»¾ÍÊÇÖ´ÐÐ./configÖ®ÀàµÄÉ趨µµ°¸†ª£¡ÄÇôÈç¹ûÄãÒª×Ô¼ºÐÂÔö×Ô¼ºµÄ²ÎÊý£¬¾Í¿ÉÒÔÔÚÕâ¸öµØ·½¼ÓÈëÄãµÄÉ趨ֵ£¡Èç¹ûÄãµÄÈíÌå±¾ÉíûÓÐÕâ·½ÃæµÄÐèÒª£¬ÀïÃæ¾Í²»ÐèÒª±àдÄÚÈ݆ª£¡¡¡¡¡¡¤%build ¡¡¡¡build¾ÍÊǽ¨Á¢°¡£¡ËùÒÔµ±È»†ª£¬Õâ¸ö¶ÎÂä¾ÍÊÇÔÚ̸Ôõômake±àÒë³ÉΪ¿ÉÖ´ÐеijÌʽ†ª£¡¡¡¡¡¡¤%install ¡¡¡¡±àÒëÍê³É(build)Ö®ºó£¬¾ÍÊÇÒª°²×°À²£¡°²×°¾ÍÊÇдÔÚÕâÀҲ¾ÍÊÇÀàËÆTarballÀïÃæµÄmake installµÄÒâ˼†ª£¡¡¡¡¡¡¤%files ¡¡¡¡Õâ¸öÌ×¼þ°²×°µÄµµ°¸¶¼ÐèҪдµ½ÕâÀïÀ´£¬µ±È»°üÀ¨ÁË¡ºÄ¿Â¼¡»à¸£¡ËùÒÔÁ¬Í¬Ä¿Â¼ÇëÒ»Æðдµ½Õâ¸ö¶ÎÂäµ±ÖУ¡ÒÔ±¸²éÑéÄØ£¡^_^¡¡¡¡¡¤%changelog ¡¡¡¡Õâ¸öÖ÷ÒªÔòÊÇÔڼǼÕâ¸öÌ×¼þÔø¾µÄ¸üмͼ†ª£¡¡¡¡¡ºÃÁË£¬ÄÇôÈç¹ûÄúÓÐ×Ô¶©µÄ×ÊѶÏëÒª¼ÓÈëµÄ»°£¬¾ÍÑ¡ÔñÄãÒª¼ÓÈëµÄÄǸö¶ÎÂ䣬½«ËûÐÞ¸Äһϰɣ¡ÀýÈ磬Èç¹ûÄãÔÚÉ趨MakefileµÄʱºò£¬Ï£ÍûÄܹ»¶àһЩ¶îÍâµÄ²ÎÊýÉ趨£¬ÄÇô¾ÍÕÒµ½ %setup ÄǸö¶ÎÂ䣬½«ËûÐ޸ijÉÄúËùÐèÒªµÄÑù×Ó£¬¾Í¿ÉÒÔ†ª£¡¡¡¡¡SRPM µÄ±àÒëÖ¸Á ¡¡¡¡ÔÙÀ´ÄØ£¿àÅ£¡Ã»´í£¬ÐÞ¸ÄÍê³ÉÁË£¬×ÔÈ»¾ÍÊÇÒª½«Ëû±àÒë³É¿ÉÒÔ°²×°µÄRPMµµ°¸À²£¡Õâ¸öʱºòÎÒÃǾͿÉÒÔÖ±½ÓÔÚ/usr/src/redhat/SPECSµ×ÏÂÏ´ ¡¡¡¡[root @test SPECS]# rpm -bb rp-pppoe.spec
£¨³ö´¦£ºhttp://www.sheup.com£©
ÉÏÒ»Ò³ [1] [2]