[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rules makefile and packaging basics

Thanks for all you time helping to explain how this stuff works, I
really appreciate it, I find most of the documentation on this subject
pretty heavy reading and extremely difficult to learn from.

You'll be pleased to know I've started to use fakeroot instead of sudo
for the packaging

Cheers Etienne.

On 13 February 2011 00:09, Etienne Millon <etienne.millon@gmail.com> wrote:
> On Fri, Feb 11, 2011 at 06:27:34PM +0000, james frize wrote:
>> Thanks Etienne,
>> I think I'm starting to get it now, I'll have to read a bit more on
>> how a makefile works before my next attempt, all this "binary target"
>> stuff is confusing me.
> debian/rules is a Makefile which has several targets (list of commands
> that are named). One is 'install' which should copy files on a
> suitable location, one is 'binary' which should build a .deb file from
> the those copied files (hence the dependency : 'binary' can only be
> run after 'install' is completed). Note that these names are just a
> convention that is enforced by the debian policy.
>> So, my current understanding is that the rules makefile tells it how
>> and where to install the files, then dh_builddeb is called and that
>> does the dirty work of actually installing the files??
> As a Makefile writer, your job is to provide several targets that will
> do the job (copy files, build deb, clean stuff, etc). How you
> implement them is up to you : you could copy files with cp/install,
> build a .deb file with low-level tools (tar, gzip, ar), but you should
> instead use tools made for that. The debhelper suite (dh_* commands)
> is widely used and you can find examples in existing packages (apt-get
> source packagename).
>> Not sure what you mean by - "You probably ran the build as root ('sudo
>> debian/rules binary' or
>> something like that)" The only command I use in the process that has
>> sudo in it is - sudo dpkg-buildpackage, is this what you are referring
>> to?
> Yes, internally dpkg-buildpackage will call debian/rules, so it will
> be invoked as root. This is an unnecessary priviledge. If you run
> dpkg-buildpackage as your normal user, it won't be able to directly
> install files to your host system during the build process, so it will
> be safer.
>> Thanks again for your help
>> Jim.
>> ps - I tried to email you on the debian-mentors list, but I couldn't
>> use the mailto link as I only do email in browser. After copying the
>> email address from the link it just spat out your personal
>> email...sorry, I don't know how to email back to you on the list :(
> I CC'd you, something like "reply to all" should work.
> --
> Etienne Millon
> --
> Etienne Millon
> Version: GnuPG v1.4.10 (GNU/Linux)
> o06Xub8HIosgb6qlq+1WZp2ohQKa8BplG0Qvq9/1Keik/RNaehimWkGykAs7ff/G
> TyEvjhB08vUXNiNkAJH8C0Bu/chfahkceq5KgVfnRtmlfQmtJG1JbZEPX+LtNsJ/
> JNfAXqP3IKiHPshZBQ8uxKMNP2YVXtqud9EWPi0ePNN6+wfUxk7QDLr3dt/exLrp
> d5v1C+3jn8icbvjpS7cGaIGlb9/jyDM4eqp6zkoG7uFdMmQBxuOWqabLtpVwBp6T
> SL1AfDcHrDqNFBGavEjP9ntCE3xxigYaL2rG2ZCJNCWL0RrsfKyEQvJVntnRb6Y=
> =7VLF

Reply to: