- Loading...
- No images or files uploaded yet.
|
|
How to create deb packagesHow to 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//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
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
Code:
lsthere 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: myprojectLine 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 ./configurerun this script:
Code:
sh ../scriptnow 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
Code:
1 myproject (1.2-1) unstable; urgency=low
, 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
Code:
1 myproject (1.2-0ubuntu1) hoary; urgency=low
Code:
1 This package was debianized by firstname lastname <yourmail@site.org> onLine 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
Code:
1 #!/usr/bin/make -fLine 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 Debianafter edit:
Code:
myproject for Debian
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 binaryIf you don't have problems, you will get these 5 files on: /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.
:) You made your first deb!
Source: http://ubuntuforums.org/showthread.php?t=51003
-geekydude
|
Comments (0)
You don't have permission to comment on this page.