|
| 1 | +***************************** |
| 2 | +Packaging for FogLAMP Service |
| 3 | +***************************** |
| 4 | + |
| 5 | +This directory contains the deb and rpm scripts used to create a FogLAMP service package. |
| 6 | + |
| 7 | +Internal Structure |
| 8 | +================== |
| 9 | + |
| 10 | +The directory contains the following set of files: |
| 11 | + |
| 12 | +- Files named with **make_** prefix, such as ``make_deb``, ``make_rpm``, are the shell scripts used to build the package. |
| 13 | +- The **packages** folder contains the list package types to build. It contains *DEBIAN* and *RPM* |
| 14 | + |
| 15 | + - Inside the *packages/DEBIAN* folder, which contains all the Debian-based files, i.e. control, postinst, needed for the creation of the package. |
| 16 | + |
| 17 | + - In the *archive/DEBIAN/architecture_name* folder which contains the build package. |
| 18 | + |
| 19 | + - Inside the *packages/RPM/SPECS* folder, which contains RPM spec-based file, i.e. service.spec needed for the creation of the package. |
| 20 | + |
| 21 | + - In the *archive/Rpm/architecture_name* folder which contains the build package. |
| 22 | + |
| 23 | + |
| 24 | +The make_deb Script |
| 25 | +=================== |
| 26 | + |
| 27 | +.. code-block:: console |
| 28 | +
|
| 29 | + $ ./make_deb -h |
| 30 | + make_deb [-h] [-a] [-b <branch>] repository ... |
| 31 | + This script is used to create the Debian package for a FogLAMP service |
| 32 | +
|
| 33 | + Arguments: |
| 34 | + -h - Display this help text |
| 35 | + -a - Remove all the versions |
| 36 | + -b - Branch to base package on |
| 37 | + $ |
| 38 | +
|
| 39 | +
|
| 40 | +Building a Debian Package |
| 41 | +========================= |
| 42 | + |
| 43 | +First, make sure that FogLAMP_ROOT is set. |
| 44 | +Finally, run the ``make_deb`` command: |
| 45 | + |
| 46 | +.. code-block:: console |
| 47 | +
|
| 48 | + $ ./make_deb -b develop foglamp-service-notification |
| 49 | + Cloning into 'foglamp-service-notification'... |
| 50 | + Checking connectivity... done. |
| 51 | + The package root directory is : /tmp/foglamp-service-notification |
| 52 | + The package build directory is : /tmp/foglamp-service-notification/build |
| 53 | + The FogLAMP required version : >=1.6 |
| 54 | + The architecture is set as : x86_64 |
| 55 | + The package will be built in : /home/foglamp/Development/foglamp-pkg/service/archive/DEBIAN/x86_64 |
| 56 | + The package name is : foglamp-service-notification-1.6.0-x86_64 |
| 57 | +
|
| 58 | + Populating the package and updating version file...Done. |
| 59 | + Building the package... |
| 60 | + dpkg-deb: building package 'foglamp-service-notification' in 'foglamp-service-notification-1.6.0-x86_64.deb'. |
| 61 | + Building Complete. |
| 62 | + $ |
| 63 | + |
| 64 | +The result will be: |
| 65 | + |
| 66 | +.. code-block:: console |
| 67 | +
|
| 68 | + $ ls -l archive/DEBIAN/x86_64/ |
| 69 | + total 8 |
| 70 | + drwxrwxr-x 4 foglamp foglamp 4096 foglamp-service-notification-1.6.0-x86_64 |
| 71 | + -rw-r--r-- 1 foglamp foglamp 3338 foglamp-service-notification-1.6.0-x86_64-1.6.0.deb |
| 72 | + $ |
| 73 | +
|
| 74 | +The make_rpm Script |
| 75 | +=================== |
| 76 | +.. code-block:: console |
| 77 | +
|
| 78 | + $ ./make_rpm --help |
| 79 | + make_rpm [-a] [-c] [-h] [-b <branch>] repository ... |
| 80 | + This script is used to create the RPM package for a FogLAMP service |
| 81 | + Arguments: |
| 82 | + -h - Display this help text |
| 83 | + -c - Remove all the old versions saved in format .XXXX |
| 84 | + -a - Remove all the versions, including the last one |
| 85 | + -b - Branch to base package on |
| 86 | + $ |
| 87 | +
|
| 88 | +Building a RPM Package |
| 89 | +====================== |
| 90 | + |
| 91 | +First, make sure that FogLAMP_ROOT is set. |
| 92 | +Finally, run the ``make_rpm`` command: |
| 93 | + |
| 94 | +.. code-block:: console |
| 95 | +
|
| 96 | + $ ./make_rpm -b develop foglamp-service-notification |
| 97 | + Cloning into 'foglamp-service-notification'... |
| 98 | + Checking connectivity... done. |
| 99 | + The package root directory is : /tmp/foglamp-service-notification |
| 100 | + The package build directory is : /tmp/foglamp-service-notification/build |
| 101 | + The FogLAMP required version : >= 1.6 |
| 102 | + The FogLAMP service notification version is : 1.6.0 |
| 103 | + The architecture is set as : x86_64 |
| 104 | + The package will be built in : /home/foglamp/Development/foglamp-pkg/service/archive/Rpm/ |
| 105 | + The package name is : foglamp-service-notification-1.6.0 |
| 106 | +
|
| 107 | +
|
| 108 | + Building the package... |
| 109 | + Processing files: foglamp-service-notification-1.6.0-1.x86_64 |
| 110 | + Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/foglamp-service-notification/build/foglamp-service-notification-1.6.0/BUILDROOT/foglamp-service-notification-1.6.0-1.x86_64 |
| 111 | + Wrote: /tmp/foglamp-service-notification/build/foglamp-service-notification-1.6.0/RPMS/x86_64/foglamp-service-notification-1.6.0-1.x86_64.rpm |
| 112 | + Building Complete. |
| 113 | + $ |
| 114 | +
|
| 115 | +The result will be: |
| 116 | + |
| 117 | +.. code-block:: console |
| 118 | +
|
| 119 | + $ ls -l archive/Rpm/x86_64 |
| 120 | + total 12 -rw-rw-r-- 1 foglamp foglamp 11805 foglamp-service-notification-1.6.0-1.x86_64.rpm |
| 121 | + $ |
| 122 | +
|
| 123 | +Cleaning the Package Folder |
| 124 | +=========================== |
| 125 | + |
| 126 | +Use the ``-a`` option to remove all the packages and the files used to make the package. |
0 commit comments