aboutsummaryrefslogtreecommitdiff
path: root/docs/docs/Repository-Conventions.html
blob: b1026528013b48447890331df32590df194f8cdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2020 Cem Keylan

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free
Documentation License." -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Repository Conventions (Carbs Linux User Manual)</title>

<meta name="description" content="Repository Conventions (Carbs Linux User Manual)">
<meta name="keywords" content="Repository Conventions (Carbs Linux User Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Conventions.html" rel="up" title="Conventions">
<link href="Sending-Git-mails.html" rel="next" title="Sending Git mails">
<link href="Shell-Conventions.html" rel="prev" title="Shell Conventions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Repository-Conventions"></span><div class="header">
<p>
Previous: <a href="Shell-Conventions.html" accesskey="p" rel="prev">Shell Conventions</a>, Up: <a href="Conventions.html" accesskey="u" rel="up">Conventions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
<span id="Repository-Conventions-_002d_002d-20"></span><h4 class="subsection">3.1.3 Repository Conventions &ndash; 20</h4>

<p>Repository conventions are important in order to ensure every package resemble
themselves. Here are the things to keep in mind:
</p>
<dl compact="compact">
<dt><strong>[<span id="g_t2010"></span>2010]</strong></dt>
<dd><p>Prefer tarballs over git packages unless there is a sensible reason.
Here are some:
</p>
<ul>
<li> Every patch is a new release. (See <a href="https://github.com/vim/vim">vim</a>)
</li><li> There are no releases. (See <a href="https://git.suckless.org/sbase">https://git.suckless.org/sbase</a>)
</li><li> Following a development branch.
</li><li> There has been a long time since the latest release, but upstream is far ahead.
</li></ul>

</dd>
<dt><strong>[<span id="g_t2020"></span>2020]</strong></dt>
<dd><p>Prefer sources without a dependency to <code>automake</code>. There are usually
distribution tarballs that are <code>autoconf</code>&rsquo;ed. Don&rsquo;t submit tarballs
with an automake dependency unless you are <strong>sure</strong> there is no
alternative.
</p></dd>
<dt><strong>[<span id="g_t2030"></span>2030]</strong></dt>
<dd><p>Avoid these packages:
</p><dl compact="compact">
<dt><code>dbus</code></dt>
<dd><p>Usually can be disabled by <samp>--disable-dbus</samp>
</p></dd>
<dt><code>gettext</code></dt>
<dd><p>Usually can be disabled by <samp>--disable-nls</samp>
</p></dd>
</dl>
</dd>
<dt><strong>[<span id="g_t2040"></span>2040]</strong></dt>
<dd><ul>
<li> Always install a package to the <samp>/usr</samp> prefix.
</li><li> All binaries should go to <samp>/usr/bin</samp>, not <samp>/usr/sbin</samp> or any other
directory.
</li><li> All libraries should go to <samp>/usr/lib</samp>.
</li></ul>
</dd>
<dt><strong>[<span id="g_t2050"></span>2050]</strong></dt>
<dd><p>All build files on the repository should be a POSIX shell script, and must start
with <code>#!/bin/sh -e</code>.
</p></dd>
</dl>

<p>The next section is about package templates that should be used in order to
ensure stylistic consistency. Note that the option configurations shouldn&rsquo;t be
taken literally, they are meant as examples.
</p>


<p><strong>[<span id="g_t2210"></span>2210] Make</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

make
make DESTDIR=&quot;$1&quot; PREFIX=/usr install
</pre></div>



<p><strong>[<span id="g_t2211"></span>2211] Configure/Make</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

./configure \
    --prefix=/usr \
    --disable-option \
    --enable-option

make
make DESTDIR=&quot;$1&quot; install
</pre></div>



<p><strong>[<span id="g_t2212"></span>2212] Autoconf/Automake</strong>
</p>
<p>See <a href="#g_t2020">2020</a>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

autoreconf -fi

./configure \
    --prefix=/usr \
    --disable-option \
    --enable-option

make
make DESTDIR=&quot;$1&quot; install
</pre></div>



<p><strong>[<span id="g_t2220"></span>2220] Meson</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

export DESTDIR=$1

meson \
    --prefix=/usr \
    -Doption=false \
    -Doption2=true \
    . output

ninja -C output
ninja -C output install
</pre></div>



<p><strong>[<span id="g_t2230"></span>2230] Cmake</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

export DESTDIR=$1

cmake -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DOPTION=ON

cmake --build   build
cmake --install build
</pre></div>



<p><strong>[<span id="g_t2240"></span>2240] Go</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

export GOPATH=$PWD/gopath
trap &quot;go clean -modcache&quot; EXIT INT
go mod vendor

go build
install -Dm755 program &quot;$1/usr/bin/program&quot;
</pre></div>



<p><strong>[<span id="g_t2241"></span>2241] Python</strong>
</p>
<div class="example">
<pre class="example">#!/bin/sh -e

python setup.py build
python setup.py install --prefix=/usr --root=&quot;$1&quot;
</pre></div>



<hr>
<div class="header">
<p>
Previous: <a href="Shell-Conventions.html" accesskey="p" rel="prev">Shell Conventions</a>, Up: <a href="Conventions.html" accesskey="u" rel="up">Conventions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>



</body>
</html>