Changes between Version 1 and Version 2 of Internal/DPKG


Ignore:
Timestamp:
Jul 2, 2014, 11:56:15 PM (10 years ago)
Author:
seskar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/DPKG

    v1 v2  
    1 We create debian packages for Orbit and Wimax. These are some steps you can follow to create your own debian package.[[BR]]
     1== Application Packaging ==
     2
     3Debian (deb) packages for Orbit and Wimax are served out of '''packages.orbit-lab.org''' (which is a vhost and a CNAME pointing to external1.orbit-lab.org).
     4
     5The steps to deploy the package are:
     6 * Compile and prepare your packages (debs)
     7 * Copy them to external1:
     8{{{
     9scp *.deb external1:/tmp/.
     10}}}
     11 * As root on external1:
     12{{{
     13cd /var/www/packages/ubuntu
     14reprepro includedeb precise /tmp/*.deb
     15}}}
     16You need to provide admin passphrase to sign packages. In case of OMF Aggregate Managers, you should get output like this:
     17{{{
     18root@external1:/var/www/packages/ubuntu# reprepro includedeb precise /tmp/*.deb
     19/tmp/omf-aggmgr-bscontrol-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     20/tmp/omf-aggmgr-cmc-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     21/tmp/omf-aggmgr-common-5.4_5.4.3-ubuntu3_i386.deb: component guessed as 'main'
     22/tmp/omf-aggmgr-frisbee-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     23/tmp/omf-aggmgr-full-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     24/tmp/omf-aggmgr-instr-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     25/tmp/omf-aggmgr-inventory-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     26/tmp/omf-aggmgr-login-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     27/tmp/omf-aggmgr-logincommon-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     28/tmp/omf-aggmgr-network-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     29/tmp/omf-aggmgr-nfs-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     30/tmp/omf-aggmgr-pxe-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     31/tmp/omf-aggmgr-result-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     32/tmp/omf-aggmgr-saveimage-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     33/tmp/omf-aggmgr-scheduler-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     34/tmp/omf-aggmgr-status-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     35/tmp/omf-aggmgr-wimaxrf-5.4_5.4.3-ubuntu3_all.deb: component guessed as 'main'
     36Exporting indices...
     3717AA4E38AA5E5231 ORBIT Administrator <admin@orbit-lab.org> needs a passphrase
     38Please enter passphrase:
     3917AA4E38AA5E5231 ORBIT Administrator <admin@orbit-lab.org> needs a passphrase
     40Please enter passphrase:
     41}}}
     42
     43To remove OMF Aggregate Manager packages:
     44{{{
     45reprepro remove precise omf-aggmgr-common-5.4 omf-aggmgr-frisbee-5.4 omf-aggmgr-logincommon-5.4 omf-aggmgr-scheduler-5.4 omf-aggmgr-inventory-5.4 omf-aggmgr-pxe-5.4 omf-aggmgr-cmc-5.4 omf-aggmgr-saveimage-5.4 omf-aggmgr-result-5.4 omf-aggmgr-login-5.4 omf-aggmgr-network-5.4 omf-aggmgr-instr-5.4 omf-aggmgr-status-5.4 omf-aggmgr-wimaxrf-5.4 omf-aggmgr-bscontrol-5.4 omf-aggmgr-nfs-5.4 omf-common-5.4 omf-aggmgr-full-5.4
     46}}}
     47(needed in order to re-deploy same version packages)
     48
     49== Building packages ==
     50
     51These are some steps you can follow to create your own debian package.[[BR]]
    252Make a folder for your application[[BR]]
    353 {{{ mkdir app }}} [[BR]]
    4 Inside the folder please create a DEBIAN folder. The most import folder inside the DEBIAN folder is the control file which details all the information about the particular application. Please see the example control file below
     54Inside the folder please create a '''debian''' folder. The most import folder inside the '''debian''' folder are: '''rules''' and '''control''' files.
     55
     56Example control file for OMF that has source tree with build (i.e. packages that have to be installed in order to build the target packages) dependencies and two packages: omf-aggmgr-common-5.4 (which is architecture dependent i.e. will have the same architecture as the platform at which it is built) and omf-aggmgr-inventory-5.4 (which has only ruby code and is thus architecture independent) is:
    557{{{
    6 Source: applicationA
    7 Package: applicationA
    8 Section: omf
    9 Priority: optional
    10 Maintainer: Ivan Seskar <seskar@winlab.rutgers.edu>
    11 Build-Depends: debhelper (>= 7)
     58Source: omf-aggmgr-5.4
     59Section: science
     60Priority: extra
     61Maintainer: Christoph Dwertmann <christoph.dwertmann@nicta.com.au>
     62Build-Depends: debhelper (>= 5), ruby1.9.1-dev, libldap2-dev, libssl-dev, libsasl2-dev, libsqlite3-dev
    1263Standards-Version: 3.7.2
    13 Version: 1.0
     64
     65Package: omf-aggmgr-common-5.4
     66Architecture: any
     67Multi-Arch: same
     68Depends: ruby1.9.1, libsqlite3-ruby1.9.1, sqlite3, omf-common-5.4
     69Description: OMF Aggregate Manager
     70 Provides core functions for Aggregate Managers in OMF
     71
     72Package: omf-aggmgr-inventory-5.4
    1473Architecture: all
    15 Depends: daemon, snmpd,ruby
    16 Description: Demon for controlling base functionality.
     74Depends: libmysql-ruby1.9.1, omf-aggmgr-common-5.4, psmisc, nmap, netcat-openbsd, libmysqlclient-dev
     75Description: OMF Aggregate Manager
     76 Provides Inventory AM for OMF
    1777
    1878}}}
    19 This file tells you that its name is ApplicationA , which has optional priority , is under the omf section. It is maintained by Ivan Seskar, needs the following packages 'daemon,snmpd and ruby' installed before it can be installed. Its current release version is 1.0 [[BR]]
    20 Another file needed here is called the 'dirs' which lists all the directories you will be adding your files to on the target system, lets look at an example file
     79
     80Once these files are in place, the build process is initiated with:
    2181{{{
    22 /etc
    23 /usr/bin
     82debuild -uc -us -b
    2483}}}
    25 Following this dirs file you will create two folders under the app folder
    26 {{{
    27 cd app
    28 mkdir etc
    29 mkdir usr
    30 mkdir usr/bin
    31 }}}
    32 You will copy your intended files in these folders so they can be installed in the target machine.
    33 {{{
    34 cp app.xml ./etc/
    35 cp app ./usr/bin/
    36 }}}
    37 If you need to execute any commands even before the dependencies are added you can add your statements to a 'preinst' file and the dpkg will execute those commands. On the other hand if you need to execute some commands after the installation has been completed, you can put those commands in the 'postinst' file.
    38 Now lets create our package, go one folder up from the app directory
    39 {{{
    40 dpkg-deb --build app
    41 }}}
    42 This will produce for you app.deb file if all goes well.