You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repository contains the following set of files:
19
19
20
-
- Files named with **make_** prefix, such as ``make_deb``, are the shell scripts used to build the package. The scripts accept the architecture to build as argument (currently *x86* and *arm*).
21
-
- The **packages** folder contains the list package types to build. At the moment, the only package type we provide is *Debian*.
20
+
- Files named with **make_** prefix, such as ``make_deb``, ``make_rpm``, are the shell scripts used to build the package. The script runs as per the architecture to build.
21
+
- The **packages** folder contains the list package types to build. It contains *Debian* and *rpmbuild*, latter for RedHat/Centos RPM creation.
22
22
23
-
- Inside the *packages/Debian* folder, we have the **architecture** folders, plus a *common* folder containing files that are common to all the architectures. The architectures that we provide at the moment are *armhf* and *x86_64*.
23
+
- Inside the *packages/Debian* folder, we have the **architecture** folders, plus a *common* folder containing files that are common to all the architectures. The architectures that we provide at the moment are *aarch64*, *armv7l* and *x86_64*.
24
24
25
-
- Inside the architecture folder we have the DEBIAN folder, which contains all the Debian-based files, i.e. control, pre/post inst/rm, needed for the creation of the package.
25
+
- Inside the architecture folder we have the DEBIAN folder, which contains only control file
26
+
- Inside the common folder we have the DEBIAN folder, which contains pre/post inst/rm, needed for the creation of the package.
26
27
27
-
- After the first build, the *packages/Debian* will also contain a **build** folder. This folder contains a copy of what will be used to build the package (in a directory with the same name of the package) and the package itself.
28
+
- After the first build, the *packages/Debian* will also contain a **build/architecture** folder. This folder contains a copy of what will be used to build the package (in a directory with the same name of the package) and the package itself.
28
29
29
-
- In the *build* folder, folders and files that have a sequence number are a previous package build.
30
+
- In the *build/architecture* folder, folders and files that have a sequence number are a previous package build.
30
31
31
32
32
33
The make_deb Script
33
34
===================
34
35
35
36
.. code-block:: console
36
37
37
-
$ ./make_deb --help
38
-
make_deb {x86|arm} [clean|cleanall]
38
+
$ ./make_deb help
39
+
make_deb [help|clean|cleanall]
39
40
This script is used to create the Debian package of FogLAMP
40
41
Arguments:
41
-
x86 - Build an x86_64 package
42
-
arm - Build an armv7l package
42
+
help - Display this help text
43
43
clean - Remove all the old versions saved in format .XXXX
44
44
cleanall - Remove all the versions, including the last one
45
45
$
@@ -55,71 +55,167 @@ The make_deb Script
55
55
56
56
57
57
58
-
Building a Package
59
-
==================
58
+
Building a Debian Package
59
+
=========================
60
60
61
61
First, make sure that FogLAMP is properly installed via ``make install`` somewhere on your environment (default is */usr/local/foglamp*).
62
-
Next, select the architecture to use, *x86* or *arm*.
63
-
Finally, run the ``make_deb`` command:
62
+
Finally, run the ``make_deb`` command and it will make as per ``arch``:
64
63
65
64
.. code-block:: console
66
65
67
-
$ ./make_deb x86
66
+
$ ./make_deb
68
67
The package root directory is : /home/foglamp/foglamp-pkg
69
68
The FogLAMP directory is : /usr/local/foglamp
70
-
The FogLAMP version is : 1.2
71
-
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
69
+
The FogLAMP version is : 1.6.0
70
+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build/x86_64
72
71
The architecture is set as : x86_64
73
-
The package name is : foglamp-1.2-x86_64
72
+
The package name is : foglamp-1.6.0-x86_64
74
73
75
74
Populating the package...Done.
76
75
Building the new package...
77
-
dpkg-deb: building package 'foglamp' in 'foglamp-1.2-x86_64.deb'.
76
+
dpkg-deb: building package 'foglamp' in 'foglamp-1.6.0-x86_64.deb'.
78
77
Building Complete.
79
78
$
80
79
81
80
The result will be:
82
81
83
82
.. code-block:: console
84
83
85
-
$ ls -l packages/Debian/build/
84
+
$ ls -l packages/Debian/build/x86_64
86
85
total 564
87
-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.2-x86_64
88
-
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.2-x86_64.deb
86
+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.6.0-x86_64
87
+
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.6.0-x86_64.deb
89
88
$
90
89
91
90
If you execute the ``make_deb`` command again, you will see:
92
91
93
92
.. code-block:: console
94
93
95
-
$ ./make_deb x86
94
+
$ ./make_deb
96
95
The package root directory is : /home/foglamp/foglamp-pkg
97
96
The FogLAMP directory is : /usr/local/foglamp
98
-
The FogLAMP version is : 1.2
99
-
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
97
+
The FogLAMP version is : 1.6.0
98
+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build/x86_64
100
99
The architecture is set as : x86_64
101
-
The package name is : foglamp-1.2-x86_64
100
+
The package name is : foglamp-1.6.0-x86_64
102
101
103
-
Saving the old working environment as foglamp-1.2-x86_64.0001
102
+
Saving the old working environment as foglamp-1.6.0-x86_64.0001
104
103
Populating the package...Done.
105
-
Saving the old package as foglamp-1.2-x86_64.deb.0001
104
+
Saving the old package as foglamp-1.6.0-x86_64.deb.0001
106
105
Building the new package...
107
-
dpkg-deb: building package 'foglamp' in 'foglamp-1.2-x86_64.deb'.
106
+
dpkg-deb: building package 'foglamp' in 'foglamp-1.6.0-x86_64.deb'.
108
107
Building Complete.
109
108
$
110
-
$ ls -l packages/Debian/build/
109
+
$ ls -l packages/Debian/build/x86_64
111
110
total 1128
112
-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:53 foglamp-1.2-x86_64
113
-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.2-x86_64.0001
114
-
-rw-r--r-- 1 foglamp foglamp 573080 Mar 23 17:54 foglamp-1.2-x86_64.deb
115
-
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.2-x86_64.deb.0001
111
+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:53 foglamp-1.6.0-x86_64
112
+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.6.0-x86_64.0001
113
+
-rw-r--r-- 1 foglamp foglamp 573080 Mar 23 17:54 foglamp-1.6.0-x86_64.deb
114
+
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.6.0-x86_64.deb.0001
116
115
$
117
116
118
117
... where the previous build is now marked with the suffix *.0001*.
119
118
120
119
120
+
The make_rpm Script
121
+
===================
122
+
.. code-block:: console
123
+
124
+
$ ./make_rpm --help
125
+
make_rpm help [clean|cleanall]
126
+
This script is used to create the RPM package of FogLAMP
127
+
Arguments:
128
+
help - Display this help text
129
+
clean - Remove all the old versions saved in format .XXXX
130
+
cleanall - Remove all the versions, including the last one
131
+
$
132
+
133
+
Building a RPM Package
134
+
======================
135
+
136
+
First, make sure that FogLAMP is properly installed via ``make install`` somewhere on your environment (default is */usr/local/foglamp*).
137
+
Next, *x86* is the only currently supported architecture for RedHat/Centos.
138
+
Finally, run the ``make_rpm`` command:
139
+
140
+
.. code-block:: console
141
+
142
+
$ ./make_rpm
143
+
The package root directory is : /home/foglamp/repos/foglamp-pkg
144
+
The FogLAMP directory is : /home/foglamp/foglamp
145
+
The FogLAMP version is : 1.5.2
146
+
The package will be built in : /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/RPMS/x86_64
147
+
The package name is : foglamp-1.5.2-1.x86_64
148
+
149
+
Saving the old working environment as foglamp-1.5.2-1.x86_64.0077
150
+
Populating the package and updating version in control file...Done.
151
+
Prepare data directory
152
+
Saving the old package as foglamp-1.5.2-1.x86_64.rpm.0001
-v : maps host volume /foglamp-data to container volume /usr/local/foglamp/data
39
+
--name : name of the container (foglamp)
40
+
-p : map the port of host machine (8081) and container (:8081)
41
+
foglamp : name of the image created in earlier step
42
+
43
+
> To attach to a running conatiner: `docker exec -it foglamp bash`
44
+
45
+
46
+
### Stopping docker container
47
+
```
48
+
$ docker stop foglamp
49
+
```
50
+
51
+
> Note: The files in foglamp-data directory are created by container which creates/runs them as root user. In order to read the foglamp.db, you need to change the permission of foglamp.db* files, sudo chmod 666 foglamp.db*
0 commit comments