clemens@kclee.com
2002.11.30, $Date: 2003/12/19 20:07:14 $
Verzi�t�rt�net | ||
---|---|---|
Verzi�: 3.0 | 2003.12.19 | �tdolgozta: ccl |
K�t el�r�s jav�t�sa Claudio Cattazzo jelz�se alapj�n. | ||
Verzi�: 2.0 | 2003.12.13 | �tdolgozta: ccl |
Frank Lichtenheld visszajelz�s�nek figyelembe v�tele. | ||
Verzi�: 1.0 | 2003.11.08 | �tdolgozta: ccl |
Els� kiad�s. |
Egy teljesen �jonnan elk�sz�tett arch�vumot (f�jl, program, szkript, csomag stb. - a ford.) el�sz�r mindig a saj�t rendszeredre telep�tsd, ne tedd bele r�gt�n a hivatalos Debian disztrib�ci�ba. Tanulm�nyozd a "hivatalos" Debian New Maintainers' Guide (�j Debian karbantart�k k�zik�nyve) le�r�st.
A szab�lyos Debian csomagok egy komplett forr�s-csomagot tartalmaznak, az ebben l�v� debian/rules f�jl automatikusan v�grehajtja a megfelel� l�p�seket, bele�rtve a bin�ris elk�sz�t�s�t is. Itt mi most csak azt mutatjuk be, hogyan tegy�nk bele egy kis bin�ris csomagba egy egyszer� shell szkriptet, vagy egy futtathat� bin�rist.
Felt�telezem, hogy tudod haszn�lni a "tar �s "man" parancsokat, valamint tudod mi a ".tar.gz" f�jl �s a Debian (illetve egy szerkeszt� haszn�lat�t ;-), de azt is felt�telezem, hogy m�g soha nem foglalkozt�l az olyan programokkal, mint az "ar", vagy a "dpkg".
A Debian Reference (Debian referencia) egy kit�n� �ttekint�st, valamint r�szletes inform�ci�t ny�jt a Debian minden saj�toss�g�r�l.
A Debian csomagk�sz�t�s hivatalos dokument�ci�ja a Debian New Maintainers' Guide (�j Debian karbantart�k k�zik�nyve).
A magyar ford�t�st Z�honyi Lor�nd Istv�n k�sz�tette (2004.06.01). A lektor�l�st Daczi L�szl� v�gezte el (2004.06.02). A dokumentum legfrissebb v�ltozata megtal�lhat� a Magyar Linux Dokument�ci�s Projekt honlapj�n.
$ ar tv parted_1.4.24-4_i386.deb rw-r--r-- 0/0 4 Mar 28 13:46 2002 debian-binary rw-r--r-- 0/0 1386 Mar 28 13:46 2002 control.tar.gz rw-r--r-- 0/0 39772 Mar 28 13:46 2002 data.tar.gz |
drwxr-xr-x root/root 0 2002-03-28 13:44:57 ./ drwxr-xr-x root/root 0 2002-03-28 13:44:49 ./sbin/ -rwxr-xr-x root/root 31656 2002-03-28 13:44:49 ./sbin/parted drwxr-xr-x root/root 0 2002-03-28 13:44:38 ./usr/ drwxr-xr-x root/root 0 2002-03-28 13:44:41 ./usr/share/ drwxr-xr-x root/root 0 2002-03-28 13:44:38 ./usr/share/man/ drwxr-xr-x root/root 0 2002-03-28 13:44:52 ./usr/share/man/man8/ -rw-r--r-- root/root 1608 2002-03-28 13:44:37 ./usr/share/man/man8/parted.8.gz drwxr-xr-x root/root 0 2002-03-28 13:44:41 ./usr/share/doc/ drwxr-xr-x root/root 0 2002-03-28 13:44:52 ./usr/share/doc/parted/ -rw-r--r-- root/root 1880 2002-03-07 14:20:08 ./usr/share/doc/parted/README.Debian -rw-r--r-- root/root 1347 2002-02-27 01:40:50 ./usr/share/doc/parted/copyright -rw-r--r-- root/root 6444 2002-03-28 13:37:33 ./usr/share/doc/parted/changelog.Debian.gz -rw-r--r-- root/root 15523 2002-03-28 02:36:43 ./usr/share/doc/parted/changelog.gz |
A mi p�ld�nkban ez a f�jl a k�vetkez�ket tartalmazza:
-rw-r--r-- 1 root root 1336 Mar 28 2002 control -rw-r--r-- 1 root root 388 Mar 28 2002 md5sums -rwxr-xr-x 1 root root 253 Mar 28 2002 postinst -rwxr-xr-x 1 root root 194 Mar 28 2002 prerm |
"md5sums" a data.tar.gz �sszes f�jlj�nak az md5sum kivonat�t. A p�ld�nkban ez �gy n�z ki:
1d15dcfb6bb23751f76a2b7b844d3c57 sbin/parted 4eb9cc2e192f1b997cf13ff0b921af74 usr/share/man/man8/parted.8.gz 2f356768104a09092e26a6abb012c95e usr/share/doc/parted/README.Debian a6259bd193f8f150c171c88df2158e3e usr/share/doc/parted/copyright 7f8078127a689d647586420184fc3953 usr/share/doc/parted/changelog.Debian.gz 98f217a3bf8a7407d66fd6ac8c5589b7 usr/share/doc/parted/changelog.gz |
�s v�g�l a leg�rdekesebb f�jl:
$ cat control Package: parted Version: 1.4.24-4 Section: admin Priority: optional Architecture: i386 Depends: e2fsprogs (>= 1.27-2), libc6 (>= 2.2.4-4), libncurses5 (>= \ 5.2.20020112a-1), libparted1.4 (>= 1.4.13+14pre1), libreadline4 (>= \ 4.2a-4), libuuid1 Suggests: parted-doc Conflicts: fsresize Replaces: fsresize Installed-Size: 76 Maintainer: Timshel Knoll <timshel@debian.org> Deszkription: The GNU Parted disk partition resizing program GNU Parted is a program that allows you to create, destroy, resize, move and copy hard disk partitions. This is useful for creating space for new operating systems, reorganizing disk usage, and copying data to new hard disks. . This package contains the Parted binary and manual page. . Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 disklabels/partition tables, as well as a 'loop' (raw disk) type which allows use on RAID/LVM. Filesystems supported are ext2, ext3, FAT (FAT16 and FAT32) and linux-swap. Parted can also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS filesystems, but cannot create/remove/resize/check these filesystems yet. . The nature of this software means that any bugs could cause massive data loss. While there are no known bugs at the moment, they could exist, so please back up all important files before running it, and do so at your own risk. |
A "man 5 deb-control" parancs kiad�s�val tov�bbi inform�ci�kat tudhatsz meg a control f�jlr�l.
$ mkdir -p ./debian/usr/bin $ cp linuxstatus ./debian/usr/bin |
$ dkpg -S /bin/cat coreutils: /bin/cat |
Egy�bk�nt k�t tov�bbi m�don is hozz�juthatsz ilyen inform�ci�khoz. A http://www.debian.org/distrib/packages honlapon Debian f�jlokat kereshetsz. T�ltsd ki az oldal alj�n l�v� mez�ket.
V�g�l, de nem utols� sorban van egy frank� GUI alkalmaz�s (grafikus program - a ford.), "kpackage", mely k�nyelmes csomagok k�zti b�ng�sz�si lehet�s�get ny�jt, �s egyedi f�jlok alapj�n is lehets�ges csomagot keresni. (kipr�b�ltam, megette az �sszes mem�ri�mat (128M mem + 256M swap), �gy kellett lel�n�m t�voli g�pr�l, sz�val �n ink�bb a karakteres csomagkezel� programok haszn�lat�t javaslom - a ford.)
A "Suggests", "Conflicts", �s a "Replaces" stb. mez�ket ki lehet hagyni, ha nem sz�ks�gesek.
�me az els� "control" f�jlunk eredm�nye:
Package: linuxstatus Version: 1.1-1 Section: base Priority: optional Architecture: all Depends: bash (>= 2.05a-11), textutils (>= 2.0-12), awk, procps (>= \ 1:2.0.7-8), sed (>= 3.02-8), grep (>= 2.4.2-3), coreutils (>= 5.0-5) Maintainer: Chr. Clemens Lee <clemens@kclee.com> Deszkription: Linux system information This szkript provides a broad overview of different system aspects. |
A "control" f�jlt m�sold a "debian" k�nyvt�rban l�v� "DEBIAN" k�nyvt�rba.
$ mkdir -p debian/DEBIAN $ find ./debian -type d | xargs chmod 755 # a Debian Woodyn�l ez sz�ks�ges, ne k�rdezd, hogy mi�rt $ cp control debian/DEBIAN |
Ha nagy val�sz�n�s�ggel t�bben fogj�k haszn�lni a csomagodat a j�v�ben, akkor seg�thet a Writing Debian package descriptions (Le�r�s k�sz�t�se Debian csomaghoz) cikk.
M�r majdnem k�sz van. Most g�peld be:
$ dpkg-deb --build debian dpkg-deb: building package `linuxstatus' in `debian.deb'. $ mv debian.deb linuxstatus_1.1-1_all.deb |
root# dpkg -i ./linuxstatus_1.1-1_all.deb |
Ha �rdekelnek verzi�sz�moz�si s�m�k �s a n�vv�laszt�si konvenci�k a Debian csomagok tekintet�ben, akkor olvasd el ezt a bekezd�st a Debian Reference (Debian referencia) le�r�sban.
Most haszn�ld ezt a nagyszer� eszk�zt a csomagod ellen�rz�s�hez:
$ lintian linuxstatus_1.1-1_all.deb E: linuxstatus: binary-without-manpage linuxstatus E: linuxstatus: no-copyright-file W: linuxstatus: prerm-does-not-remove-usr-doc-link W: linuxstatus: postinst-does-not-set-usr-doc-link |
Nem itt kellene le�rnom a k�zik�nyv oldalak k�sz�t�s�nek m�dj�t, egy csom� k�nyv van, ahol egy vagy t�bb fejezet foglalkozik ezzel a t�m�val, ezeken k�v�l pedig elolvashatod a Linux Man Page Howto (Linux k�zik�nyv oldal HOGYAN) le�r�st, mely az interneten el�rhet�. Sz�val tekints�nk el ett�l, �s tegy�k fel, hogy van egy megfelel� k�zik�nyv oldal a szkriptedhez a ./man/man1/linuxstatus.1 helyen.
Ugyanez a helyzet a "copyright" f�jllal is. Elegend� p�ld�t tal�lsz a /usr/share/doc k�nyvt�rban a find /usr/share/doc -name "copyright" parancs seg�ts�g�vel.
�me a saj�t p�ld�nk a "copyright" f�jlra:
linuxstatus Copyright: Chr. Clemens Lee <clemens@kclee.com> 2002-12-07 The home page of linuxstatus is at: http://www.kclee.com/clemens/unix/index.html#linuxstatus The entire code base may be distributed under the terms of the GNU General Public License (GPL), which appears immediately below. Alternatively, all of the source code as any code derived from that code may instead be distributed under the GNU Lesser General Public License (LGPL), at the choice of the distributor. The complete text of the LGPL appears at the bottom of this file. See /usr/share/common-licenses/(GPL|LGPL) |
A "prerm" �s "postinst" szkripteket egyt�l egyig m�sold be a p�ld�ban szerepl� "parted" csomagb�l, ugyanazzal a n�vvel, a saj�t csomagod k�nyvt�r�ba. Ezeknek a f�jloknak megfelel�en m�k�dni�k kell.
Most ism�t k�sz�tsd el a debian csomagunkat, de el�bb a "control" f�jlban megn�veld a verzi�sz�mot 1.1-1-r�l 1.2-1-re (ha �runk egy �j k�zik�nyv oldalt, akkor n�velj�k a saj�t bels� kiad�si sz�mot). Az �j f�jlokat is el kell helyezned a megfelel� helyen:
$ mkdir -p ./debian/usr/share/man/man1 $ mkdir -p ./debian/usr/share/doc/linuxstatus $ find ./debian -type d | xargs chmod 755 $ cp ./man/man1/linuxstatus.1 ./debian/usr/share/man/man1 $ cp ./copyright ./debian/usr/share/doc/linuxstatus $ cp ./prerm ./postinst ./debian/DEBIAN $ gzip --best ./debian/usr/share/man/man1/linuxstatus.1 $ $ dpkg-deb --build debian dpkg-deb: building package `linuxstatus' in `debian.deb'. $ mv debian.deb linuxstatus_1.2-1_all.deb |
A gzip sz�ks�ges, mert a lintian elv�rja, hogy a k�zik�nyv oldal f�jlja, amennyire csak lehet, t�m�r�tve legyen.
No, akkor n�zz�k, hogy a csomagunk debian tulajdons�gai javultak-e.
$ lintian linuxstatus_1.2-1_all.deb E: linuxstatus: control-file-has-bad-owner prerm clemens/clemens != root/root E: linuxstatus: control-file-has-bad-owner postinst clemens/clemens != root/root E: linuxstatus: bad-owner-for-doc-file usr/share/doc/linuxstatus/ clemens/clemens != root/root E: linuxstatus: bad-owner-for-doc-file usr/share/doc/linuxstatus/copyright clemens/clemens != root/root E: linuxstatus: debian-changelog-file-missing |
$ fakeroot dpkg-deb --build debian dpkg-deb: building package `linuxstatus' in `debian.deb'. $ mv debian.deb linuxstatus_1.2-1_all.deb $ lintian linuxstatus_1.2-1_all.deb E: linuxstatus: debian-changelog-file-missing |
�me egy p�lda a "changelog" f�jlra:
linuxstatus (1.2-1) * A lintian �ltal jegyzett hib�k jav�t�sa. -- Chr. Clemens Lee <clemens@kclee.com> 2002-12-13 |
itt pedig egy "changelog.Debian" p�lda:
A linuxistatus Debian karbantart�ja �s a f� v�ltozat szerz�je megegyezik, ez�rt n�zd meg a Debian valtoz�sok changelogj�t is. |
A changelog f�jl form�tum�t illet�en a Debian ir�nyvonal m�g r�szletesebb.
Rem�lhet�leg most k�vetkezik az utols� l�p�s:
$ cp ./changelog ./changelog.Debian ./debian/usr/share/doc/linuxstatus $ gzip --best ./debian/usr/share/doc/linuxstatus/changelog $ gzip --best ./debian/usr/share/doc/linuxstatus/changelog.Debian $ fakeroot dpkg-deb --build ./debian dpkg-deb: building package `linuxstatus' in `debian.deb'. $ mv debian.deb linuxstatus_1.2-1_all.deb $ lintian linuxstatus_1.2-1_all.deb |
Ah, m�r nem panaszkodik t�bb� a lintian :-). Most root felhaszn�l�k�nt telep�theted a csomagot a r�gire, a megszokott "dpkg -i" paranccsal.
root# dpkg -i ./linuxstatus_1.2-1_all.deb (Reading database ... 97124 files and directories currently installed.) Preparing to replace linuxstatus 1.1-1 (using linuxstatus_1.2-1_all.deb) ... Unpacking replacement linuxstatus ... Setting up linuxstatus (1.2-1) ... |
Hogy ne kavarodj �ssze, id�zz�k fel a bin�ris Debian csomag elk�sz�t�s�nek �sszes l�p�s�t.
A helyi "debian" k�nyvt�r el�k�sz�t�se:
k�sz�tsd el a "debian/usr/bin" k�nyvt�rat (vagy ahov� a futtathat� f�jlokat szeretn�d telep�teni)
k�sz�tsd el a "debian/usr/share/doc/<csomag_nev>" k�nyvt�rat
M�sold be a f�jlokat a helyi "debian" fa-strukt�r�ba:
m�sold a futtathat� f�jlokat a "debian/usr/bin" k�nyvt�rba (vagy ahov� telep�teni szeretn�d �ket)
m�sold a k�zik�nyv oldalt a "debian/usr/share/man/man1 k�nyvt�rba
Ha valaki k�vetkez� l�p�sk�nt Debian csomagk�nt is k�zz� szeretn� tenni szoftver�t, �gy el�sz�r a Debian New Maintainers' Guide (�j Debian karbantart�k k�zik�nyve) valamint Debian Policy Manual (Debian ir�nyvonal k�zik�nyv) le�r�sokat tanulm�nyozza el�sz�r. Ha Debian forr�s csomag k�sz�t�s�be fogsz bele, akkor l�togass el a debian-mentors (debian-tanacsad�k) levelez� list�j�ra is, hogy tapasztalatokat szerezz, bekapcsol�dj a p�rbesz�dbe, melynek sor�n tippeket kaphatsz az el�fordul� probl�m�k megold�s�ra.
K�sz�net az al�bbi embereknek:
Tabatha Marshall: a TLDP projektb�l, �ltal�nos seg�ts�g,
Joey Hess, Carlo Perassi, �s Joe Riel: kisebb korrekci�k,
Claudio Cattazzo: a saj�t xml dokumentumom docbook form�tumra konvert�l�sa, mely sz�mos kisebb korrekci�t �s fejleszt�st eredm�nyezett [2003.10.04].
Frank Lichtenheld: a HTML oldalak gener�l�sakor fell�p� hib�kra f�lh�vta a figyelmet, valamint felvetette a "dpkg -S <f�jl>" parancs haszn�lat�t, amikor egy bizonyos f�jlra keres�nk a csomagban [2003.12.13].
Hugh Hartmann: elk�sz�tette a HOGYAN olasz ford�t�s�t, Claudio Cattazzo: lektor�lta a ford�t�st [2003.12.13].
Debian New Maintainers' Guide (�j Debian Karbantart�k �tmutat�ja): � | http://www.debian.org/doc/maint-guide/ |
Debian: � | http://www.debian.org/ |
The Debian Reference (Debian referencia): � | http://www.debian.org/doc/manuals/reference/reference.en.html |
Debian csomagok: � | http://www.debian.org/distrib/packages |
Writing Debian package descriptions (Le�r�s k�sz�t�se Debian csomaghoz): � | http://people.debian.org/~walters/descriptions.html |
Linux Man Page Howto (Linux k�zik�nyv oldal HOGYAN): � | http://www.tldp.org/HOWTO/mini/Man-Page.html |
Debian Policy Manual (Debian ir�nyvonal k�zik�nyv oldal): � | http://www.debian.org/doc/debian-policy/ |
Debian Mentors (debian tan�csad�s): � | http://lists.debian.org/debian-mentors/ |
The Linux Documentation Project (a Linux Dokument�ci�s Projekt honlapja): � | http://www.tldp.org/ |
Plusz az �n saj�t kis Unix honlapom: � | http://www.kclee.com/clemens/unix/ |