Changes between Version 1 and Version 2 of Internal/DPKG
- Timestamp:
- Jul 2, 2014, 11:56:15 PM (10 years ago)
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 3 Debian (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 5 The steps to deploy the package are: 6 * Compile and prepare your packages (debs) 7 * Copy them to external1: 8 {{{ 9 scp *.deb external1:/tmp/. 10 }}} 11 * As root on external1: 12 {{{ 13 cd /var/www/packages/ubuntu 14 reprepro includedeb precise /tmp/*.deb 15 }}} 16 You need to provide admin passphrase to sign packages. In case of OMF Aggregate Managers, you should get output like this: 17 {{{ 18 root@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' 36 Exporting indices... 37 17AA4E38AA5E5231 ORBIT Administrator <admin@orbit-lab.org> needs a passphrase 38 Please enter passphrase: 39 17AA4E38AA5E5231 ORBIT Administrator <admin@orbit-lab.org> needs a passphrase 40 Please enter passphrase: 41 }}} 42 43 To remove OMF Aggregate Manager packages: 44 {{{ 45 reprepro 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 51 These are some steps you can follow to create your own debian package.[[BR]] 2 52 Make a folder for your application[[BR]] 3 53 {{{ 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 54 Inside the folder please create a '''debian''' folder. The most import folder inside the '''debian''' folder are: '''rules''' and '''control''' files. 55 56 Example 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: 5 57 {{{ 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) 58 Source: omf-aggmgr-5.4 59 Section: science 60 Priority: extra 61 Maintainer: Christoph Dwertmann <christoph.dwertmann@nicta.com.au> 62 Build-Depends: debhelper (>= 5), ruby1.9.1-dev, libldap2-dev, libssl-dev, libsasl2-dev, libsqlite3-dev 12 63 Standards-Version: 3.7.2 13 Version: 1.0 64 65 Package: omf-aggmgr-common-5.4 66 Architecture: any 67 Multi-Arch: same 68 Depends: ruby1.9.1, libsqlite3-ruby1.9.1, sqlite3, omf-common-5.4 69 Description: OMF Aggregate Manager 70 Provides core functions for Aggregate Managers in OMF 71 72 Package: omf-aggmgr-inventory-5.4 14 73 Architecture: all 15 Depends: daemon, snmpd,ruby 16 Description: Demon for controlling base functionality. 74 Depends: libmysql-ruby1.9.1, omf-aggmgr-common-5.4, psmisc, nmap, netcat-openbsd, libmysqlclient-dev 75 Description: OMF Aggregate Manager 76 Provides Inventory AM for OMF 17 77 18 78 }}} 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 80 Once these files are in place, the build process is initiated with: 21 81 {{{ 22 /etc 23 /usr/bin 82 debuild -uc -us -b 24 83 }}} 25 Following this dirs file you will create two folders under the app folder26 {{{27 cd app28 mkdir etc29 mkdir usr30 mkdir usr/bin31 }}}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 directory39 {{{40 dpkg-deb --build app41 }}}42 This will produce for you app.deb file if all goes well.