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
Copy file name to clipboardexpand all lines: src/sphinx/DetailedTopics/linux.rst
+218-3
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,12 @@ The required fields for any linux distribution are:
28
28
Package Mappings
29
29
----------------
30
30
31
-
Most of the work in generating a linux package is constructing package mappings. These 'map' a file to a location on disk where it should reside as well as information about that file. Package mappings allow the specification of file ownership, permissions and whether or not the file can be considered "configuration".
31
+
Most of the work in generating a linux package is constructing package mappings. These 'map' a file to a location on disk where it should
32
+
reside as well as information about that file. Package mappings allow the specification of file ownership, permissions and whether or not
33
+
the file can be considered "configuration".
32
34
33
-
Note that while the ``sbt-native-packager`` plugin allows you to specify all of this information, not all platforms will make use of the information. It's best to be specific
34
-
about how you want files handled and run tests on each platform you wish to deploy to.
35
+
Note that while the ``sbt-native-packager`` plugin allows you to specify all of this information, not all platforms will make use of the
36
+
information. It's best to be specific about how you want files handled and run tests on each platform you wish to deploy to.
35
37
36
38
A package mapping takes this general form
37
39
@@ -40,6 +42,7 @@ A package mapping takes this general form
40
42
(packageMapping(
41
43
file -> "/usr/share/man/man1/sbt.1.gz"
42
44
) withPerms "0644" gzipped) asDocs()
45
+
43
46
44
47
45
48
Let's look at each of the methods supported in the packageMapping 'library'.
@@ -67,8 +70,220 @@ Let's look at each of the methods supported in the packageMapping 'library'.
67
70
68
71
``withGroup(group:String)``
69
72
This denotes which group should be the owner of the given files in the resulting package.
73
+
70
74
71
75
76
+
The LinuxPackageMapping Models
77
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
+
79
+
All classes are located in the ``com.typesafe.sbt.packager.linux`` package. So if you want to create
80
+
instances yourself you have to add ``import com.typesafe.sbt.packager.linux._`` to your build file.
81
+
82
+
A ``LinuxPackageMapping`` contains the following fields:
83
+
84
+
``mappings: Traversable[(File, String)]``
85
+
A list of mappings aggregated by this LinuxPackageMapping
86
+
87
+
``fileData: LinuxFileMetaData``
88
+
Permissions for all the defined mappings. Default to "root:root 755"
89
+
90
+
``zipped: Boolean``
91
+
Are the mappings zipped. Default to false
92
+
93
+
All mappings are stored in the task ``linuxPackageMappings`` which returns a ``Seq[LinuxPackageMapping]``. To display the contents
94
+
open the sbt console and call
95
+
96
+
.. code-block:: bash
97
+
98
+
show linuxPackageMappings
99
+
100
+
101
+
The ``LinuxFileMetaData`` has the following fields
102
+
103
+
``user: String``
104
+
The user owning all the mappings. Default "root"
105
+
106
+
``group: String``
107
+
The group owning all the mappings. Default "root"
108
+
109
+
``permissions: String``
110
+
Access permissions for all the mappings. Default "755"
111
+
112
+
``config: String``
113
+
Are the mappings config files. Default "false"
114
+
115
+
``docs: Boolean``
116
+
Are the mappings docs. Default to false
117
+
118
+
Last but not least there are the ``linuxPackageSymlinks``, which encapsulate symlinks on your
119
+
destination system. A ``LinuxSymlink`` contains only two fields
120
+
121
+
``link: String``
122
+
The actual link that points to ``destination``
123
+
124
+
``destination: String``
125
+
The link destination
126
+
127
+
You can see all currently configured symlinks with this simple command.
128
+
``linuxPackageSymlinks`` is just a ``Seq[LinuxSymlink]``
129
+
130
+
.. code-block:: bash
131
+
132
+
show linuxPackageSymlinks
133
+
134
+
135
+
Modifying Mappings in General
136
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137
+
138
+
Adding, filtering and altering mappings are always simple methods on a sequence: ``Seq[LinuxPackageMapping]``.
0 commit comments