blob: 598cc7a7e87e66e9368e962fa19220b5a124991e (
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
|
<!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="GNU-Free-Documentation-License.html" rel="next" title="GNU Free Documentation License">
<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> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
<span id="Repository-Conventions-1"></span><h4 class="subsection">3.1.2 Repository Conventions</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>[<span id="g_t2010"></span>2010]</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">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>[<span id="g_t2020"></span>2020]</dt>
<dd><p>Prefer sources without a dependency to ‘<samp>automake</samp>’. There
are usually distribution tarballs that are ‘<samp>autoconf</samp>’’ed. Don’t submit tarballs
with an automake dependency unless you are ‘<samp>sure</samp>’ there is no alternative.
</p></dd>
<dt>[<span id="g_t2030"></span>2030]</dt>
<dd><p>Avoid these packages:
</p><dl compact="compact">
<dt>dbus</dt>
<dd><p>Usually can be disabled by <code>--disable-dbus</code>.
</p></dd>
<dt>gettext</dt>
<dd><p>Usually can be disabled by <code>--disable-nls</code>.
</p></dd>
</dl>
</dd>
<dt>[<span id="g_t2040"></span>2040]</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>[<span id="g_t2050"></span>2050]</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’t be
taken literally, they are meant as examples.
</p>
<ol>
<li> Make [<span id="g_t2210"></span>2210]
<div class="example">
<pre class="example">#!/bin/sh -e
make
make DESTDIR="$1" PREFIX=/usr install
</pre></div>
</li><li> Configure/Make [<span id="g_t2211"></span>2211]
<div class="example">
<pre class="example">#!/bin/sh -e
./configure \
--prefix=/usr \
--disable-option \
--enable-option
make
make DESTDIR="$1" install
</pre></div>
</li><li> Autoconf/Automake [<span id="g_t2212"></span>2212]
<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="$1" install
</pre></div>
</li><li> Meson [<span id="g_t2220"></span>2220]
<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>
</li><li> Cmake [<span id="g_t2230"></span>2230]
<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>
</li><li> Go [<span id="g_t2240"></span>2240]
<div class="example">
<pre class="example">#!/bin/sh -e
export GOPATH=$PWD/gopath
trap "go clean -modcache" EXIT INT
go mod vendor
go build
install -Dm755 program "$1/usr/bin/program"
</pre></div>
</li><li> Python [<span id="g_t2241"></span>2241]
<div class="example">
<pre class="example">#!/bin/sh -e
python setup.py build
python setup.py install --prefix=/usr --root="$1"
</pre></div>
</li></ol>
<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> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
</body>
</html>
|