然后,您需要一个debian-binary文件:echo 2.0 > debian-binary.在构建文件夹中,现在应该具有以下文件:debian-binary control.tar.gz和data.tar.gz.最后,您需要ar包来创建.deb文件:ar -r xxx.deb debian-binary control.tar.gzdata.tar.gz来源: https://unix.stackexchange .com/questions/30303/how-to-to-create-a-deb-file-manually/30330#30330 I need to create a new .deb package of Realxtend project (https://github.com/realXtend/naali). It's a huge project with a lot of dependencies and a automatic bash script (/tools/Linux/build-deps.bash) to download, compile and install all deps and executables. So I try many tutorials but I often some errors and i'm stuck because tutorials are outdated (with new 'rules' file mainly) ...and also because i'm not a dev initialy.So, for beginning, I just need create a .deb file exactly like an simple archive ie not interpret any building process, 'makefile', or others kind of things. I would like just compress/uncompress a .deb file contains all project already configured with all dependencies like a .zip file with any folder, uncompress all content just next the archive.I have 2 folders /naali and /naali-deps with various files (exe, src, lib,...) configured with running build-deps.bash on Ubuntu Precise x64. I run dh_make, clean and fill /debian files (changelog, control, copyright), create a gpg key and run sudo debuild -us -uc -k0xCODE (i heard 'sudo' it's "bad" but i don't know without...)I get this : dpkg-buildpackage -rfakeroot -D -us -ucdpkg-buildpackage: warning: using a gain-root-command while being rootdpkg-buildpackage: source package realxtenddpkg-buildpackage: source version 0-1dpkg-buildpackage: source changed by sylvain Bicherel <[email protected]> dpkg-source --before-build realxtend-0dpkg-buildpackage: host architecture amd64 fakeroot debian/rules cleandh clean dh_testdir dh_auto_clean dh_clean dpkg-source -b realxtend-0dpkg-source: info: using source format `3.0 (quilt)'dpkg-source: info: building realxtend using existing ./realxtend_0.orig.tar.gzdpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/Extras/CDTestFramework/License.txt.bakdpkg-source: warning: ignoring deletion of directory naali-deps/build/bullet-2.81-rev2613/autom4te.cachedpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/autom4te.cache/traces.1dpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/autom4te.cache/output.1dpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/autom4te.cache/requestsdpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/autom4te.cache/traces.0dpkg-source: warning: ignoring deletion of file naali-deps/build/bullet-2.81-rev2613/autom4te.cache/output.0dpkg-source: info: building realxtend in realxtend_0-1.debian.tar.gzdpkg-source: info: building realxtend in realxtend_0-1.dsc debian/rules builddh build dh_testdir dh_auto_configure dh_auto_build dh_auto_test fakeroot debian/rules binarydh binary dh_testroot dh_prep dh_installdirs dh_auto_install dh_install dh_installdocs dh_installchangelogs dh_installexamples dh_installman dh_installcatalogs dh_installcron dh_installdebconf dh_installemacsen dh_installifupdown dh_installinfo dh_installinit dh_installmenu dh_installmime dh_installmodules dh_installlogcheck dh_installlogrotate dh_installpam dh_installppp dh_installudev dh_installwm dh_installxfonts dh_installgsettings dh_bugfiles dh_ucf dh_lintian dh_gconf dh_icons dh_perl dh_usrlocal dh_link dh_compress dh_fixperms dh_strip dh_makeshlibs dh_shlibdeps dh_installdeb dh_gencontroldpkg-gencontrol: warning: Depends field of package realxtend: unknown substitution variable ${shlibs:Depends} dh_md5sums dh_builddebdpkg-deb : construction du paquet « realxtend » dans « ../realxtend_0-1_amd64.deb ». dpkg-genchanges >../realxtend_0-1_amd64.changesdpkg-genchanges: including full source code in upload dpkg-source --after-build realxtend-0dpkg-buildpackage: full upload (original source is included)Now running lintian...warning: the authors of lintian do not recommend running it with root privileges!W: realxtend source: configure-generated-file-in-source naali-deps/build/celt-0.11.1/config.statusW: realxtend source: configure-generated-file-in-source naali-deps/build/celt-0.11.1/config.logW: realxtend: new-package-should-close-itp-bugW: realxtend: empty-binary-packageFinished running lintian....so i need help on :1) Do you know a updated and complete tutorial (for newbie) other than 'Debian New Maintainer' and irc/maillist like #debian-dev... -> see Phpdna link and for specific sources packaging where i understand my error and use dpkg-source cmd : http://debian-handbook.info/browse/wheezy/sect.source-package-structure.html2) How do make a 'debianization' of my project ? -> with dh_make then dpkg-buildpackage -rfakeroot, it's the (a) good way3) Where are my errors ? -> empty-binaries-files lintian warning is normal, then wrong cmd : need dpkg-source, not dpkg-deb4) What should I do with ${shlibs:Depends} ? -> an automatic lib-deps-links thing, i don't mind on that now5) Why I have a empty-binary-package ? -> in fact, all data already build stay in .orig.tar.gz in my caseThanks a lot if you can enlighten me on .deb package magic.EDIT :So i found the final cmd i need, just dpkg-source -x projet-version.dsc. I didn't understand .deb file contents only changes and i stucked with debuild and dpkg-deb -... cmds for building not for extract sources (and any files).Solution :sudo apt-get install debhelper build-essential dh-makecreate folder /project with another folder into contains all project named /project-versiondh_make --createorig in /project-version + rm -rf *ex *EX README* in /debian + fill correctly /debian/{rules;copyright;changelog}dpkg-buildpackage -rfakeroot with -us -uc or -k0x[GPG-KEY] in /project-versionKeep always together {project_version.orig.tar.gz (all data projects); project_version.debian.tar.gz (modifs); project_version_all/any.deb (modifs); project_version_arch.changes (meta); project_version.dsc (meta)}Run dpkg-source -x projet-version.dsc to extract projectSo now, go to add some automatic scripts with it and as soon as it will succes, i will mark resolved. 解决方案 First off you need to create a build folder and an archive of your files: tar czvf data.tar.gz filesThen in the build folder you must create a control file with some wanted informations: Package: xxxxxx Version: 0.0.1 Section: user/hidden Priority: optional Architecture: armel Installed-Size: `du -ks usr|cut -f 1` Maintainer: [email protected]>Then you can add independently preinst, postint, prerm and postrm shell scripts to control pre and post install and pre and post remove behaviour of the .deb file and then you can create the control archive with tar: tar czvf control.tar.gz control preinst postinst prerm postrmThen you need a debian-binary file: echo 2.0 > debian-binary. In your build folder you should have now these files: debian-binary control.tar.gz and data.tar.gz.Finally you need ar package to create the .deb file: ar -r xxx.deb debian-binary control.tar.gzdata.tar.gzSource: https://unix.stackexchange.com/questions/30303/how-to-create-a-deb-file-manually/30330#30330 这篇关于如何创建一个简单的debian软件包(仅压缩/提取源文件或任何带有debian软件包的文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-30 19:32