-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.html
2595 lines (2112 loc) · 103 KB
/
README.html
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>A guide to robotpkg</title>
</head>
<style type="text/css">
/* --- preamble ------------------------------------------------------------ */
body {
color: #444;
background: #fff;
font: normal normal normal small/1.5em Verdana, sans-serif;
font-size-adjust: none;
font-stretch: normal;
text-align: center;
min-width: 50em;
}
a:link, a:visited {
color: #660403;
font-weight: normal;
text-decoration: none;
}
a:hover {
color: #e90017;
text-decoration: underline;
}
div.p {
margin: 1em 0;
}
table td {
border-style: none;
padding: 0 4ex;
}
table td#hline {
border-top: 1px solid #ccc;
}
table, table tr {
border: 1px solid #ccc;
}
#content {
text-align: left;
width: 50em;
margin-left: auto;
margin-right: auto;
}
#frontmatter, #mainmatter {
width: 90%;
text-align: justify;
}
#preamble h1 {
font-size: 300%;
line-height: 120%;
border-bottom: 1px solid #ccc;
padding-bottom: 1ex;
}
/* --- front matter -------------------------------------------------------- */
#frontmatter h1 {
width: 111%;
font-size: 250%;
line-height: 150%;
margin: 5ex 0 1ex 0;
}
#frontmatter a {
font-size: 125%;
line-height: 1.5em;
}
/* --- main matter --------------------------------------------------------- */
/* chapters */
#mainmatter h1 {
width: 111%;
text-align: right;
font-size: 250%;
line-height: 150%;
margin: 10ex 0 2ex 0;
border-bottom: 1px solid #ccc;
}
#mainmatter h1 > a {
font-size: 150%;
margin: 0;
padding-right: 10%
}
#mainmatter h2 {
font-size: 150%;
line-height: 150%;
margin: 4ex 0 1ex 0;
}
</style>
<body><div id="content">
<div id="preamble">
<div class="p"><!----></div>
<div class="p"><!----></div>
<h1 align="center">A guide to robotpkg </h1>
<h3 align="center">Anthony Mallet - <tt>[email protected]</tt> </h3>
<h3 align="center">October 9, 2017</h3>
<div class="p"><!----></div>
<div class="p"><!----></div>
</div><div id="frontmatter">
<div class="p"><!----></div>
<div class="small">Copyright © 2006-2011,2013 LAAS/CNRS.<br />
Copyright © 1997-2010 The NetBSD Foundation, Inc.<br />
All rights reserved.<br />
<div class="p"><!----></div>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
<div class="p"><!----></div>
<ol type="1">
<li> Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
<div class="p"><!----></div>
</li>
<li> Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
<div class="p"><!----></div>
</li>
</ol>
<div class="p"><!----></div>
THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
</div>
<div class="p"><!----></div>
<h1>Contents </h1><a href="#tth_chAp1"
>1 Introduction</a><br />
<a href="#tth_sEc1.1"
>1.1 What is robotpkg?</a><br />
<a href="#tth_sEc1.2"
>1.2 Why robotpkg?</a><br />
<a href="#tth_sEc1.3"
>1.3 Supported platforms</a><br />
<a href="#tth_sEc1.4"
>1.4 Overview</a><br />
<a href="#tth_sEc1.5"
>1.5 Terminology</a><br />
<a href="#tth_sEc1.6"
>1.6 Roles involved in robotpkg</a><br />
<a href="#tth_sEc1.7"
>1.7 Typography</a><br />
<a href="#tth_chAp2"
>2 The robotpkg user's guide</a><br />
<a href="#tth_sEc2.1"
>2.1 Where to get robotpkg and how to keep it up-to-date</a><br />
<a href="#tth_sEc2.1.1"
>2.1.1 Getting the binary bootstrap kit</a><br />
<a href="#tth_sEc2.1.2"
>2.1.2 Getting robotpkg for source compilation</a><br />
<a href="#tth_sEc2.1.3"
>2.1.3 Keeping robotpkg up-to-date</a><br />
<a href="#tth_sEc2.2"
>2.2 Bootstrapping robotpkg</a><br />
<a href="#tth_sEc2.2.1"
>2.2.1 Bootstrapping via the binary kit</a><br />
<a href="#tth_sEc2.2.2"
>2.2.2 Bootstrapping from source</a><br />
<a href="#tth_sEc2.3"
>2.3 Using robotpkg</a><br />
<a href="#tth_sEc2.3.1"
>2.3.1 Building packages from source</a><br />
<a href="#tth_sEc2.3.2"
>2.3.2 Building packages from a repository checkout</a><br />
<a href="#tth_sEc2.3.3"
>2.3.3 Installing binary packages</a><br />
<a href="#tth_sEc2.3.4"
>2.3.4 Removing packages</a><br />
<a href="#tth_sEc2.3.5"
>2.3.5 Getting information about installed packages</a><br />
<a href="#tth_sEc2.3.6"
>2.3.6 Other administrative functions</a><br />
<a href="#tth_sEc2.3.7"
>2.3.7 Available <tt>make</tt> targets</a><br />
<a href="#tth_sEc2.4"
>2.4 Configuring robotpkg</a><br />
<a href="#tth_sEc2.4.1"
>2.4.1 Selecting build options</a><br />
<a href="#tth_sEc2.4.2"
>2.4.2 Selecting build alternatives</a><br />
<a href="#tth_sEc2.4.3"
>2.4.3 Defining collections of packages</a><br />
<a href="#tth_sEc2.4.4"
>2.4.4 Package specific configuration variables</a><br />
<a href="#tth_sEc2.4.5"
>2.4.5 General configuration variables</a><br />
<a href="#tth_sEc2.4.6"
>2.4.6 Variables affecting the build process</a><br />
<a href="#tth_sEc2.4.7"
>2.4.7 Additional flags to the compiler</a><br />
<a href="#tth_sEc2.5"
>2.5 Creating binary packages for everything</a><br />
<a href="#tth_sEc2.5.1"
>2.5.1 Initial setup</a><br />
<a href="#tth_sEc2.5.2"
>2.5.2 Running bulk builds</a><br />
<a href="#tth_sEc2.5.3"
>2.5.3 Generating pretty reports</a><br />
<a href="#tth_sEc2.5.4"
>2.5.4 Automated bulk builds</a><br />
<a href="#tth_chAp3"
>3 The robotpkg developer's guide</a><br />
<a href="#tth_sEc3.1"
>3.1 Package files, directories and contents</a><br />
<a href="#tth_sEc3.1.1"
>3.1.1 Makefile</a><br />
<a href="#tth_sEc3.1.2"
>3.1.2 distinfo</a><br />
<a href="#tth_sEc3.1.3"
>3.1.3 PLIST</a><br />
<a href="#tth_sEc3.1.4"
>3.1.4 patches/*</a><br />
<a href="#tth_sEc3.2"
>3.2 General operation</a><br />
<a href="#tth_sEc3.2.1"
>3.2.1 Adding build options to a package</a><br />
<a href="#tth_sEc3.2.2"
>3.2.2 Customizing the PLIST</a><br />
<a href="#tth_sEc3.2.3"
>3.2.3 Customizing the semi-automatic PLIST generation</a><br />
<a href="#tth_sEc3.2.4"
>3.2.4 Incrementing versions when fixing an existing package</a><br />
<a href="#tth_sEc3.2.5"
>3.2.5 Substituting variable text in the package files</a><br />
<a href="#tth_sEc3.3"
>3.3 The build phase</a><br />
</div><div id="mainmatter">
<div class="p"><!----></div>
<a id="tth_chAp1"></a><h1>
1 <br />Introduction</h1>
<a id="chapter:introduction">
</a>
<div class="p"><!----></div>
<a id="tth_sEc1.1"></a><h2>
1.1 What is robotpkg?</h2>
<div class="p"><!----></div>
The robotics research community has always been developing a lot of software,
in order to illustrate theoretical concepts and validate algorithms on board
real robots. A great amount of this software was made freely available to the
community, especially for Unix-based systems, and is usually available in form
of the source code. Therefore, before such software can be used, it needs to be
configured to the local system, compiled and installed. This is exactly what
The Robotics Packages Collection (robotpkg) does. robotpkg also has some basic
commands to handle binary packages, so that not every user has to build the
packages for himself, which is a time-costly, cumbersome and error-prone task.
<div class="p"><!----></div>
The robotpkg project was initiated in the <a href="http://www.laas.fr/">Laboratory
for Analysis and Architecture of Systems</a> (CNRS/LAAS), France. The motivation
was, on the one hand, to ease the software maintenance tasks for the robots
that are used there. On the other hand, roboticists at CNRS/LAAS have always
fostered an open-source development model for the software they were
developing. In order to help people working with the laboratory to get the
LAAS software running outside the laboratory, a package management system was
necessary.
<div class="p"><!----></div>
Although robotpkg was an innovative project in the robotics community (it
started in 2006), a lot of general-purpose software packages management systems
were readily available at this time for a great variety of Unix-based systems.
The main requirements that we wanted robotpkg to fullfill were listed and the
best existing package management system was chosen as a starting point. The
biggest requirement was the capacity of the system to adapt to the nature of
the robotic software, being available mostly in form of source code only (no
binary packages), with unfrequent stable releases. robotpkg had thus to deal
mostly with source code and automate the compilation of the packages. The
system chosen as a starting point was <a href="http://www.pkgsrc.org">The NetBSD
Packages Collection</a> (pkgsrc). robotpkg can be considered as a fork of this
project and it is still very similar to pkgsrc in many points, although some
simplifications were made in order to provide a tool geared toward people that
are not computer scientists but roboticists.
<div class="p"><!----></div>
Due to its origins, robotpkg provides many packages developed at LAAS. It is
however not limited to such packages and contains, in fact, quite some other
software useful to roboticists. Of course, robotpkg is not meant to be a
general purpose packaging system (although there would be no technical
restriction to this) and will never contain widely available packages that can
be found on any modern Unix distribution. Yet, robotpkg currently contains
roughly one hundred and fifty packages, including:
<div class="p"><!----></div>
<ul>
<li> architecture/genom - The LAAS Generator of Robotic Components
<div class="p"><!----></div>
</li>
<li> architecture/openrtm - The robotic distributed middleware from AIST, Japan
<div class="p"><!----></div>
</li>
<li> middleware/yarp - The "other", yet famous, robot platform
<div class="p"><!----></div>
</li>
<li> ...just to name a few.
<div class="p"><!----></div>
</li>
</ul>
<div class="p"><!----></div>
<a id="tth_sEc1.2"></a><h2>
1.2 Why robotpkg?</h2>
<div class="p"><!----></div>
robotpkg provides the following key features:
<div class="p"><!----></div>
<ul>
<li> Easy building of software from source as well as the creation and
installation of binary packages. The source and latest patches are retrieved
from a master download site, checksum verified, then built on your system.
<div class="p"><!----></div>
</li>
<li> All packages are installed in a consistent directory tree, including
binaries, libraries, man pages and other documentation.
<div class="p"><!----></div>
</li>
<li> Package dependencies, including when performing package updates, are
handled automatically.
<div class="p"><!----></div>
</li>
<li> The installation prefix, acceptable software licenses and build-time
options for a large number of packages are all set in a simple, central
configuration file.
<div class="p"><!----></div>
</li>
<li> The entire framework source (not including the package distribution
files themselves) is freely available under a BSD license, so you may extend
and adapt robotpkg to your needs, like robotpkg was adapted from pkgsrc.
<div class="p"><!----></div>
</li>
</ul>
<div class="p"><!----></div>
One question often asked by people is "why was robotpkg forked from pkgsrc
instead of integrating the packages into pkgsrc?". This is indeed a very good
question and the following paragraphs try to answer it.
<div class="p"><!----></div>
First, robotpkg is not meant to be a replacement for the system's package
management tool (it does not superseeds pkgsrc, dpkg, macports etc.). The goal
is to package software that is not widely available on a platform, and which is
mostly "lab software" (generally of lesser quality than widely available
software). Those packages change (a lot) more often, and more
drastically. Thus, robotpkg is a little bit closer to a "development" tool than
pkgsrc. Other "system packages" are correctly handled by a number of
packaging tools, and there is no need for a new tool.
<div class="p"><!----></div>
Currently, pkgsrc mixes both infrastructure and packages descriptions
themselves. For someone working on e.g. Linux, checking-out
the whole pkgsrc tree would be cumbersome: it would be redundant with the base
Linux package system, plus it would be difficult to isolate the specific
robotic packages from the rest (the rest usually being available in the base
system). robotpkg currently suffers from the same symptom: this may change in
the future if the need for several package repositories becomes blatant.
<div class="p"><!----></div>
robotpkg provides a number of features not available in pkgsrc (and probably
not really useful to pkgsrc either). The most important feature is to be able
to detect "system packages", that are considered as ëxternal software not in
robotpkg but usually available on a unix system". pkgsrc has a similar system
but much more limited - to a few base packages only. This is so because pkgsrc
is a full-fledged package system. Thus, it aims at being self contained, while
robotpkg does not.
<div class="p"><!----></div>
Finally, there are a number of additions/changes to the pkgsrc infrastructure
that correspond to legitimate users requests and the specifc workflow in which
robotpkg is used. For instance, robotpkg provides the possibility to generate
an archive of a package from a specific tag in a source repository "on the
fly" or just bypass the archive generation and work directly from the source
repository to install the software. This later workflow is not encouraged, but
it is convenient to quickly test a -current version of some software to see if
it causes any problem. Those features could be ported back to pkgsrc if the
pkgsrc team would find them useful. In the meantime, robotpkg provides a
good testbed for them.
<div class="p"><!----></div>
Still, robotpkg directly uses many of the pkgsrc tools unchanged and the binary
packages are fully compatible.
<div class="p"><!----></div>
<a id="tth_sEc1.3"></a><h2>
1.3 Supported platforms</h2>
<div class="p"><!----></div>
robotpkg consists of a source distribution. After retrieving the required
source, you can be up and running with robotpkg in just minutes!
<div class="p"><!----></div>
robotpkg does not have much requirements by itself and it can work on a wide
variety of systems as long as they provide a GNU-make utility, a working
C-compiler and a small, reasonably standard subset of Unix commands (like sed,
awk, find, grep ...). However, individual packages might have their specific
requirements. The following platforms have been reported to be supported
reasonably well:
<div class="p"><!----></div>
<div style="text-align:center">
<table border="1" class="tabular">
<tr><td align="center">Platform </td><td align="center">Version
</td></tr><tr><td id="hline" colspan=0></td></tr>
<tr><td align="center">Fedora </td><td align="center">25 or above</td></tr>
<tr><td align="center">Ubuntu </td><td align="center">12.04 or above</td></tr>
<tr><td align="center">Debian </td><td align="center">7 or above</td></tr>
<tr><td align="center">NetBSD </td><td align="center">6 or above</td></tr>
<tr><td align="center">Darwin </td><td align="center">Partial support - infrastructure works, individual packages may not</td></tr></table>
</div>
<div class="p"><!----></div>
Any other Unix-like platform should usually work.
<div class="p"><!----></div>
<a id="tth_sEc1.4"></a><h2>
1.4 Overview</h2>
<div class="p"><!----></div>
This document is divided into three parts. <a href="#chapter:user">The first one</a>
describes how one can use one of the packages in the Robotics Package
Collection, either by installing a precompiled binary package, or by building
one's own copy using robotpkg. <a href="#chapter:developer">The second part</a>
explains how to prepare a package so it can be easily built by other users
without knowing about the package's building details.
<a href="#chapter:internal">The third part</a> is intended for those who want to
understand how robotpkg is implemented.
<div class="p"><!----></div>
<a id="tth_sEc1.5"></a><h2>
1.5 Terminology</h2>
<div class="p"><!----></div>
Here is a description of all the terminology used within this document.
<div class="p"><!----></div>
<dl>
<dt><b>Package</b></dt>
<dd> A set of files and building instructions that describe what's
necessary to build a certain piece of software using robotpkg. Packages are
traditionally stored under <tt>/opt/robotpkg</tt>.</dd>
<dt><b>robotpkg</b></dt>
<dd> This is the The Robotics Package Collection. It handles
building (compiling), installing, and removing of packages.</dd>
<dt><b>Distfile</b></dt>
<dd> This term describes the file or files that are provided by
the author of the piece of software to distribute his work. All the changes
necessary to build are reflected in the corresponding package. Usually the
distfile is in the form of a compressed tar-archive, but other types are
possible, too. Distfiles are usually stored below <tt>
/opt/robotpkg/distfiles</tt>.</dd>
<dt><b>Precompiled/binary package</b></dt>
<dd> A set of binaries built with robotpkg from
a distfile and stuffed together in a single <tt>.tgz</tt> file so it can be
installed on machines of the same machine architecture without the need to
recompile. Packages are usually generated in <tt>/opt/robotpkg/packages</tt>.
<div class="p"><!----></div>
Sometimes, this is referred to by the term "package" too, especially in
the context of precompiled packages.</dd>
<dt><b>Program</b></dt>
<dd> The piece of software to be installed which will be
constructed from all the files in the distfile by the actions defined in the
corresponding package.</dd>
</dl>
<div class="p"><!----></div>
<a id="tth_sEc1.6"></a><h2>
1.6 Roles involved in robotpkg</h2>
<div class="p"><!----></div>
<dl>
<dt><b>robotpkg users</b></dt>
<dd> The robotpkg users are people who use the packages
provided by robotpkg. Typically they are student working in robotics. The
usage of the software that is <em>inside</em> the packages is not covered by
the robotpkg guide.
<div class="p"><!----></div>
There are two kinds of robotpkg users: Some only want to install pre-built
binary packages. Others build the robotpkg packages from source, either for
installing them directly or for building binary packages themselves. For
robotpkg users, <a href="#chapter:user">Part <a href="#chapter:user">2</a></a> should provide
all necessary documentation.</dd>
<dt><b>package maintainers</b></dt>
<dd> A package maintainer creates packages as
described in <a href="#chapter:developer">Part <a href="#chapter:developer">3</a></a>.</dd>
<dt><b>infrastructure developers</b></dt>
<dd> These people are involved in all those
files that live in the <tt>mk/</tt> directory and below. Only these people
should need to read through
<a href="#chapter:internal">Part </a>, though others might be
curious, too.</dd>
</dl>
<div class="p"><!----></div>
<a id="tth_sEc1.7"></a><h2>
1.7 Typography</h2>
<div class="p"><!----></div>
When giving examples for commands, shell prompts are used to show if the
command should/can be issued as root, or if "normal" user privileges are
sufficient. We use a <tt>#</tt> for root's shell prompt, and a <tt>%</tt> for
users' shell prompt, assuming they use the C-shell or tcsh.
<div class="p"><!----></div>
<a id="tth_chAp2"></a><h1>
2 <br />The robotpkg user's guide</h1>
<a id="chapter:user">
</a>
<div class="p"><!----></div>
Basically, there are two ways of using robotpkg. The first is to only install
the package tools and to use binary packages that someone else has prepared.
The second way is to install the programs from source. Then you are able to
build your own packages, and you can still use binary packages from someone
else. Sections in this document will detail both approaches where appropriate.
<div class="p"><!----></div>
<div class="p"><!----></div>
<a id="tth_sEc2.1"></a><h2>
2.1 Where to get robotpkg and how to keep it up-to-date</h2> <a id="section:getting">
</a>
<div class="p"><!----></div>
Before you download and extract the files, you need to decide where you want to
extract them and where you want robotpkg to install packages. By defaut, the
<tt>/opt/openrobots</tt> directory is used. In the rest of this document, the
installation path is called the <em>prefix</em>.
<div class="p"><!----></div>
<tt>robotpkg</tt> will <em>never</em> require administration privileges by itself.
We thus recommend that you do not install or run robotpkg as the root user. If
something ever goes really wrong, it might go less wrong if it is not running
as root. If you want to install to the default location <tt>/opt/openrobots</tt>,
we recommend that you create this directory owned by a regular user.
<div class="p"><!----></div>
Creating or using <tt>/opt/openrobots</tt> typically requires administration (<em>
a.k.a.</em> "<tt>root</tt>") privileges. If you don't have such privileges (or if
you want to install to a different location), you have to unpack the sources
and install the binary packages in another prefix. If you don't have any
special administration rights on the target machine, a safe bet is to choose
the <tt>$HOME/openrobots</tt> location, as the <tt>$HOME</tt> directory will
always be writable by yourself.
<div class="p"><!----></div>
Any prefix will work, but please note that you should choose an installation
path which is dedicated to robotpkg packages and not shared with other programs
(e.g., we do not recommend to use a prefix of <tt>/usr</tt>). Also, you should
not try to add any of your own files or directories (such as <tt>src/</tt>) below
the prefix tree. This will prevent possible conflicts between programs and
other files installed by the package system and whatever else may have been
installed there.
<div class="p"><!----></div>
Finally, the installation path shall not contain white-space or other
characters that are interpreted specially by the shell and some other programs:
use only letters, digits, underscores and dashes.
<div class="p"><!----></div>
The rest of this document will assume that you are using <tt>/opt/openrobots</tt>
as the prefix. You should adapt this path to whatever prefix you choosed.
<div class="p"><!----></div>
<a id="tth_sEc2.1.1"></a><h3>
2.1.1 Getting the binary bootstrap kit</h3>
<div class="p"><!----></div>
At the moment, the binary bootstrap kit is not available. Please get the <tt>
robotpkg</tt> sources as described in the next section.
<div class="p"><!----></div>
<a id="tth_sEc2.1.2"></a><h3>
2.1.2 Getting robotpkg for source compilation</h3>
<div class="p"><!----></div>
<tt>robotpkg</tt> sources are distributed <em>via</em> the
<a href="http://git-scm.com/"><tt>git</a></tt> software content management system. <tt>
git</tt> will probably be readily available on your system but if you don't have it
installed or if you are unsure about it, contact your local system
administrator.
<div class="p"><!----></div>
There are two download methods: the anonymous one and the authenticated
one:
<div class="p"><!----></div>
<ul>
<li> Anonymous download is the recommended method if you don't intend to
work on the robotpkg infrastructure itself, nor commit any changes or
packages additions back to the robotpkg main repository. Furthermore, the
possibility to send contributions via patches is still open.
<div class="p"><!----></div>
As your regular user, simply run in a shell:
<div class="p"><!----></div>
<pre>
% cd /opt/openrobots
% git clone git://git.openrobots.org/robots/robotpkg
% # or
% git clone https://git.openrobots.org/robots/robotpkg.git
</pre>
<div class="p"><!----></div>
</li>
<li> Authenticated download requires a valid login on the main robotpkg
repository, and will give you full commit access to this repository. Simply
run the following:
<div class="p"><!----></div>
<pre>
% cd /opt/openrobots
% git clone ssh://[email protected]/robots/robotpkg
</pre>
<div class="p"><!----></div>
</li>
</ul>
<div class="p"><!----></div>
<a id="tth_sEc2.1.3"></a><h3>
2.1.3 Keeping robotpkg up-to-date</h3>
<div class="p"><!----></div>
<tt>robotpkg</tt> is a living thing: updates to the packages are made
perdiodicaly, problems are fixed, enhancements are developed... If you
downloaded the robotpkg sources via git, you should keep it up-to-date so that
you get the most recent packages descriptions. This is done by running <tt>
git pull</tt> in the robotpkg source directory:
<div class="p"><!----></div>
<pre>
% cd /opt/openrobots/robotpkg
% git pull
</pre>
<div class="p"><!----></div>
When you update robotpkg, the git program will only touch those files that are
registered in the git repository. That means that any packages that you created
on your own will stay unmodified. If you change files that are managed by git,
later updates will try to merge your changes with those that have been done by
others. See the <tt>git-pull</tt> manual for details.
<div class="p"><!----></div>
If you want to be informed of package additions and other updates, a public
mailing list is available for your reading pleasure. Go to
<a href="https://sympa.laas.fr/sympa/info/robotpkg"><tt>https://sympa.laas.fr/sympa/info/robotpkg</tt></a> for more information and
subscription.
<div class="p"><!----></div>
<a id="tth_sEc2.2"></a><h2>
2.2 Bootstrapping robotpkg</h2> <a id="section:bootstrapping">
</a>
<div class="p"><!----></div>
Once you have downloaded the robotpkg sources or the binary bootstrap kit as
described in <a href="#section:getting">Section <a href="#section:getting">2.1</a></a>, a minimal
set of the administrative package management utilities must be installed on
your system before you can use robotpkg. This is called the "bootstrap
phase" and should be done only once, the very first time you download
robotpkg.
<div class="p"><!----></div>
<a id="tth_sEc2.2.1"></a><h3>
2.2.1 Bootstrapping via the binary kit</h3>
<div class="p"><!----></div>
At the moment, the binary bootstrap kit is not available. Please bootstrap <tt>
robotpkg</tt> as described in the next section.
<div class="p"><!----></div>
<a id="tth_sEc2.2.2"></a><h3>
2.2.2 Bootstrapping from source</h3>
<div class="p"><!----></div>
You will need a working C compiler and the GNU-make utility version 3.81 or
later. If you have extracted the robotpkg archive into the standard <tt>
/opt/openrobots/robotpkg</tt> location, installing the bootstrap kit from source
should then be as simple as:
<div class="p"><!----></div>
<pre>
% cd /opt/openrobots/robotpkg/bootstrap
% ./bootstrap
</pre>
<div class="p"><!----></div>
This will install various utilities into <tt>/opt/openrobots/sbin</tt>.
<div class="p"><!----></div>
Should you prefer another installation path, you could use the <tt>--prefix</tt>
option to change the default installation prefix. For instance, configuring
robotpkg to install programs into the openrobots directory in your home
directory can be done like this:
<div class="p"><!----></div>
<pre>
% cd robotpkg/bootstrap
% ./bootstrap --prefix=${HOME}/openrobots
</pre>
<div class="p"><!----></div>
<b>After the bootstrap script has run, a message indicating the success
should be displayed. If you choosed a non-standard installation path, read
this message carefuly</b>, as it contains instructions that you have to follow in
order to setup your shell environment correctly. These instructions are
described in the next section.
<div class="p"><!----></div>
<h4>Configuring your environment</h4>
<div class="p"><!----></div>
If you configured robotpkg, during the bootstrap phase, to install to some
other location than <tt>/opt/openrobots</tt>, you have to setup manually your
shell environment so that it contains a few variables holding the installation
path. Assuming you invoked bootstrap with <tt>-prefix=/path/to/openrobots</tt>,
you have two options that are compatible with each other:
<div class="p"><!----></div>
<ul>
<li> Add the directory <tt>/path/to/openrobots/sbin</tt> to your <tt>PATH</tt>
variable. robotpkg will then be able to find its administrative tools
automatically and from that recover other configuration information. This is
the preferred method.
<div class="p"><!----></div>
</li>
<li> Create the environment variable <tt>ROBOTPKG_BASE</tt> and set its value
to <tt>/path/to/openrobots</tt>. robotpkg will look for this variable first,
so it takes precedence over the first method. This is the method you have
to choose if you have configured several instances of robotpkg in your
system. This is ony useful in some circumstances and is not normally needed.
<div class="p"><!----></div>
</li>
</ul>
<div class="p"><!----></div>
If you don't know how to setup environment variables permanently in your
system, please refer to your shell's manual or contact your local system
administrator.
<div class="p"><!----></div>
<h4>The bootstrap script usage</h4>
<div class="p"><!----></div>
The <tt>bootstrap</tt> script will by default install the package administrative
tools in <tt>/opt/openrobots/sbin</tt>, use <tt>gcc</tt> as the C compiler and <tt>
make</tt> as the GNU-make program. This behaviour can be fine-tuned by using the
following options:
<div class="p"><!----></div>
<dl>
<dt><b><tt>--prefix <path></b></dt>
<dd> will select the prefix location where
programs will be installed in.</tt></dd>
<dt><b><tt>--sysconfdir <path></b></dt>
<dd> defaults to <tt><prefix>/etc</tt>. This is the
path to the robotpkg configuration file. Other packages configuration files
(if any) will also be stored in this directory.</tt></dd>
<dt><b><tt>--pkgdbdir <path></b></dt>
<dd> defaults to <tt><prefix>/var/db/pkg</tt>. This
is the path to the package database directory where robotpkg will do its
internal bookkeeping.</tt></dd>
<dt><b><tt>--compiler <program></b></dt>
<dd> defaults to <tt>gcc</tt>. Use this option if
you want to use a different C compiler.</tt></dd>
<dt><b><tt>--make <program></b></dt>
<dd> defaults to <tt>make</tt>. Use this option if you
want to use a different make program. This program should be compatible with
GNU-make.</tt></dd>
<dt><b><tt>--help</b></dt>
<dd> displays the <tt>bootstrap</tt> usage. The comprehensive
list of recognized options will be displayed.</tt></dd>
</dl>
<div class="p"><!----></div>
<a id="tth_sEc2.3"></a><h2>
2.3 Using robotpkg</h2>
<div class="p"><!----></div>
After obtaining <tt>robotpkg</tt> , the <tt>robotpkg</tt> directory now contains a set of
packages, organized into categories. You can browse the online index of
packages, or run <tt>make index</tt> from the <tt>robotpkg</tt> directory to build
local <tt>index.html</tt> files for all packages, viewable with any web browser
such as <tt>lynx</tt> or <tt>firefox</tt>.
<div class="p"><!----></div>
<tt>robotpkg</tt> is essentially based on the <tt>make(1)</tt> program. All actions are
triggered by invoking <tt>make</tt> with the proper target. The following sections
document the most useful ones and
<a href="#section:using:targets">section <a href="#section:using:targets">2.3.7</a></a> recaps a more
comprehensive list.
<div class="p"><!----></div>
<a id="tth_sEc2.3.1"></a><h3>
2.3.1 Building packages from source</h3>
<div class="p"><!----></div>
The first step for building a package is downloading the <em>distfiles</em>
(i.e. the unmodified source). If they have not yet been downloaded, <tt>robotpkg</tt>
will fetch them automatically and place them in the <tt>robotpkg/distfiles</tt>
directory.
<div class="p"><!----></div>
Once the software has been downloaded, any patches will be applied and the
package will be compiled for you. This may take some time depending on your
computer, and how many other packages the software depends on and their compile
time.
<div class="p"><!----></div>
For example, type the following commands at the shell prompt to build the
robotpkg documentation package:
<div class="p"><!----></div>
<pre>
% cd /opt/openrobots/robotpkg
% cd doc/robotpkg
% make
</pre>
<div class="p"><!----></div>
The next stage is to actually install the newly compiled package onto your
system. While you are still in the directory for whatever package you are
installing, you can do this by entering:
<div class="p"><!----></div>
<pre>
% make install
</pre>
<div class="p"><!----></div>
Installing the package on your system does not require you to be root (except
for a few specific packages). However, if you bootstraped with a prefix for
which you don't have writing permissions, <tt>robotpkg</tt> has a <span class="roman">
just-in-time-sudo</span> feature, which allows you to become <tt>root</tt> for the
actual installation step.
<div class="p"><!----></div>
That's it, the software should now be installed under the prefix of the
packages tree - <tt>/opt/openrobots</tt> by default - and setup for use.
<div class="p"><!----></div>
You can now enter:
<div class="p"><!----></div>
<pre>
% make clean
</pre>
<div class="p"><!----></div>
to remove the compiled files in the work directory, as you shouldn't need them
any more. If other packages were also added to your system (dependencies) to
allow your program to compile, you can also tidy these up with the command:
<div class="p"><!----></div>
<pre>
% make clean-depends
</pre>
<div class="p"><!----></div>
Since the three tasks of building, installing and cleaning correspond to the
typical usage of <tt>robotpkg</tt> , a helper target doing all these tasks exists and is
called <tt>update</tt>. Thus, to intall a package with a single command, you can
simply run:
<div class="p"><!----></div>
<pre>
% make update
</pre>
<div class="p"><!----></div>
In addition, <tt>make update</tt> will also recompile all the installed packages
that were depending on the package that you are updating. This can be quite
time consuming if you are updating a low-level package. Also, note that all
packages that depend on the package you are updating will be deinstalled
first and unavailable in your system until all packages are recompiled and
reinstalled.
<div class="p"><!----></div>
<div class="p"><!----></div>
Occasionally, people want to "look under the covers" to see what is going on
when a package is building or being installed. This may be for debugging
purposes, or out of simple curiosity. A number of utility values have been
added to help with this.
<div class="p"><!----></div>
<ol type="1">
<li> If you invoke the <tt>make</tt> command with <tt>PKG_DEBUG_LEVEL=1</tt>, then
a huge amount of information will be displayed. For example,
<div class="p"><!----></div>
<pre>
% make patch PKG_DEBUG_LEVEL=1
</pre>
<div class="p"><!----></div>
will show all the commands that are invoked, up to and including the
"patch" stage. Using <tt>PKG_DEBUG_LEVEL=2</tt> will give you even
more details.
<div class="p"><!----></div>
</li>
<li> If you want to know the value of a certain <tt>make</tt> definition, then
the <tt>VARNAME</tt> variable should be used, in conjunction with the <tt>
show-var</tt> target. e.g. to show the expansion of the <tt>make</tt> variable