ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÔÚDebianÖдòÔìÊôÓÚ×Ô¼ºµÄdeb°ü

·¢²¼Ê±¼ä:2005-09-03 10:07:10À´Ô´:ºìÁª×÷Õß:»ð
ÎÊÌ⣺Èç¹ûÄãÒªÔÚDebianϵͳÖз¢²¼Ò»¿îÈí¼þ»òÕßÒ»¸ö°ü£¬¸ÃÈçºÎ×öÄØ£¿Èç¹ûÄãµÄÏîÄ¿ÖÐÓи÷ÖÖ¶þ½øÖÆ°ü£¬¸ÃÈçºÎά»¤ÄØ£¿Èç¹ûÄã×Ô¼º×öÁËÒ»¿îССµÄʵÓÃÈí¼þ£¬¸ÃÈçºÎÓëÅóÓÑ·ÖÏíÄØ£¿¡­¡­.



°¸Àý£º¼ÙÈçÎÒ´ÓÍøÉÏÏÂÔØÁËeclipse-SDK-3.1-linux-gtk.tar.gzѹËõÎļþ£¬ÎÒÏë°ÑËû°²×°µ½/opt/eclipseĿ¼Ï£¬ÇҲ˵¥Apps-->ProgrammingÖÐÓÐEclipse²Ëµ¥Ïî¡£²¢ÇÒÔÚÃüÁîÖÕ¶ËÖÐÊäÈëeclipseÖпÉÒÔÔËÐÐEclipse³ÌÐò£¬¶øÇÒ»¹ÒªÏóÆäËûµÄÈí¼þ°üÒ»Ñù£¬¿ÉÒÔ·½±ãµÄ½øÐа²×°£¨install £©ºÍжÔØ£¨remove£©¡£



Èç¹ûÄ㻹²»ÖªµÀÈçºÎ×ö£¬Çë¸úÎÒÀ´£¬ÎÒ½«¸æËßÄã½â¾ö·½°¸¡£



ÊìϤDebian£¨LinuxµÄ·¢ÐаæÖ®Ò»£©µÄÓû§£¬Ó¦¸Ã¶ÔËûµÄ°ü¹ÜÀí»úÖƼÇÒäÓÌС£±ã½ÝµÄ°ü¹ÜÀí»úÖÆÊÇDebianÒ×ÓõÄÒ»¸öÖ÷ÒªÌØÐÔ¡£Debian°ü¹ÜÀí»úÖÆ¿É·ÖΪÁ½¸ö²ãÃ棺¶ÔÈí¼þ°üÎļþ²Ù×÷ÒÔ¼°¶Ô°üÖÐÎļþµÄ²Ù×÷¡£aptºÍdselectÍê³ÉÇ°Õߣ¬dpkgÍê³ÉºóÕß¡£



½ÓÏÂÀ´£¬ÎÒÃǽ«½èÖúDebianµÄ°ü¹ÜÀí»úÖÆ£¬´òÔìÊôÓÚ×Ô¼ºµÄdeb°ü¡£



Ê×ÏÈ£¬½éÉÜÆäĿ¼½á¹¹(ΪÁ˱ãÓÚÀí½â£¬½èÓÃWindowsϵĽØͼ)

eclipse

|----DEBIAN

|-------control

|-------md5sums

|-------postinst

|-------postrm

|----usr

|-----bin

|------eclipse

|-----lib

|-------menus

|-----eclipse


ͼһ Ŀ¼½á¹¹



ÆäÖУ¬eclipseÎļþ¼Ð±íʾ´ý·¢²¼µÄÈí¼þ,Ò²ÊÇÎÒÃǵŤ×÷Ŀ¼¡£ DEBIANÎļþ¼ÐÏ°üº¬controlºÍmd5sumsµÈÎı¾Îļþ¡£optĿ¼±íʾ´ý·¢²¼µÄ°ü½«Òª°²×°£¨·ÅÖ㩵ĵط½¡£usr/bin/Ŀ¼ÌṩÁËÔËÐиóÌÐòÃüÁîµÄ½Å±¾¡£usr/lib/menuĿ¼ÌṩÁ˽«Eclipse¼ÓÈë²Ëµ¥µÄ½Å±¾¡£

DEBIAN±ØÐë´óд£¬ÇÒ±ØÐëΪ¸ÃÃû¡£¸ù¾Ý²»Í¬µÄÇé¿ö£¬¸ÃĿ¼½«°üº¬²»Í¬µÄÎļþ£¬ÆäÖÐcontrolºÍmd5sumsÎļþÊÇ×îС£¨»ù±¾£©ÒªÇó¡£Èç¹û´ý·¢²¼°üÔÚ°²×°ºÍжÔØ£¬ÐèÒªÔËÐÐijЩÃüÁî»ò½Å±¾½øÐгõʼ»¯ºÍÅäÖÃʱ£¬Ôò»á°üº¬ÏÂÁÐÎļþ£º

preinst

ÔÚDebian°üÎļþ½â°ü֮ǰ£¬½«»áÔËÐиýű¾¡£Ðí¶à¡°preinst¡±½Å±¾µÄÈÎÎñÊÇÍ£Ö¹×÷ÓÃÓÚ´ýÉý¼¶Èí¼þ°üµÄ·þÎñ£¬Ö±µ½Èí¼þ°ü°²×°»òÉý¼¶Íê³É¡£



postinst

¸Ã½Å±¾µÄÖ÷ÒªÈÎÎñÊÇÍê³É°²×°°üʱµÄÅäÖù¤×÷¡£Í¨³££¬¡°postinst¡±½Å±¾µÈ´ýÓû§ÊäÈ룬»òÌáÐÑÓû§£¬Èç¹ûËû½ÓÊܵ±Ç°Ä¬ÈÏÖµ£¬Òª¼ÇµÃÈí¼þ°ü°²×°Íêºó·µ»ØÖØÐÂÅäÖá£Ðí¶à¡°postinst¡±½Å±¾¸ºÔðÖ´ÐÐÓйØÃüÁîΪа²×°»òÉý¼¶µÄÈí¼þÖØÆô·þÎñ¡£


prerm

¸Ã½Å±¾¸ºÔðÍ£Ö¹ÓëÈí¼þ°üÏà¹ØÁªµÄdaemon·þÎñ¡£ËüÔÚɾ³ýÈí¼þ°ü¹ØÁªÎļþ֮ǰִÐС£


postrm

¸Ã½Å±¾¸ºÔðÐÞ¸ÄÈí¼þ°üÁ´½Ó»òÎļþ¹ØÁª£¬»òɾ³ýÓÉËü´´½¨µÄÎļþ



ÒòΪ±¾°¸ÀýÐèÒª½«Eclipse¼ÓÈëµ½²Ëµ¥ÖУ¬ËùÒÔÓ¦¸Ã°üº¬postinst and postrmÕâÁ½¸öÎļþ¡£

controlÎļþÄÚÈÝÈçÏ£º

Package: eclipse

Version: 3.1

Section: utils

Priority: optional

Architecture: i386

Depends: libc6 (>= 2.3.2.ds1-4),jdk

Installed-Size: 14062

Maintainer: xxxxxx<xxx@xxxxxx.xxx>

Description:Develop tools



md5sumsÊÇ»ùÓÚmd5sumÃüÁîÉú³ÉµÄÎļþ¡£

ÒòΪÔÚ°²×°±¾°üʱ£¬Ö»ÐèÒª¸üв˵¥ÏËùÒÔpostinst½Å±¾Ö»ÐèÒª°üº¬update-menusÃüÁжÔØʱҲÊÇͬÑùµÄ²Ù×÷¡£Æäpostinst½Å±¾ÄÚÈÝΪ£º

³ÌÐòÇåµ¥Ò»

#£¡/bin/sh

# filename :postinst/postrm

if test -x /usr/bin/update-menus; then

update-menus

fi

postrm½Å±¾ÄÚÈݸúpostinstÄÚÈÝÏàͬ¡£Èç¹ûÄ㻹Ҫ×öÆäËûµÄ²Ù×÷£¬Ôò¿ÉÒÔÔÚÕâÁ½¸öÎļþÖмÓÈëÆäËûÄÚÈÝ¡£



/opt/eclipse/Ŀ¼¾ÍÊÇ´ý·¢²¼£¨°²×°£©µÄÈí¼þĿ¼¡£¶ÔÓÚ±¾ÀýÖ»ÐèÒªÔÚ/optĿ¼ÏÂÖ´ÐиòÙ×÷£º$ tar xzvf eclipse-SDK-3.1-linux-gtk.tar.gz.



ÒªÔÚÃüÁîÖÕ¶ËÖÐÊäÈëeclipse£¬Ò²ÄÜÔËÐÐEclipse¡£Í¨³£ÓÐÈýÖÖ½â¾ö·½°¸£º

1) °Ñ/opt/eclipse/¼ÓÈëµ½PATH±äÁ¿ÖС£

2) ÔÚ/usr/binĿ¼½¨Á¢Ò»¸öÖ¸Ïò/opt/eclipse/eclipseµÄÁ´½Ó

3) ÔÚ/usr/binĿ¼ÏÂн¨Ò»¸ö½Å±¾£¬Ôڽű¾ÖÐÔËÐиóÌÐò



×ۺϿ¼ÂÇ£¬µÚÒ»ÖÖ·½°¸²»¿ÉÐС£µÚ¶þÖÖ·½°¸±È½ÏºÃ£¬µ«Ê§°ÜÁË¡£ÒòΪeclipseÔÚÔËÐÐʱ£¬ÐèÒªstarup.jarÎļþ£¬²¢ÇÒÊÇÏà¶Ô·¾¶ÏµÄstarup.jarÎļþ£¬µ±ÄãÔÚÆäËûÈκη¾¶ÏÂÔËÐÐeclipseʱ£¬¶¼½«»áʧ°Ü¡£Ö»ÓвÉÓõÚÈýÖÖ·½°¸£¬½¨Á¢Ò»¸ö½Å±¾¡£Ö»ÐèÒªÔڸýű¾ÖÐдÈ룺exec /opt/eclipse/eclipse¡£

³ÌÐòÇåµ¥¶þ£º

#£¡/bin/sh

# filename :eclipse

exec /opt/eclipse/eclipse



½ÓÏÂÀ´£¬½â¾ö×îºóÒ»¸öÎÊÌ⣬ÈçºÎ°Ñeclipse¼ÓÈëµ½Apps-->ProgrammingµÄ²Ëµ¥ÖÐÈ¥£¿»ù±¾ÉÏÿһ¸öDebianϵͳµÄÓ¦ÓóÌÐò¶¼»áÓÐÒ»¸ö²Ëµ¥ÅäÖÃÎļþ£¬ÓÃÒÔ¶¨Òå¸Ã³ÌÐòµÄ²Ëµ¥ÏîÃû³Æ¡¢Î»ÖúÍÃüÁîÐÐÑ¡ÏîµÈ²ÎÊý¡£¸ÃÅäÖÃÎļþÒ»°ãλÓÚ/usr/lib/menus¡¢/etc/menu»ò~/.menuĿ¼Ï¡£

ÎÒÃÇн¨Ò»¸öÎļþeclipse ,³ÌÐò°²×°ºó£¬½«ÖÃÓÚ/usr/lib/menu/·¾¶ÏÂ

¸ÃeclipseÅäÖÃÎļþ¸ñʽʾÀýÈçÏ£º

?package(eclipse): ££¶¨ÒåÈí¼þ°üÃû

needs="X11" ££¶¨Òå¸Ã²Ëµ¥ÏîÐèÔÚX11»·¾³ÖÐʹÓÃ

section="Apps/Programming" ££¶¨Òå²Ëµ¥ÏîµÄ·¾¶Î»ÖÃ

title="Eclipse" ££¶¨Òå²Ëµ¥ÏîµÄ±êÌâ

command="/usr/bin/eclipse" ££¶¨ÒåÃüÁîºÍÑ¡Ïî

hints="Eclipse" ££¶¨ÒåһЩÌáʾÐÅÏ¢

icon="/opt/eclipse/icon.xpm" ££¶¨Òå²Ëµ¥ÏîµÄͼ±ê



Ŀ¼½á¹¹¿ò¼Ü½éÉÜÍê±Ïºó£¬¾Í¿ªÊ¼´òµØ»ù£¬×¼±¸Îļþ°É£¬ÐèҪ׼±¸µÄÎļþÓУº

1£© control£¨±ØÐëÒª£©

2£© eclipse.sh£¨ÓÃÓÚÖնˣ¬ÒòΪÓë²Ëµ¥µÄeclispeÖØÃû£¬ËùÓмÓÁË.shºó׺£©

3£© eclipse.menu £¨ÓÃÓڲ˵¥£©

4£© eclipse-SDK-3.1-linux-gtk.tar.gz £¨ÏÂÔصÄeclipse°ü£©

5£© postinst £¨ÓÃÓÚ°²×°ºÍжÔØʱµ÷ÓõĽű¾£©



½«ÉÏÊöËùÓÐÎļþ·ÅÖÃһĿ¼ÖУ¬²¢ÔÚ¸ÃĿ¼ÏÂн¨mkeclipse½Å±¾£¬Ö÷ÒªÓÃÓÚÍê³ÉÉÏÃæµÄ¹¤×÷£¬ÆäÄÚÈÝÈçÏ£º

#!/bin/sh

ROOT=$PWD

ECLIPSE=$ROOT/eclipse-SDK-3.1-linux-gtk.tar.gz

CONTROL=$ROOT/control

POST=$ROOT/postinst

BINECP=$ROOT/eclipse.sh

MENUS=$ROOT/eclipse.menu

if [ -w "$ROOT" ];then

mkdir eclipse

cd eclipse

mkdir DEBIAN opt usr usr/bin usr/lib usr/lib/menu

cd opt

if [ -e "$ECLIPSE" ];then

tar xzvf $ECLIPSE

fi

cd ..

if [ -e "$CONTROL" ];then

cp $CONTROL DEBIAN/

fi

if [ -e "$POST" ];then

cp $POST DEBIAN/postrm

fi

if [ -e "$BINECP" ];then

cp $BINECP usr/bin/eclipse

fi

if [ -e "$MENUS" ];then

cp $MENUS usr/lib/menu/eclipse

fi

rm -f DEBIAN/md5sums

find opt usr -type f -exec md5sum {} ;>>DEBIAN/md5sums

fi



ÏÖÔÚÒѾ­Íòʾ㱸£¬Ö»Ç·¶«·ç¡£ÄÇÏÖÔھͲݴ¬½è¶«·ç¡ª¡ª½èDebianµÄdpkg°üÕâ¹É¶«·ç£¬À´³É¾ÍÎÒÃǵÄÊÂÒµ°É¡£

ÖÆ×÷deb°ü£¬ÔÚµ±Ç°ROOTĿ¼ÔËÐÐÈçÏÂÃüÁ$dpkg -b eclipse eclipse_3.1_i386.deb

Ò²¿ÉÒÔÔÚmkeclipse½Å±¾µÄ×îºóÒ»¸öfiÇ°¼ÓÈë

cd $ROOT

dpkg -b eclipse eclipse_3.1_i386.deb

À´Íê³É¸Ã¹¦ÄÜ¡£



ºÃ£¬ÏÖÔھͿªÊ¼ÎÒÃǵÄÐĶ¯Ö®Âðɡ£



Ê×ÏÈ°²×°deb°ü£ºdpkg -i eclipse_3.1_i386.deb ÏÂÃæ´òÓ¡µÄÏûÏ¢ÊDz»ÊǷdz£ÊìϤ¡£

½øÈëͼÐνçÃ棬·¢ÏÖApps-->ProgrammingÖÐÒѾ­ÓÐÁËEclipse²Ëµ¥ÏÇë¹Ä×ãÓÂÆøµ¥»÷һϰɣ¬Eclipse IDEÒѾ­Ô¾È»³öÏÖÔÚÄãµÄ×ÀÃæÉÏ£¨µ±È»ÄãµÄjdk»·¾³ÒѾ­ÅäÖúÃÁË£©¡£

½ÓÏÂÀ´£¬ÊÔ×ÅжÔØһϣºapt-get remove eclipse¡£EclipseÒѾ­´Ó²Ëµ¥ÖÐÏûʧÁË£¬/opt/eclipseĿ¼ҲÒѾ­²»¸´´æÔÚ¡£



ÏÖÔÚ¾õµÃÊDz»ÊǺܷ½±ã£¿µ±Äã¿´Íê±¾ÎĵÄʱºò£¬ÄãÊÇ·ñ¶ÔÎÄÕ¿ªÊ¼Ìá³öµÄÎÊÌâÒѾ­»íÈ»¿ªÀÊ¡£ÆäʵÕâÑù×öµÄÄ¿µÄ¾ÍÊǼò»¯ÀͶ¯£¬Í¬Ò»¸öÏîÄ¿×éµÄÈËÔÚ×öÖظ´µÄ¹¤×÷£¬±ÈÈç°²×°eclipse£¬ÒªÔÚ/usr/binϽ¨Á¢Îļþ£¬ÓÖÒªÔÚ/usr/lib/menuÖн¨Á¢Îļþ£¬»¹Òª¿½±´Ò»Ð©eclipseÎļþ£¬²»ÖªµÀÔÚ¿½±´µÄ¹ý³ÌÖÐÊÇ·ñ»áÒÅ©һЩÎļþµÈµÈ¡£»òÕßÄãµÄϵͳ³öÓÚijÖÖÔ­ÒòÒªÖØ×°£¬ÒÔÇ°µÄ¹¤×÷ÓÖµÄÖØÐÂÀ´Ò»±é£¬ºÜ·Ñʱ¡£Èç¹ûÄã×ö³ÉÁËÒ»¸ödeb°ü£¬ÒÔÉϵÄÎÊÌâºÍÒÉÂǾÍÓ­Èжø½â¡£


»¶Ó­ÌÖÂÛ£ºnormalnotebook@126.com


²Î¿¼ÎÄÏ×:

1. Debian manual refrence

2. http://www.nl.debian.org/doc/packaging-manuals/menu.html/index.html
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ