![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
|
|
x86 64-bit Users For the discussion of Ubuntu on the AMD 64 platform. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Way Too Much Ubuntu
![]() |
Howto make debian standard debs from scratch
Hi,
Thanks to Debian's guide. lets start. How to make a debian package in 10 minutes Few things you need: a. a debian/ubuntu system with apt b. you need to know how to do a basic compile c. a little project to make deb of, check if this project already build on: http://packages.ubuntu.com d. few programes to install: apt-get install build-essential dh-make debhelper devscripts Getting your little projcet source code a. Download your project source code (usually tar.bz2/tar.gz) b. Untar it: tar.bz2 files: Code:
tar xvjf myproject-1.2.tar.bz2 Code:
tar xvzf myproject-1.2.tar.gz - The package name: myproject - The version: 1.2 c. after extracting usually you will see a directory named: myproject-1.2 (by debian standards: the .tar.bz2 and the directory the extracted from it, should name like that always: packagename-version, if it doesn't, change it) d. lets move this to our enviroment directory. for example: Code:
cp -r myproject-1.2 /home/myusername/packages/myproject/ cp myproject-1.2.tar.bz2 /home/myusername/packages/myproject/ /home/myusername/packages/myproject/myproject-1.2 /home/myusername/packages/myproject/myproject-1.2.tar.bz2 if you don't, make it happen. change directory there Code:
cd /home/myusername/packages/myproject/ first thing you should check is: does myproject-1.2 have a configure file? if it doesn't you should make it, but we will not talk about it in this guide so we have a configure file, great. lets start. a. change directory to you myproject-1.2 directory Code:
cd myproject-1.2 Code:
dh_make -e youremail@site.org -f ../myproject-1.2.tar.bz2 Type of package: single binary, multiple binary, library, or kernel module? [s/m/l/k] now, it will ask if myproject-1.2 is a s = [single binary] - a normal one package deb l = [library] - choose that you are making package of something like libmyproject-dev m = [multiple] - multiple binary packages k = [kernel module] - a kernel module now it will ask: Code:
Maintainer name : firstname lastname Email-Address : youmail@site.org Date : Thu, 21 Jul 2005 18:52:02 +0000 Package Name : myproject Version : 1.2 Type of Package : Single Binary Hit <enter> to confirm: Code:
ls there are many files in debian/ directory, files that you need to edit/remove. Lets start with control. Edit this file with your favorite editor (I usually use nano). Code:
1 Source: myproject
2 Section: unknown
3 Priority: optional
4 Maintainer: firstname lastname <yourmail@site.org>
5 Build-Depends: debhelper (>> 3.0.0)
6 Standards-Version: 3.6.1
7
8 Package: myproject
9 Architecture: any
10 Depends: ${shlibs:Depends}
11 Description: <insert up to 60 chars description>
12 <insert long description, indented with spaces>
Line 2 - what kind of package - games, sound, gnome, kde, x11... Line 3 - How important is the package (you can keep like that) Line 4 - you first, last name and your email on <> Line 5 - all of the -dev packages that you need to compile this package, for exampe - libnothing-dev, you can check these depends with a script that Debian made: -create new text file and paste this Code:
strace -f -o /tmp/log ./configure
# or make instead of ./configure, if the package doesn't use autoconf
for x in `dpkg -S $(grep open /tmp/log|\
perl -pe 's!.* open\(\"([^\"]*).*!$1!' |\
grep "^/"| sort | uniq|\
grep -v "^\(/tmp\|/dev\|/proc\)" ) 2>/dev/null|\
cut -f1 -d":"| sort | uniq`; \
do \
echo -n "$x (>=" `dpkg -s $x|grep ^Version|cut -f2 -d":"` "), "; \
done
run this script: Code:
sh ../script now in the end of the script you will see all the depends of the package, copy to line 5 only the packages that end with -dev Line 6 - the version of Debian Policy. Line 7 - a space Line 8 - the new package name, I keep it like the source one (Line 1) Line 9 - Any which means every architecture that you are trying to compile on, if you want only amd64, put there amd64 Line 10 - run the script that we made again, and fill here every package that doesn't end with -dev. Line 11 - a short description up to 60 chars. Line 12 - as you can see, there is a space before the description, keep it like that! and fill there a full description. if you want to do a space between 2 lines fill a . (dot). After an edit: Code:
1 Source: myproject
2 Section: gnome
3 Priority: optional
4 Maintainer: firstname lastname <yourmail@site.org>
5 Build-Depends: debhelper (>> 3.0.0), libnothing-dev
6 Standards-Version: 3.6.1
7
8 Package: myproject
9 Architecture: amd64 i386 powerpc
10 Depends: ${shlibs:Depends}, mozilla-firefox, gnome-core
11 Description: My project is a web-browser.
12 You can -
* surf in the internet
* enter to google site!
* download ubuntu
* buy from the internet an amd64 box!
.
* another text....
Code:
1 myproject (1.2-1) unstable; urgency=low
2
3 * Initial Release.
4
5 -- firstname lastname <yourmail@site.org> Thu, 21 Jul 2005 18:52:02 +0000
6
, the dist - change to warty/hoary/breezy Line 2 - a space Line 3 - * what you did to the package, what is that for. Line 4 - a space Line 5 - your firstname, lastname, <email>, and a full date. After an edit (if my package originated in Debian): Code:
1 myproject (1.2-1ubuntu1) hoary; urgency=low
2
3 * ubuntu linux amd64 package for hoary hedgedog.
* a stable relese.
4
5 -- firstname lastname <yourmail@site.org> Thu, 21 Jul 2005 18:52:02 +0000
6
Code:
1 myproject (1.2-0ubuntu1) hoary; urgency=low
2
3 * ubuntu linux amd64 package for hoary hedgedog.
* a stable relese.
4
5 -- firstname lastname <yourmail@site.org> Thu, 21 Jul 2005 18:52:02 +0000
6
Code:
1 This package was debianized by firstname lastname <yourmail@site.org> on
2 Thu, 21 Jul 2005 18:52:02 +0000
3
4 It was downloaded from <fill in ftp site>
5
6 Upstream Author(s): <put author(s) name and email here>
7
8 Copyright:
9
10 <Must follow here>
Line 2 - the full date Line 3 - a space Line 4 - where did you download the source from? Line 5 - a space Line 6 - The authors, usually the is a file named - AUTHORS on the main directory Line 7 - a space Line 8 - the licence type, who made the source, and when. Line 9 - a space Line 10 - the full licence After an edit: Code:
1 This package was debianized by firstname lastname <yourmail@site.org> on
2 Thu, 21 Jul 2005 18:52:02 +0000
3
4 It was downloaded from: http://thesource-site.com/files/
5
6 Upstream author: Author full name <hisemail@site.org>
7
8 This software is copyright (c) 2005-08 by Author full name, Obsession
9 Development.
10
11 You are free to distribute this software under the terms of
12 the GNU General Public License.
13 On Debian systems, the complete text of the GNU General Public
14 License can be found in the file `/usr/share/common-licenses/GPL'.
Code:
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # This is the debhelper compatibility version to use.
9 export DH_COMPAT=4
10
11 CFLAGS = -g
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13 CFLAGS += -O0
14 else
15 CFLAGS += -O2
16 endif
17
18 build: build-stamp
19 build-stamp:
20 dh_testdir
21
22 # Add here commands to compile the package.
23 $(MAKE)
24 #docbook-to-man debian/myproject.sgml > myproject.1
25
26 touch build-stamp
27
28 clean:
29 dh_testdir
30 dh_testroot
31 rm -f build-stamp
32
33 # Add here commands to clean up after the build process.
34 -$(MAKE) clean
35
36 dh_clean
37
38 install: build
39 dh_testdir
40 dh_testroot
41 dh_clean -k
42 dh_installdirs
43
44 # Add here commands to install the package into debian/gentoo.
45 $(MAKE) install DESTDIR=$(CURDIR)/debian/myproject
46
47 # Build architecture-independent files here.
48 binary-indep: build install
49 # We have nothing to do by default.
50
51 # Build architecture-dependent files here.
52 binary-arch: build install
53 dh_testdir
54 dh_testroot
55 # dh_installdebconf
56 dh_installdocs
57 dh_installexamples
58 dh_installmenu
59 # dh_installlogrotate
60 # dh_installemacsen
61 # dh_installpam
62 # dh_installmime
63 # dh_installinit
64 dh_installcron
65 dh_installman
66 dh_installinfo
67 # dh_undocumented
68 dh_installchangelogs ChangeLog
69 dh_link
70 dh_strip
71 dh_compress
72 dh_fixperms
73 # dh_makeshlibs
74 dh_installdeb
75 # dh_perl
76 dh_shlibdeps
77 dh_gencontrol
78 dh_md5sums
79 dh_builddeb
80
81 binary: binary-indep binary-arch
82 .PHONY: build clean binary-indep binary-arch binary install
Line 22 - add compiling commands Line 33 - add clean commands Line 44 - add installation commands Save. we did 80%. now, there are some another files. Lets edit the file: README.debian Code:
myproject for Debian --------------- <possible notes regarding this package - if none, delete this file> -- firstname lastname <yourmail@site.org>, Thu, 21 Jul 2005 18:52:02 +0000 after edit: Code:
myproject for Debian --------------- this package is an open source code, do what ever you want. feel free to send any bugs, questions to yourmail@site.org. -- firstname lastname <yourmail@site.org>, Thu, 21 Jul 2005 18:52:02 +0000 init.d.ex - If your package is a daemon that needs to be run at system startup, keep this file, if not, remove. manpage.1.ex, manpage.sgml.ex - if your program has man pages, you can remove these, if doesn't, you can fill it. postinst.ex, preinst.ex, postrm.ex, prerm.ex These files are called maintainer scripts. They are scripts which are put in the control area of the package and run by dpkg when your package is installed, upgraded or removed. For now, you should try to avoid any manual editing of maintainer scripts if you possibly can because they tend to get complex Building the .deb file for full build of the package (build source, deb, clean...) run: Code:
dpkg-buildpackage -rfakeroot Code:
fake root debian/rules binary /home/myusername/packages/myproject/ - myproject_1.2.orig.tar.gz - the original source code tarball - myproject_1.2-1.diff.gz - this file contains all the changes you made to the original source code. - myproject_1.2-1.dsc - generated file from debian/control, contains summary of the contents of the source code - myproject_1.2-1_amd64.deb - this is the debian binary package you made! - myproject_1.2-1_amd64.changes - like a changlog file. please send every amd64 package that you made + .orig.tar.gz, .dsc, .diff to tamir@nooms.de. I will upload to my repository. Last edited by Tamir; August 3rd, 2005 at 08:32 AM.. |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2005
Beans: 29
|
Re: Howto make debian standarts debs from scratch
Wow. Thanks for the guide. This is really helpful. I'll start using it to make .debs the right way. Let's keep those requests coming!
Question, though - when you say "standart", do you mean "standard"? |
|
|
|
|
|
#3 | |
|
Way Too Much Ubuntu
![]() |
Re: Howto make debian standarts debs from scratch
Quote:
My english is not very well. |
|
|
|
|
|
|
#4 | |
|
Dipped in Ubuntu
![]() Join Date: Apr 2005
My beans are hidden!
|
Re: Howto make debian standards debs from scratch
Quote:
|
|
|
|
|
|
|
#5 | |
|
A Carafe of Ubuntu
![]() |
Re: Howto make debian standards debs from scratch
Quote:
I don't find it in the usual repositories? Great work with the guide. You do a lot of good work for the Ubuntu community. |
|
|
|
|
|
|
#6 | |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2005
Beans: 29
|
Re: Howto make debian standards debs from scratch
Quote:
- Download and extract the source code of the program you want to build. - Change to its directory. - Type "./configure". This sets up a configure file so the "make" program knows how to compile the program for your computer. - Type "make" - this performs the compilation. "make" will compile the program according to your configure script in the current directory. |
|
|
|
|
|
|
#7 | |
|
Way Too Much Ubuntu
![]() |
Re: Howto make debian standards debs from scratch
Quote:
|
|
|
|
|
|
|
#8 | |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2005
Location: France
Beans: 16
Ubuntu 6.10 Edgy
|
Re: Howto make debian standards debs from scratch
If I may add just one small trick...
Quote:
|
|
|
|
|
|
|
#9 |
|
Way Too Much Ubuntu
![]() |
Re: Howto make debian standards debs from scratch
Ok, I didn't know it, thanks. I have to ask - is that Yoda from starwars on your avatar?
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|