{"id":13,"date":"2008-07-28T15:47:25","date_gmt":"2008-07-28T19:47:25","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=13"},"modified":"2010-07-21T20:03:51","modified_gmt":"2010-07-22T01:03:51","slug":"building-deb-packages-on-ubuntudebian","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2008\/07\/28\/building-deb-packages-on-ubuntudebian\/","title":{"rendered":"Building .deb packages on Ubuntu\/Debian"},"content":{"rendered":"<p>Ever wanted to create your very own .deb packages for Ubuntu and Debian? Well, here&#8217;s a guide to tell you how in 10 easy steps!<\/p>\n<ol>\n<li>Create the directory to hold the package by using:<br \/>\nmkdir package<\/li>\n<li>Change into the package directory:<br \/>\ncd package\/<\/li>\n<li>Make the package file system. For example, any files you put into the usr folder in this folder will go to \/usr when installed. You can create them as necessary.<br \/>\nmkdir usr<br \/>\nmkdir usr\/bin<br \/>\nmkdir usr\/lib<br \/>\nmkdir etc<\/li>\n<li>Copy the application files to the appropriate directories; For example, if you want file FooBar.sh to be installed in \/usr\/bin, copy FooBar.sh to the usr\/bin folder. <strong>Below is a demo, assuming no dependencies.<br \/>\n<\/strong>cp \/path\/to\/files\/a.sh usr\/bin<br \/>\ncp \/path\/to\/files\/a.conf etc<br \/>\ncp \/path\/to\/files\/liba-4.so usr\/lib<\/li>\n<li><strong>(required) <\/strong>Create the Debian control file. There is a specification file here: <a href=\"http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html\">http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html<\/a><br \/>\ntouch DEBIAN\/control<br \/>\n<em>editor-of-your-choice <\/em>DEBIAN\/control<\/li>\n<li><strong>(optional)<\/strong> Create the postinstall file. This file is exectuted during the installation. Note that this file should be a shell script.<br \/>\ntouch DEBIAN\/postinstall<br \/>\n<em>editor-of-your-choice<\/em> DEBIAN\/postinstall<\/li>\n<li><strong>(optional) <\/strong>Create the prerm file. This file is executed during the removal of this package. Note that this file should be a shell script.<br \/>\ntouch DEBIAN\/prerm<br \/>\n<em>editor-of-your-choice<\/em> DEBIAN\/prerm<\/li>\n<li>You&#8217;re almost ready to create the package! Change into the parent directory to begin.<br \/>\ncd ..<\/li>\n<li>Now we can finally begin! This may take from 2 seconds to 24 hours, depending on the size of the package and the speed of your computer.<br \/>\ndpkg-deb &#8211;build package<\/li>\n<li>You&#8217;re done! The package is package.deb. To install it:<br \/>\ndpkg &#8211;install package.deb<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>Ever wanted to create your very own .deb packages for Ubuntu and Debian? Well, here&#8217;s a guide to tell you how in 10 easy steps! Create the directory to hold the package by using: mkdir package Change into the package directory: cd package\/ Make the package file system. For example, any files you put into [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/13"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}