个人工具
登录
查看“UbuntuHelp:UpdatingADeb”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:UpdatingADeb”的源代码
来自Ubuntu中文
←
UbuntuHelp:UpdatingADeb
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/UpdatingADeb}} {{Languages|UbuntuHelp:UpdatingADeb}} This howto explains how to build software that is packaged in ubuntu. Reasons for rebuilding a package that is already in ubuntu: * apply a patch * use a version that doesn't have a .deb * use different build options, in the uncommon case optional features were disabled. This is roughly based on [[UbuntuHelp:BuildingWineFromSource|BuildingWineFromSource]]. It is the basic commands needed for the simple cases. Not everything is simple, so it may or may not work for any one package. Once you are fluent with this you may want to contribute your packages, or even package software that never was in ubuntu. For more information about this, see the [[UbuntuWiki:MOTU|Masters|of the universe]] site, and the [[UbuntuWiki:MOTU/School|MOTU|school]] there. ---- === Install the build dependencies === The purpose of this step is to install any dependencies necessary to the build process. <pre><nowiki> sudo apt-get build-dep <package> sudo apt-get install build-essential fakeroot devscripts </nowiki></pre> === Download the source === You can sometimes use <code><nowiki>debcheckout <package></nowiki></code> to get a fresh VCS checkout of the source package, but layout and conventions differ. <pre><nowiki> mkdir src; cd src apt-get source <package> cd <newly created dir> </nowiki></pre> At this point, I generally do the "Build Time!" process now to make sure everything is in order. Sometimes the reason you're building from source is because you need to patch the stock release. Now is when you do that. <pre><nowiki> patch -p1 < SomePackagePatch.patch </nowiki></pre> For the bold, using the vanilla source isn't hard. If you are lucky, there is a debian dir that has everything you need to just do Build Time! otherwise, I have been able to copy the debian/ dir to the source tree and build from there. (how dangerous is this?) Be sure to update debian/control so that your new package gets a proper version number. This will prevent it from being upgraded to the original ubuntu version. This command will do it semi-automatically: <pre><nowiki> debchange -i </nowiki></pre> Change version number in the first line to something like 0.8.3-svn-158, or like <previous-version>.customised.1; then add some comment. === Build time! === <pre><nowiki> debuild -us -uc -i -I </nowiki></pre> === Install the new deb === The build process will create one or more .deb(s) in the parent directory. Don't change directory yet, and install the packages you just built. <pre><nowiki> sudo debi </nowiki></pre> === Clean up === Once you're satisfied that <package> is working properly, you can now clean up the files used for building, as this frees up quite a bit of disk. Of course, deleting make's working files will mean that if you need to rebuild, make will have to start right from the beginning. === Notes === add the gutsy source repository where jppy is contained, then see if "sudo apt-get -b source jppy" gets you a clean compile. if it does, you could still tell the backports team about it. ---- used this for: wine pidgin gocr spe mplayer maintains the debian/ dir as part of it's source, so no need for <code><nowiki>apt-get source mplayer</nowiki></code> and shuffling files around, just <pre><nowiki> svn co svn://svn.mplayerhq.hu/mplayer/trunk mplayer-trunk cd mplayer-trunk debuild -us -uc -i -I </nowiki></pre> ---- Script that tries to do the whole process, you need to tweak the few things at the top. I left in what works for various packages I have used this on. <pre><nowiki> # updeb.sh # updates a deb. well, makes a deb from current source. # based on https://help.ubuntu.com/community/UpdatingADeb set -xe # ---------------------------------- PACKAGE=spe SRCDIR=_spe GETSRCCMD="svn checkout svn://svn.berlios.de/python/$PACKAGE/trunk/_spe" # ---------------------------------- # PACKAGE=gocr SRCDIR=src GETSRCCMD="cvs -d:pserver:anonymous@jocr.cvs.sourceforge.net:/cvsroot/jocr login && cvs -z3 -d:pserver:anonymous@jocr.cvs.sourceforge.net:/cvsroot/jocr co -P jocr/src" # ---------------------------------- PACKAGE=python-kinterbasdb SRCDIR=src GETSRCCMD=" cvs -d:pserver:anonymous@kinterbasdb.cvs.sourceforge.net:/cvsroot/kinterbasdb login && cvs -z3 -d:pserver:anonymous@kinterbasdb.cvs.sourceforge.net:/cvsroot/kinterbasdb co -P Kinterbasdb-3.0 ./" # ----------------- PACKAGE=qemu SRCDIR=#_spe GETSRCCMD="cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu co qemu" # need to move debian/ and cd into the cvs source: # mv qemu-*/debian qemu/ # cd qemu # ---------------------------------- # DEBEMAIL=carl@personnelware.com # DEBFULLNAME="Carl Karsten" mkdir $PACKAGE cd $PACKAGE # needed to get source, compile and build debs sudo apt-get --assume-yes install build-essential fakeroot subversion cvs dpkg-dev devscripts # get the $PACKAGE deps and source from apt repository # (and debian/ dir needed to build the .deb) sudo apt-get --assume-yes build-dep $PACKAGE apt-get source $PACKAGE # cd into the apt-got dir. # this will need to be changed as the version changes. # this is a hack. not sure how else to figure out what to cd into cd $PACKAGE* exit # hide the apt-got source # mv $SRCDIR $SRCDIR.apt-got # get working copy $GETSRCCMD # bump the version number # if this is not done, the new deb will be the same version as the current, so won't install. ($0 is the name of this script) debchange --nmu $0 # build the .deb debuild -us -uc -i -I # install the deb. # using this command, on your own :) echo sudo gdebi $PACKAGE*.deb </nowiki></pre> ---- CarlKarsten GabrielDePerthuis [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:UpdatingADeb
。