-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.txt
1529 lines (1250 loc) · 70.9 KB
/
README.txt
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
A guide to robotpkg
Anthony Mallet - [email protected]
October 9, 2017
Copyright ? 2006-2011,2013 LAAS/CNRS.
Copyright ? 1997-2010 The NetBSD Foundation, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. 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.
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.
Contents
1 Introduction
1.1 What is robotpkg?
1.2 Why robotpkg?
1.3 Supported platforms
1.4 Overview
1.5 Terminology
1.6 Roles involved in robotpkg
1.7 Typography
2 The robotpkg user's guide
2.1 Where to get robotpkg and how to keep it up-to-date
2.1.1 Getting the binary bootstrap kit
2.1.2 Getting robotpkg for source compilation
2.1.3 Keeping robotpkg up-to-date
2.2 Bootstrapping robotpkg
2.2.1 Bootstrapping via the binary kit
2.2.2 Bootstrapping from source
2.3 Using robotpkg
2.3.1 Building packages from source
2.3.2 Building packages from a repository checkout
2.3.3 Installing binary packages
2.3.4 Removing packages
2.3.5 Getting information about installed packages
2.3.6 Other administrative functions
2.3.7 Available make targets
2.4 Configuring robotpkg
2.4.1 Selecting build options
2.4.2 Selecting build alternatives
2.4.3 Defining collections of packages
2.4.4 Package specific configuration variables
2.4.5 General configuration variables
2.4.6 Variables affecting the build process
2.4.7 Additional flags to the compiler
2.5 Creating binary packages for everything
2.5.1 Initial setup
2.5.2 Running bulk builds
2.5.3 Generating pretty reports
2.5.4 Automated bulk builds
3 The robotpkg developer's guide
3.1 Package files, directories and contents
3.1.1 Makefile
3.1.2 distinfo
3.1.3 PLIST
3.1.4 patches/*
3.2 General operation
3.2.1 Adding build options to a package
3.2.2 Customizing the PLIST
3.2.3 Customizing the semi-automatic PLIST generation
3.2.4 Incrementing versions when fixing an existing package
3.2.5 Substituting variable text in the package files
3.3 The build phase
1
Introduction
1.1 What is robotpkg?
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.
The robotpkg project was initiated in the Laboratory for Analysis and
Architecture of Systems (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.
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 The NetBSD Packages Collection (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.
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:
* architecture/genom - The LAAS Generator of Robotic Components
* architecture/openrtm - The robotic distributed middleware from AIST, Japan
* middleware/yarp - The "other", yet famous, robot platform
* ...just to name a few.
1.2 Why robotpkg?
robotpkg provides the following key features:
* 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.
* All packages are installed in a consistent directory tree, including
binaries, libraries, man pages and other documentation.
* Package dependencies, including when performing package updates, are
handled automatically.
* 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.
* 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.
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.
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.
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.
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.
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.
Still, robotpkg directly uses many of the pkgsrc tools unchanged and the binary
packages are fully compatible.
1.3 Supported platforms
robotpkg consists of a source distribution. After retrieving the required
source, you can be up and running with robotpkg in just minutes!
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:
+----------------------------------------------------------------------------+
|Platform| Version |
|--------+-------------------------------------------------------------------|
|--------+-------------------------------------------------------------------|
| Fedora | 25 or above |
|--------+-------------------------------------------------------------------|
| Ubuntu | 12.04 or above |
|--------+-------------------------------------------------------------------|
| Debian | 7 or above |
|--------+-------------------------------------------------------------------|
| NetBSD | 6 or above |
|--------+-------------------------------------------------------------------|
| Darwin |Partial support - infrastructure works, individual packages may not|
+----------------------------------------------------------------------------+
Any other Unix-like platform should usually work.
1.4 Overview
This document is divided into three parts. The first one 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. The second part explains how to prepare a package so it can be easily
built by other users without knowing about the package's building details. The
third part is intended for those who want to understand how robotpkg is
implemented.
1.5 Terminology
Here is a description of all the terminology used within this document.
Package
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 /opt/robotpkg.
robotpkg
This is the The Robotics Package Collection. It handles building
(compiling), installing, and removing of packages.
Distfile
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 /opt/robotpkg/distfiles.
Precompiled/binary package
A set of binaries built with robotpkg from a distfile and stuffed together
in a single .tgz file so it can be installed on machines of the same
machine architecture without the need to recompile. Packages are usually
generated in /opt/robotpkg/packages.
Sometimes, this is referred to by the term "package" too, especially in the
context of precompiled packages.
Program
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.
1.6 Roles involved in robotpkg
robotpkg users
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 inside the packages is not covered by the robotpkg guide.
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, Part 2 should provide all necessary documentation.
package maintainers
A package maintainer creates packages as described in Part 3.
infrastructure developers
These people are involved in all those files that live in the mk/ directory
and below. Only these people should need to read through Part , though
others might be curious, too.
1.7 Typography
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 # for root's shell prompt, and a % for users' shell
prompt, assuming they use the C-shell or tcsh.
2
The robotpkg user's guide
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.
2.1 Where to get robotpkg and how to keep it up-to-date
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 /
opt/openrobots directory is used. In the rest of this document, the
installation path is called the prefix.
robotpkg will never 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 /opt/openrobots, we
recommend that you create this directory owned by a regular user.
Creating or using /opt/openrobots typically requires administration ( a.k.a.
"root") 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 $HOME/
openrobots location, as the $HOME directory will always be writable by
yourself.
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 /usr). Also, you should not try
to add any of your own files or directories (such as src/) 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.
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.
The rest of this document will assume that you are using /opt/openrobots as the
prefix. You should adapt this path to whatever prefix you choosed.
2.1.1 Getting the binary bootstrap kit
At the moment, the binary bootstrap kit is not available. Please get the
robotpkg sources as described in the next section.
2.1.2 Getting robotpkg for source compilation
robotpkg sources are distributed via the git software content management
system. git 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.
There are two download methods: the anonymous one and the authenticated one:
* 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.
As your regular user, simply run in a shell:
% cd /opt/openrobots
% git clone git://git.openrobots.org/robots/robotpkg
% # or
% git clone https://git.openrobots.org/robots/robotpkg.git
* 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:
% cd /opt/openrobots
% git clone ssh://[email protected]/robots/robotpkg
2.1.3 Keeping robotpkg up-to-date
robotpkg 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 git pull in the
robotpkg source directory:
% cd /opt/openrobots/robotpkg
% git pull
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 git-pull manual for details.
If you want to be informed of package additions and other updates, a public
mailing list is available for your reading pleasure. Go to https://
sympa.laas.fr/sympa/info/robotpkg for more information and subscription.
2.2 Bootstrapping robotpkg
Once you have downloaded the robotpkg sources or the binary bootstrap kit as
described in Section 2.1, 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.
2.2.1 Bootstrapping via the binary kit
At the moment, the binary bootstrap kit is not available. Please bootstrap
robotpkg as described in the next section.
2.2.2 Bootstrapping from source
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 /opt/
openrobots/robotpkg location, installing the bootstrap kit from source should
then be as simple as:
% cd /opt/openrobots/robotpkg/bootstrap
% ./bootstrap
This will install various utilities into /opt/openrobots/sbin.
Should you prefer another installation path, you could use the --prefix 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:
% cd robotpkg/bootstrap
% ./bootstrap --prefix=${HOME}/openrobots
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, 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.
Configuring your environment
If you configured robotpkg, during the bootstrap phase, to install to some
other location than /opt/openrobots, you have to setup manually your shell
environment so that it contains a few variables holding the installation path.
Assuming you invoked bootstrap with -prefix=/path/to/openrobots, you have two
options that are compatible with each other:
* Add the directory /path/to/openrobots/sbin to your PATH variable. robotpkg
will then be able to find its administrative tools automatically and from
that recover other configuration information. This is the preferred method.
* Create the environment variable ROBOTPKG_BASE and set its value to /path/to
/openrobots. 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.
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.
The bootstrap script usage
The bootstrap script will by default install the package administrative tools
in /opt/openrobots/sbin, use gcc as the C compiler and make as the GNU-make
program. This behaviour can be fine-tuned by using the following options:
--prefix <path>
will select the prefix location where programs will be installed in.
--sysconfdir <path>
defaults to <prefix>/etc. This is the path to the robotpkg configuration
file. Other packages configuration files (if any) will also be stored in
this directory.
--pkgdbdir <path>
defaults to <prefix>/var/db/pkg. This is the path to the package database
directory where robotpkg will do its internal bookkeeping.
--compiler <program>
defaults to gcc. Use this option if you want to use a different C compiler.
--make <program>
defaults to make. Use this option if you want to use a different make
program. This program should be compatible with GNU-make.
--help
displays the bootstrap usage. The comprehensive list of recognized options
will be displayed.
2.3 Using robotpkg
After obtaining robotpkg , the robotpkg directory now contains a set of
packages, organized into categories. You can browse the online index of
packages, or run make index from the robotpkg directory to build local
index.html files for all packages, viewable with any web browser such as lynx
or firefox.
robotpkg is essentially based on the make(1) program. All actions are triggered
by invoking make with the proper target. The following sections document the
most useful ones and section 2.3.7 recaps a more comprehensive list.
2.3.1 Building packages from source
The first step for building a package is downloading the distfiles (i.e. the
unmodified source). If they have not yet been downloaded, robotpkg will fetch
them automatically and place them in the robotpkg/distfiles directory.
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.
For example, type the following commands at the shell prompt to build the
robotpkg documentation package:
% cd /opt/openrobots/robotpkg
% cd doc/robotpkg
% make
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:
% make install
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, robotpkg has a just-in-time-sudo
feature, which allows you to become root for the actual installation step.
That's it, the software should now be installed under the prefix of the
packages tree - /opt/openrobots by default - and setup for use.
You can now enter:
% make clean
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:
% make clean-depends
Since the three tasks of building, installing and cleaning correspond to the
typical usage of robotpkg , a helper target doing all these tasks exists and is
called update. Thus, to intall a package with a single command, you can simply
run:
% make update
In addition, make update 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.
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.
1. If you invoke the make command with PKG_DEBUG_LEVEL=1, then a huge amount
of information will be displayed. For example,
% make patch PKG_DEBUG_LEVEL=1
will show all the commands that are invoked, up to and including the
"patch" stage. Using PKG_DEBUG_LEVEL=2 will give you even more details.
2. If you want to know the value of a certain make definition, then the
VARNAME variable should be used, in conjunction with the show-var target.
e.g. to show the expansion of the make variable LOCALBASE:
% make show-var VARNAME=LOCALBASE
2.3.2 Building packages from a repository checkout
Before building a package, robotpkg fetches the sources from the official(s)
download location(s), as instructed by the MASTER_SITES variable. This is the
standard and expected behaviour when you work with stable packages.
Occasionally, though, it is useful to fetch a snapshot of the sources from a
development repository. For instance, one might want to quickly test a release
candidate of a package, or fix a simple bug and create a patch from the fix.
Whenever a package defines the MASTER_REPOSITORY variable, robotpkg is able to
temporarily work with the repository defined in this variable. At the moment,
cvs, svn and git repositories are supported.
To enable this feature for a given package, you have to first instruct robotpkg
to work from a 'checkout' (instead of the stable releases) by doing 'make
checkout' in the package directory. For instance:
% cd robotpkg/foo/bar
% make checkout
This sets a permanent flag in the working directory of the package and the
checkout configuration option will be retained until the next ' make clean'.
After a 'make clean', the configuration option is set back to its default and
robotpkg will work again with stable releases. This option is set on a per
package basis only: configuring one package to work with checkouts does not
affect the behaviour of other packages.
After a 'make checkout' (and until a 'make clean'), the package has a regular
checkout in its working subdirectory. You can thus manually edit, commit,
switch branches, etc. in the package sources, like in any other repository, by
first cding into the working directory, then using the usual repository
commands (cvs, svn or git).
Of course, the individual robotpkg targets are still available from the package
entry in the robotpkg hierarchy. You can for instance 'make patch',
'configure', 'build', 'install' or 'update' as usual. Note that robotpkg is not
exactly stateless, and this is most visible when working with checkouts: for
instance, after a successful 'make build', you have to do 'make rebuild' to
force rebuilding if you have modified the sources. The same holds for
'configure' (do 'reconfigure') or 'install' (do 'reinstall', but since you
cannot install a package twice, you normally have to use 'make replace' in the
particular case of reinstalling a package).
The 'clean' target is special, in that it removes the checkout configuration
option and all checkouted sources, including locally modified sources. In order
to prevent accidental deletion of precious files, you have to confirm the
cleanign with 'clean confirm', as in:
% make clean confirm
A final remark: we STRONGLY DISCOURAGE the use of robotpkg as a development
tool (i.e. using the 'checkout' feature on a regular basis), for at least two
reasons:
* robotpkg is not designed for this: it will not really help you in your
daily development work, compared to the manual configuration installation
of the software. It will sometimes create even more trouble, by ensuring
that all the software depending on the checkouted software is up-to-date,
which is not necessarily something you want to do every time you compile.
* A checkout breaks the notion of 'release' and you loose all the benefits
from working with packages. In particular, you have no clear state of what
is installed: you cannot easily reproduce the situation of time T at time
T+n and don't know precisely who requires which version of what. It is much
more efficient and robust to release frequently a software in a development
phase, than using a rolling release approach.
In our opinion, the 'checkout' target use should be limited to testing a
release candidate or quickly fix a bug and create a patch from the fix, that
you commit upstream and put in the patches/ directory until the next release.
2.3.3 Installing binary packages
At the moment, installing binary packages is not documented.
2.3.4 Removing packages
To deinstall a package, it does not matter whether it was installed from source
code or from a binary package. The robotpkg_delete command does not know it
anyway. To delete a package, you can just run robotpkg_delete <package-name>.
The package name can be given with or without version number. Wildcards can
also be used to deinstall a set of packages, for example *genom* all packages
whose name contain the word genom. Be sure to include them in quotes, so that
the shell does not expand them before robotpkg_delete sees them.
The -r option is very powerful: it removes all the packages that require the
package in question and then removes the package itself. For example:
% robotpkg_delete -r genom
will remove genom and all the packages that used it; this allows upgrading the
genom package.
2.3.5 Getting information about installed packages
The robotpkg_info shows information about installed packages or binary package
files.
2.3.6 Other administrative functions
The robotpkg_admin executes various administrative functions on the package
system.
2.3.7 Available make targets
The following targets are available in a package directory. They can be invoked
by running make <target> after cding into some robotpkg/category/package.
Source manipulation
fetch
Download the ${DISTFILES}.
extract
Extract the contents of ${DISTFILES} into the work directory ${WRKDIR}.
patch
Apply local patches available in ${PATCHDIR} (usually the patches directory
in the package).
checkout
Extract the sources in ${WRKDIR} from ${MASTER_REPOSITORY} instead of $
{MASTER_SITES}. This can be used to fetch a not yet released version
instead of the latest release. This is mutually exclusive with the fetch
and extract targets. See section 2.3.2 for details.
configure
Perform the necessary actions to configure the sources. This may for
instance involve running configure or cmake. If no configuration is
required, this step simply does nothing.
build
Or just make, the default target. It compiles the package locally in $
{WRKDIR}.
install
Install the package into ${PREFIX}. The package is then available to the
rest of the system. If an older version of the package is installed and
required by other packages, this target requires confirmation. Otherwise,
any older version of the package is first deinstalled.
replace
Same as install, but does not remove packages that depend on the replaced
package. This saves some time, since already installed package are not
touched, but if the replaced package is incompatible with the older
version, you will run into trouble. Use with care and when you know what
you are doing.
clean
Tidy the work directory and removes ${WRKDIR}. If the package was extracted
using checkout, this target requires confirmation as it may delete locally
modified files that will be lost.
update
This is a shortcut target for fetch, extract, configure, build, install and
clean. If the package is already installed and up-to-date, the target asks
for confirmation.
Introspection
show-options
Display the list of available alternatives (see section 2.4.2) and build
options (see section 2.4.1).
show-depends
Recursively display all the required dependencies of a package. The results
are splitted between system and robotpkg dependencies, and missing
dependencies are indicated.
show-var
Display the contents of a variable. This must be invoked as make show-var
VARNAME=foo, where foo is the name of the variable to be displayed.
Package sets
fetch-depends, replace-depends, update-depends, clean-depends
This runs the same action as fetch, replace, update or clean
(respectively), but on all dependencies of the package, including the
package itself. Useful to update a meta-packages, for instance.
fetch-<set>, replace-<set>, update-<set>, clean-<set>
This runs the same action as fetch, replace, update or clean
(respectively), but on all members of the package set named <set>. See
section 2.4.3 for an explanation of package sets and how to configure them.
2.4 Configuring robotpkg
The whole robotpkg system is configured via a single, centralized file, called
robotpkg.conf and placed in the /opt/openrobots/etc directory by default. This
location might be redefined during the bootstrap phase, see Section 2.2. During
the bootstrap, an initial configuration file is created with the settings you
provided to bootstrap.
The format of the configuration file is that of the usual GNU style Makefiles.
The whole robotpkg configuration is done by setting variables in this file.
Note that you can define all kinds of variables, and no special error checking
(for example for spelling mistakes) takes place, so you have to try it out to
see if it works.
2.4.1 Selecting build options
Some packages have build time options, usually to select between different
dependencies, enable optional support for big dependencies or enable
experimental features.
To see which options, if any, a package supports, and which options are
mutually exclusive, run make show-options. For example:
Any of the following general options may be selected:
api Generate module API only
debug Produce debugging information for binary programs
* openprs Generate OpenPRS client code
* python Enable Python client code
*d tcl Generate TCL client code
* tclserv_client Generate C tclServ client code
xenomai Enable Xenomai support
This indicates that the package supports a number of options (api, debug,
openprs ...). The currently enabled options are indicated by a star (*) and the
default options are shown by the small letter d in front of each option (here,
only the tcl is enabled by default).
The following variables can be defined in robotpkg.conf to select which options
to enable for a package:
PKG_DEFAULT_OPTIONS
can be used to select or disable options for all packages that support
them,
PKG_OPTIONS.<pkgbase>
can be used to select or disable options specifically for package
<pkgbase>. Options listed in these variables are selected, options prefixed
by - are disabled (e.g. -tcl would disable the tcl option).
A few examples:
PKG_DEFAULT_OPTIONS= debug
PKG_OPTIONS.genom= doc -tcl
It is important to note that options that were specifically suggested by the
package maintainer must be explicitely removed if you do not wish to include
the option. If you are unsure you can view the current state with make
show-options.
The following settings are consulted in the order given, and the last setting
that selects or disables an option is used:
1. the default options as suggested by the package maintainer,
2. PKG_DEFAULT_OPTIONS,
3. PKG_OPTIONS.<pkgbase>
For groups of mutually exclusive options, the last option selected is used, all
others are automatically disabled. If an option of the group is explicitly
disabled, the previously selected option, if any, is used. It is an error if no
option from a required group of options is selected, and building the package
will fail.
2.4.2 Selecting build alternatives
Some packages have alternative dependencies, usually to select between
equivalent components or versions of components. This is similar to options but
the configuration is done globally for all packages that use the same
alternatives (this is to ensure consistency between packages).
To see which alternatives, if any, a package uses, run make show-options. For
example:
Available c-compiler alternatives (PREFER_ALTERNATIVE.c-compiler):
*1 gcc Use the GNU C compiler
2 clang Use the LLVM C compiler
ccache-gcc Use ccache and the GNU C compiler
ccache-clang Use ccache and the LLVM C compiler
This indicates that the package supports a c-compiler alternative, for which
gcc, clang, ccache-gcc and ccache-clang can be used. The currently selected
alternative is shown by the star (*), and the user preferences (or the default
if the user has not set explicit preferences) are indicated by the integer in
front of the alternative item (here gcc is the preferred alternative, then
clang should be used if gcc is not available. ccache should not be used).
The following variables can be defined in robotpkg.conf to select which
alternative to use:
PREFER_ALTERNATIVE.<alt>
Alternatives are selected by setting the variable corresponding to the
alternative (PREFER_ALTERNATIVE.c-compiler in the example above) to a space
separated list, sorted by order of preference, containing one or several of
the items shown by make show-options.
2.4.3 Defining collections of packages
Instead of installing, removing or updating packages one-by-one, you can define
collections of packages in your robotpkg.conf. Once one or more collections are
defined, they enable special targets that work on all the packages of a
collection.
To define a collection, you have to give it a name and list the set of packages
forming the collection in the special PKGSET variable in robotpkg.conf. The
syntax is the following:
PKGSET.<name> = <list>
PKGSET_DESCR.<name> = short, optional description of the collection
where <name> is the name of the collection (any string is valid) and <list> is
the list of packages in the collection, in the form <category>/<name>. For
instance,
PKGSET.myset = architecture/genom middleware/pocolibs
PKGSET_DESCR.myset = an awesome duo
defines a collection named myset that contains the two packages genom and
pocolibs and describes itself with a rather doubtful sentence.
For each collection <name> defined in robotpkg.conf, the following targets are
available: clean-<name>, fetch-<name>, extract-<name>, install-<name>, replace-
<name>, update-<name> and deinstall-<name>. They perform the same action as
their respective counterpart without -<name> suffix, expect that they work on
all packages of the set. In addition, for the replace, update and deinstall
targets, they sort the packages in the order of their dependencies so that the
job is done a sensible order.
For the user convenience, two special targets are provided. The "installed"
collection is always defined and represents all currently installed packages.
Invoking, for instance, the update-installed target will therefore update all
currently installed packages. The "depends" collection is available only when
the current working directory is inside a package. It merely defines the
current package and all of its dependencies as the sole elements of the
collection. Invoking, for instance, the update-depends target will update all
dependencies of the package in the current directory.
Two robotpkg.conf variables affect the default behaviour of robotpkg regarding
packages sets:
PKGSET_FAILSAFE
When working on a set, and this variable is set to yes, robotpkg will
continue with further packages instead of stopping on an error. If set to
'no', stop on first error. Default: no.
PKGSET_STRICT
Specify if package sets should be considered as 'strict' or include
dependencies of packages defined in the set. If set to 'yes', only package
strictly defined in sets are considered. If set to 'no', dependencies of
packages listed in sets are added to their respective sets. Default: no.
Each of these variables can be defined on a per-collection basis, by adding the
.<name> suffix to the variable name, where <name> is the name of the collection
to be configured.
2.4.4 Package specific configuration variables
In this section, you can find variables that apply to one specific package.
Each variable is suffixed by .<pkg>, where <pkg> is the actual package name to
which the variable should apply.
REPOSITORY.<pkg>
locally overrides the default MASTER_REPOSITORY defined for a package. This
is useful if you want to work with an alternative, perhaps local,
repository when doing a make checkout.
CHECKOUT_VCS_OPTS.<pkg>
is a list of options used when fetching a package via a make checkout
command. The options are passed to the "cvs checkout", "git clone" or "svn
checkout" command that extract the source archive.
2.4.5 General configuration variables
In this section, you can find some variables that apply to all robotpkg
packages.
ACCEPTABLE_LICENSES
List of acceptable licenses. Whenever you try to build a package whose
license is not in this list, you will get an error message that includes
instructions on how to change this variable.
DISTDIR
Where to store the downloaded copies of the original source distributions
used for building robotpkg packages. The default is $ROBOTPKG_DIR/
distfiles.
PACKAGES
The top level directory for the binary packages. The default is
$ROBOTPKG_DIR/packages.
MASTER_SITE_BACKUP
List of backup locations for distribution files if not found locally or in
$MASTER_SITES. The default is
http://softs.laas.fr/openrobots/robotpkg/distfiles/.
PKG_DEBUG_LEVEL
The level of debugging output which is displayed whilst making and
installing the package. The default value for this is 0, which will not
display the commands as they are executed (normal, default, quiet
operation); the value 1 will display all shell commands before their
invocation, and the value 2 will display both the shell commands before
their invocation, and their actual execution progress with set -x.
2.4.6 Variables affecting the build process
WRKOBJDIR
The top level directory where, if defined, the separate working directories
will get created. This is useful for building packages on a different
filesystem than the robotpkg sources.
OBJHOSTNAME
If set to yes (the default), use hostname-specific working directories,
e.g. work.cactus, work.localhost. OBJHOSTNAME takes precedence over
OBJMACHINE (see below).
OBJMACHINE
If set to yes (the default) use machine-specific working directories, e.g.
work.Linux-i386.
DEPENDS_TARGET
By default, dependencies are only installed, and no binary package is
created for them. You can set this variable to package to automatically
create binary packages after installing dependencies.
LOCALBASE
Where packages will be installed. The default value is /opt/openrobots. Do
not mix binary packages with different values of LOCALBASEs!
MAKE_JOBS
When defined, specifies the maximum number of jobs that are run in parallel
when building packages with the default action. MAKE_JOBS only affects the
"build" target. MAKE_JOBS can be set to any positive integer; useful values
are around the number of processors on the machine.
2.4.7 Additional flags to the compiler
If you wish to set compiler variables such as CFLAGS, CXXFLAGS, FFLAGS ...
please make sure to use the += operator instead of the = operator:
CFLAGS+= -your -flags
Using CFLAGS= (i.e. without the "+") may lead to problems with packages that
need to add their own flags.
If you want to pass flags to the linker, both in the configure step and the
build step, you can do this in two ways. Either set LDFLAGS or LIBS. The
difference between the two is that LIBS will be appended to the command line,
while LDFLAGS come earlier. LDFLAGS is pre-loaded with rpath settings for
machines that support it. As with CFLAGS you should use the += operator:
LDFLAGS+= -your -linkerflags
2.5 Creating binary packages for everything
There are two ways of getting a set of binary packages: manually building the
packages you need, or using robotpkg "bulk build" infrastructure.
Bulk builds can also be used to test that packages compile and install cleanly,
and robotpkg provides reporting tools that can summarize the results of a "bulk
build".
2.5.1 Initial setup
The required setup for running bulk build merely consists in properly setting
up robotpkg itself. Details can be found in sections 2.2 and 2.4.
For instance, setup robotpkg in the /local/robotpkg directory:
% mkdir -p /local/var/lib
% cd /local/var/lib
% git clone git://git.openrobots.org/git/robots/robotpkg
% cd robotpkg/bootstrap
% ./bootstrap --prefix=/local/robotpkg
You should install at least pkgtools/pkg_install, pkgtools/digest and pkgtools/
tnftp. Optionally, you can install pkgtools/rbulkit that can generate pretty
HTML reports (section 2.5.3).
% cd /local/var/lib/robotpkg
% cd pkgtools/rbulkit
% make update
You must configure the prefix directory where binary packages are built. This
is important: since binary package are not relocatable, this directory will be
the installation directory of all generated packages. However, if you use bulk
builds only as a way to test the build of your packages, any directory can be
configured. The following variables can be customized in robotpkg.conf:
BULKBASE?= /opt/openrobots
The installation prefix of binary packages. This must be different from the
${LOCALBASE} directory where regular robotpkg packages are installed. The
default is /opt/openrobots.
BULK_LOGDIR?= ${LOCALBASE}/var/log/bulk
The directory where log files are kept. The default is to put log files in
the regular installation prefix of robotpkg ( /local/robotpkg/var/log/bulk
in the example setup above).
BULK_TAG
A name (alphanumeric characters) for that bulk session. The default name is