Gentoo Development Guide/Quick Start Ebuild Guide
Quickstart Ebuild Guide ¶¹ø¿ªÀÚ : jachin ÀÛ¼º
ÀÌ ¹®¼´Â ebuild ÀÛ¼º¿¡ ´ëÇØ ´ë·«ÀûÀÎ ¼Ò°³¸¦ ÇÕ´Ï´Ù. ÀÌ ¹®¼´Â ¾î¶»°Ô ebuildµéÀÌ µ¿ÀÛÇÏ´ÂÁö ±âº»ÀûÀÎ °³³äÀ» ¾òÀ» ¼ö ÀÖµµ·Ï ½ÃÇèÇØ º¼ ¼ö ÀÖ´Â ¸î¸î ¿¹Á¦µéÀ» Á¦°øÇÏ´Â °Í ¿Ü¿¡´Â °³¹ßÀڷμ °Þ°Ô µÉ ¸¹Àº ¼¼ºÎ»çÇ×À̳ª ¹®Á¦µéÀ» ´Ù·çÁö ¾Ê°í ÀÖ½À´Ï´Ù.
¿©±â¼ »ç¿ëµÈ ¿¹Á¦´Â ¸î¸î ºÎºÐÀ¸·Î ³ª´²Áø ½ÇÁ¦ Æ®¸® ebuild¿¡ ±â¹ÝÇÏ´Â µ¿¾È (Æ®¸®¸¦) º¯°æÇÏ°í ´Ü¼øÈÇÑ´Ù´Â °ÍÀ» ÁÖÀÇÇϽʽÿÀ.
First Ebuild (ÃÖÃÊÀÇ ebuild) ¶½ÃÀÛÀ» ¼Ò½ºÄÚµå Àε¦½Ì µµ±¸ÀÎ Exuberant Ctags À¯Æ¿¸®Æ¼¿¡ ´ëÇÑ ebuild·Î ÇÏ°Ú½À´Ï´Ù. ¿©±â¿¡ ´Ü¼øÈµÈ dev-util/ctags/ctags-5.5.4.ebuild °¡ ÀÖ½À´Ï´Ù. (ÁÖ¿ä Æ®¸®¿¡¼ ½ÇÁ¦·Î º¼ ¼ö ÀÖ½À´Ï´Ù.)
# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/httpd/kldp/wiki/data/text/RCS/GentooDevelopmentGuide_2fQuickStartEbuildGuide,v 1.11 2006/11/17 13:49:25 kss Exp kss $ DESCRIPTION="Exuberant ctags generates tags files for quick source navigation" HOMEPAGE="http://ctags.sourceforge.net" SRC_URI="mirror://sourceforge/ctags/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~mips ~sparc ~x86" IUSE="" src_compile() { econf --with-posix-regex || die "econf failed" emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "install failed" dodoc FAQ NEWS README dohtml EXTENDING.html ctags.html } ±âº»ÀûÀÎ Çü½Ä (Basic Format) ¶¿©·¯ºÐÀÌ º¸½Ã´Ù½ÃÇÇ, ebuild´Â ƯÁ¤ÇÑ È¯°æ¿¡¼ ½ÇÇàÇÏ´Â bash ½ºÅ©¸³Æ®¿¡ Áö³ªÁö ¾Ê½À´Ï´Ù.
ebuild ÀÇ Á¦ÀÏ À ºÎºÐÀº ¸Ó¸´¸» ºÎºÐ(Header Block)ÀÔ´Ï´Ù. ÀÌ°ÍÀº ¸ðµç ebuild ¿¡ ÀÖ½À´Ï´Ù. ebuildµéÀº ÅÇÀ» »ç¿ëÇÏ¿© µé¿©¾²±â µÇ¸ç, ÇÑ ÅÇÀº 4ÄÀ¸·Î ´ëüµË´Ï´Ù. ebuild ÆÄÀÏ Çü½ÄÀ» º¸½Ê½Ã¿À. Á¤º¸ º¯¼ö (Information Variables) ¶´ÙÀ½À¸·Î, ¿©±â º¯¼öµéÀÇ ÁýÇÕÀÌ ÀÖ½À´Ï´Ù. À̰͵éÀº ÁúÀÇ¿¡¼ Portage ¿Í °ü·ÃµÈ ´Ù¾çÇÑ °ÍµéÀ» ¾Ë·ÁÁÝ´Ï´Ù.
DESCRIPTION º¯¼ö´Â ÆÐÅ°Áö¿Í ÆÐÅ°ÁöÀÇ ¸ñÀû¿¡ ´ëÇÑ ÂªÀº ¼³¸í ¸ðÀ½ÀÔ´Ï´Ù.
HOMEPAGE ´Â ÆÐÅ°ÁöÀÇ È¨ÆäÀÌÁö ¸µÅ©ÀÔ´Ï´Ù. (http:// ºÎºÐµµ Æ÷ÇÔÇØ¾ß ÇÏ´Â °ÍÀ» ±â¾ïÇϽʽÿÀ) LICENSE ´Â GPL-2 ÀÔ´Ï´Ù. (GNU ÀÏ¹Ý °ø¿ë ¶óÀ̼¾½º ¹öÀü 2). SRC_URI ´Â Portage ¿¡ ¼Ò½º Ÿº¼(Tarball) ÆÄÀÏÀ» ³»·Á¹Þ±â À§ÇØ »ç¿ëµÉ ÁÖ¼Ò¸¦ ¾Ë·ÁÁÝ´Ï´Ù. ¿©±â mirror://sourceforge/ ´Â "¾î¶² ¼Ò½ºÆ÷Áö ¹Ì·¯µé"À» ¶æÇÏ´Â Áß¿äÇÑ Ç¥½ÄÀÔ´Ï´Ù. ${P} ´Â Portage ¿¡ ÀÇÇØ Á¤ÀǵÈ, Àб⸸ °¡´ÉÇÑ º¯¼öÀÔ´Ï´Ù. ÀÌ º¯¼ö´Â ÆÐÅ°ÁöÀÇ À̸§°ú ¹öÀüÀ» ³ªÅ¸³À´Ï´Ù. À§ÀÇ ¿¹Á¦ÀÇ °æ¿ì º¯¼ö´Â ctags-5.5.4 ÀÇ °ªÀ» °®°í ÀÖ½À´Ï´Ù. SLOT º¯¼ö´Â Portage ¿¡ ÀÌ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÒ ½½·Ô(slot)À» ¾Ë·ÁÁÝ´Ï´Ù. ¸¸¾à ¿©·¯ºÐÀÌ ÀÌÀü¿¡ ½½·ÔµéÀ» º» ÀûÀÌ ¾ø´Ù¸é, ±×³É "0" À» »ç¿ëÇϰųª Slotting À» ÀÐÀ¸½Ê½Ã¿À. KEYWORDS º¯¼ö´Â ÀÌ ebuild °¡ ½ÃÇèµÇ¾îÁø (CPU ÀÇ) ±¸Á¶(¾ÆÅ°ÅØÃÄ)¿¡ ´ëÇÑ ÁýÇÕÀÔ´Ï´Ù. ¿ì¸®´Â »õ·Î ÀÛ¼ºµÈ ebuild µé¿¡ ´ëÇؼ ~ Å°¿öµåµéÀ» »ç¿ëÇÕ´Ï´Ù. ÀÌ ÆÐÅ°ÁöµéÀº Àß ÀÛµ¿ÇÏ´Â °ÍÀ¸·Î º¸Àδٰí Çصµ ¾ÈÁ¤¹öÀüÀ¸·Î ¹Ù·Î ÀÎÁõµÇÁö ¾Ê½À´Ï´Ù. ´õ ÀÚ¼¼ÇÑ »çÇ×Àº Keywording À» º¸½Ê½Ã¿À. ±¸Ãà ÇÔ¼öµé (Build Functions) ¶´ÙÀ½À¸·Î src_compile (ÀÌ)¶ó°í À̸§ºÙ¿©Áø ÇÔ¼öÀÔ´Ï´Ù. Portage ´Â ÆÐÅ°Áö¸¦ ÄÄÆÄÀÏ Çϱ⠿øÇÒ ¶§ ÀÌ ÇÔ¼ö¸¦ È£ÃâÇÕ´Ï´Ù. econf ÇÔ¼ö´Â ./configure ¸¦ È£ÃâÇÏ´Â °Í¿¡ ´ëÇÑ ·¦ÆÛÀÔ´Ï´Ù. ±×¸®°í emake ´Â make ¿¡ ´ëÇÑ ·¦ÆÛÀÔ´Ï´Ù. ÀÌ µÎ °æ¿ì °øÅëÀûÀ¸·Î || die "something went wrong" °ü¿ë ¼ö½ÄÀ» »ç¿ëÇÕ´Ï´Ù.ÀÌ°ÍÀº ¾î¶² ÀÌÀ¯·Î ÀÎÇÑ ¿À·ù°¡ ¹ß»ýÇßÀ» ¶§, Portage °¡ ¼³Ä¡¸¦ °è¼ÓÇϵµ·Ï ½ÃµµÇÏÁö ¾Ê°í ¸ØÃßµµ·Ï È®½ÇÈ÷ Çϱâ À§ÇÑ °ÍÀÔ´Ï´Ù.
src_install ÇÔ¼ö´Â ÆÐÅ°Áö¸¦ ¼³Ä¡Çϱ⠿øÇÒ ¶§ Portage ¿¡ ÀÇÇØ È£ÃâµË´Ï´Ù. ¹Ù·Î ÆÄÀÏ ½Ã½ºÅÛ¿¡ ¼³Ä¡ÇÏÁö ¾Ê´Â´Ù´Â Á¡ÀÌ ¾à°£ ÈñÇÑÇÑ ºÎºÐÀÔ´Ï´Ù. ${D} º¯¼ö¿¡ ÀÇÇØ ÁÖ¾îÁø Ưº°ÇÑ À§Ä¡¿¡ ¼³Ä¡µÉ °ÍÀÔ´Ï´Ù. (Portage °¡ ÀÌ º¯¼ö¸¦ ¼³Á¤ÇÕ´Ï´Ù. Install Destinations and Sandbox ¸¦ º¸½Ê½Ã¿À.) ´Ù½Ã || die construct ±¸¼ºÀ» »ç¿ëÇÏ¿© ¿¡·¯¿¡ ´ëÇØ È®ÀÎÇÕ´Ï´Ù. ÀÇÁ¸¼ºÀ» °®´Â ebuild (Ebuild with Dependencies) ¶ctags ¿¹Á¦¿¡¼ Portage ¿¡ ¾î¶°ÇÑ ÀÇÁ¸¼º¿¡ ´ëÇؼµµ (Á¤º¸¸¦) Àü´ÞÇÏÁö ¾Ê¾Ò½À´Ï´Ù. »ç½Ç ±×·¡µµ »ó°üÀº ¾ø½À´Ï´Ù. ¿Ö³ÄÇϸé ctags´Â ÄÄÆÄÀÏ ÇÏ°í ½ÇÇàÇϴµ¥ ±âº»ÀûÀÎ µµ±¸¸ðÀ½(toolchain)¸¸ ÇÊ¿äÇϱ⠶§¹®ÀÔ´Ï´Ù. (¿Ö ÀÌ ÆÐÅ°Áö¿¡ ´ëÇÑ ÀÇÁ¸¼º Á¤º¸°¡ ÇÊ¿ä ¾ø´ÂÁö¿¡ ´ëÇؼ Implicit System Dependency¸¦ º¸½Ê½Ã¿À.) ÇÏÁö¸¸ »îÀÌ ±×·¸°Ô °£´ÜÇÏÁö´Â ¾Ê½À´Ï´Ù. (ÀÇÁ¸¼ºÀÌ ¾øÀ» ÀÏÀº °ÅÀÇ ¾ø±â ¶§¹®ÀÌÁö¿ä.)
¿©±â app-misc/detox/detox-1.1.1.ebuild °¡ ÀÖ½À´Ï´Ù. # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/httpd/kldp/wiki/data/text/RCS/GentooDevelopmentGuide_2fQuickStartEbuildGuide,v 1.11 2006/11/17 13:49:25 kss Exp kss $ DESCRIPTION="detox safely removes spaces and strange characters from filenames" HOMEPAGE="http://detox.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" LICENSE="BSD" SLOT="0" KEYWORDS="~hppa mips sparc x86" IUSE="" DEPEND="dev-libs/popt sys-devel/flex sys-devel/bison" RDEPEND="dev-libs/popt" src_compile() { econf --with-popt || die "econf failed" emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "install failed" dodoc README CHANGES } ´Ù½Ã ¿©·¯ºÐµéÀº ebuild Çì´õ¿Í ´Ù¾çÇÑ Á¤º¸ º¯¼öµéÀ» º¼ ¼ö ÀÖ½À´Ï´Ù. SRC_URI ¿¡¼, ¹öÀü¿¡ ´ëÇÑ ²¿¸´¸»ÀÌ ¾ø´Â ÆÐÅ°ÁöÀÇ À̸§À» ¾ò±â À§ÇØ ${PN}ÀÌ »ç¿ëµË´Ï´Ù. (¿©±â¿£ ¿©·¯°¡Áö º¯¼ö°¡ ÀÖ½À´Ï´Ù. Predefined Read Only Variables ¸¦ º¸½Ê½Ã¿À.) ´Ù½Ã, src_compile °ú src_install ÇÔ¼öµéÀ» Á¤ÀÇÇÕ´Ï´Ù. DEPEND ¿Í RDEPEND º¯¼öµéÀº Portage °¡ ÆÐÅ°ÁöµéÀ» ¼³Ä¡ÇÏ°í ½ÇÇàÇϴµ¥ ÇÊ¿äÇÑ ÆÐÅ°ÁöµéÀ» °áÁ¤Çϱâ À§ÇÑ ±âÁØÀÔ´Ï´Ù. DEPEND º¯¼ö ¸ñ·ÏÀº ÄÄÆÄÀÏ ÇÒ ¶§ÀÇ ÀÇÁ¸¼º ¸ñ·ÏÀ̸ç, RDEPEND Àº ½ÇÇà½Ã ÀÇÁ¸¼ºÀ» ³ªÅ¸³À´Ï´Ù. ´õ ´Ù¾çÇÏ°í º¹ÀâÇÑ ¿¹Á¦´Â Dependencies ¸¦ º¸½Ê½Ã¿À. º¯°æÀû¿ë»çÇ×ÀÌ ÀÖ´Â ebuild (Ebuild with Patches) ¶¿ì¸®´Â ÀÚÁÖ º¯°æÀû¿ë»çÇ×(patch)µéÀ» Àû¿ëÇÏ±æ ¿øÇÕ´Ï´Ù. epatch µµ¿ò ÇÔ¼ö¸¦ »ç¿ëÇÏ¿© src_unpack ÇÔ¼ö¿¡¼ ¿Ï·áÇÕ´Ï´Ù. epatch ÇÔ¼ö¸¦ »ç¿ëÇϱâ À§Çؼ´Â ebuild ¿¡¼ ¸ÕÀú Portage ¿¡ eutils eclass (¶óÀ̺귯¸®¿Í °°Àº eclass) °¡ ÇÊ¿äÇÏ´Ù°í ¾Ë·Á¾ß ÇÕ´Ï´Ù. ÀÌ°ÍÀº ebuild ÀÇ ¸Ó¸´ºÎºÐ¿¡¼ inherit eutils ¸¦ ÅëÇØ ¿Ï·áµË´Ï´Ù. ¿©±â app-misc/detox/detox-1.1.0.ebuild °¡ ÀÖ½À´Ï´Ù.
# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/httpd/kldp/wiki/data/text/RCS/GentooDevelopmentGuide_2fQuickStartEbuildGuide,v 1.11 2006/11/17 13:49:25 kss Exp kss $ inherit eutils DESCRIPTION="detox safely removes spaces and strange characters from filenames" HOMEPAGE="http://detox.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" LICENSE="BSD" SLOT="0" KEYWORDS="~hppa ~mips ~sparc ~x86" IUSE="" DEPEND="dev-libs/popt sys-devel/flex sys-devel/bison" RDEPEND="dev-libs/popt" src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-destdir.patch epatch "${FILESDIR}"/${P}-parallel_build.patch } src_compile() { econf --with-popt || die "econf failed" emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "install failed" dodoc README CHANGES } ${FILESDIR}/${P}-destdir.patch ¸¦ º¸½Ê½Ã¿À. ÀÌ°ÍÀº Portage Æ®¸®¿¡¼ files/ ÇÏÀ§ µð·ºÅ͸®¿¡ Á¸ÀçÇÏ´Â detox-1.1.0-destdir.patch À» ÂüÁ¶ÇÕ´Ï´Ù. ´õ Å« º¯°æÀû¿ë»çÇ×(Patch) ÆÄÀϵéÀº files/ µð·ºÅ͸®º¸´Ü ¹Ì·¯·Î °¡¾ß ÇÕ´Ï´Ù. Patching with ematch ¸¦ º¸½Ê½Ã¿À. USE Ç÷¡±×¸¦ »ç¿ëÇÏ´Â ebuild (Ebuild with USE Flags) ¶ÀÌÁ¦ ¸î¸î USE Ç÷¡±×µé¿¡ ´ëÇÑ °ÍÀÔ´Ï´Ù. ¿©±â dev-libs/libiconv/libiconv-1.9.2.ebuild °¡ ÀÖ½À´Ï´Ù. iconv ¸¦ °®Áö ¾ÊÀº libc ±¸Çö¹°¿¡ ´ëÇÑ iconv ´ëü ÆÐÅ°ÁöÀÔ´Ï´Ù.
# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/httpd/kldp/wiki/data/text/RCS/GentooDevelopmentGuide_2fQuickStartEbuildGuide,v 1.11 2006/11/17 13:49:25 kss Exp kss $ DESCRIPTION="GNU charset conversion library for libc which doesn't implement it" SRC_URI="ftp://ftp.gnu.org/pub/gnu/libiconv/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/libiconv/" SLOT="0" LICENSE="LGPL-2.1" KEYWORDS="~amd64 ~ppc ~sparc ~x86" IUSE="nls" DEPEND="virtual/libc !sys-libs/glibc" src_compile() { econf $(use_enable nls) || die "econf failed" emake || die } src_install() { emake DESTDIR="${D}" install || die "install failed" }IUSE º¯¼ö¸¦ ÁÖ¸ñÇϽʽÿÀ. ÀÌ°ÍÀº ebuild °¡ »ç¿ëÇÒ (Ưº°ÇÏÁö ¾ÊÀº) USE Ç÷¡±×µéÀ» ³ª¿ÇÕ´Ï´Ù. ÀÌ°ÍÀº ´Ù¸¥°Íµé°ú °°ÀÌ emerge -pv Ãâ·Â¿¡ »ç¿ëµË´Ï´Ù. ÆÐÅ°ÁöÀÇ ./configure ½ºÅ©¸³Æ®´Â º¸Åë --enable-nls ³ª --disable-nls ÀÎÀÚ¸¦ °®½À´Ï´Ù. ¿ì¸®´Â ÀÌ°ÍÀ» ÀÚµ¿À¸·Î »ý¼ºÇϱâ À§ÇØ »ç¿ëÀÚÀÇ USE Ç÷¡±×¿¡ ÀÇÁ¸ÇÏ´Â use_enable À¯Æ¿¸®Æ¼ ÇÔ¼ö¸¦ »ç¿ëÇÕ´Ï´Ù. (Query Functions Reference ¸¦ º¸½Ê½Ã¿À.) Á¶±Ý ´õ º¹ÀâÇÑ ¿¹Á¦·Î ¿©±â mail-client/sylpheed/sylpheed-1.0.4.ebuild °¡ ÀÖ½À´Ï´Ù. # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/httpd/kldp/wiki/data/text/RCS/GentooDevelopmentGuide_2fQuickStartEbuildGuide,v 1.11 2006/11/17 13:49:25 kss Exp kss $ inherit eutils DESCRIPTION="A lightweight email client and newsreader" HOMEPAGE="http://sylpheed.good-day.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" LICENSE="GPL-2" KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86" SLOT="0" IUSE="crypt gnome imlib ipv6 ldap nls pda ssl xface" DEPEND="=x11-libs/gtk+-1.2* nls? ( >=sys-devel/gettext-0.12.1 ) crypt? ( >=app-crypt/gpgme-0.4.5 ) gnome? ( media-libs/gdk-pixbuf ) imlib? ( media-libs/imlib ) ldap? ( >=net-nds/openldap-2.0.11 ) pda? ( app-pda/jpilot ) ssl? ( dev-libs/openssl ) xface? ( >=media-libs/compface-1.4 )" RDEPEND="${DEPEND} app-misc/mime-types x11-misc/shared-mime-info" src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${PN}-namespace.diff epatch "${FILESDIR}"/${PN}-procmime.diff } src_compile() { econf \ $(use_enable nls) \ $(use_enable ssl) \ $(use_enable crypt gpgme) \ $(use_enable pda jpilot) \ $(use_enable ldap) \ $(use_enable ipv6) \ $(use_enable imlib) \ $(use_enable gnome gdk-pixbuf) \ $(use_enable xface compface) \ || die emake || die } src_install() { einstall || die "einstall failed" dodir /usr/share/pixmaps insinto /usr/share/pixmaps doins *.png if use gnome ; then dodir /usr/share/gnome/apps/Internet insinto /usr/share/gnome/apps/Internet doins sylpheed.desktop fi dodoc [A-Z][A-Z]* ChangeLog* }ºÎ°¡ÀûÀÎ ÀÇÁ¸¼ºµé¿¡ ÁÖÀÇÇϽʽÿÀ. ¸î¸î use_enable ÇàÀº µÎ °³ÀÇ ÀÎÀÚ¸¦ »ç¿ëÇÕ´Ï´Ù. ÀÌ°ÍÀº ./configure ÀÎÀÚ¿Í USE Ç÷¡±× À̸§ÀÌ ¿ÏÀüÈ÷ ÀÏÄ¡ÇÏÁö ¾ÊÀ» ¶§ À¯¿ëÇÕ´Ï´Ù. |
You will be given a post of trust and responsibility. |