summaryrefslogtreecommitdiffstats
path: root/doc/legal.mdwn
blob: 1f2cd9baae85de68e97201d8b7481a245164e6a5 (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
[[!meta title="Legal and Technical Notices"]]

Copyright Information
=====================

The programs included with ProteanOS are free software; the exact distribution
terms for each program are described in the individual files in
`/usr/share/doc/*/copyright` on a ProteanOS system.


Getting and Building ProteanOS Source Code
==========================================

ProteanOS's binary packages are built from source packages, which can be
installed and built on a ProteanOS system.

Getting a Source Package
------------------------

First pick a source package you want to download.  If you're not sure which
source package builds a particular binary package, you can use the **opkg**
utility to check the package's `Source` control field.  From a ProteanOS shell,
run the following command:

    # opkg info file | grep '^Source: '
    Source: file

Or if you use prokit, the ProteanOS Development Kit, run the following, where
`$root` is the path to your ProteanOS system's root:

    $ sudo prokit opkg $root info file | grep '^Source: '
    Source: file

This tells us that the `file` source package builds the `file` binary package.
Now, install `src-<srcpkg>`.  From ProteanOS:

    # opkg install src-file
    Installing src-file (5.17-3) to root...
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/src/all/base/../../../../../../pool/f/file/src-file_5.17-3_src_all.opk.
    Configuring src-file.

Or using prokit:

    $ sudo prokit opkg $root install src-file
    Installing src-file (5.17-3) to root...
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/src/all/base/../../../../../../pool/f/file/src-file_5.17-3_src_all.opk.
    Configuring src-file.

Find the source package installed under `/usr/src/`:

    # ls /usr/src/file_5.17-3/
    build                  file-doc.pkg           libmagic.1.pkg
    changelog              file.pkg               source.mk
    control                format                 substvars
    copyright              libmagic-dev.pkg
    file-5.17.orig.tar.gz  libmagic-doc.pkg

Or:

    $ sudo prokit shell $root ls /usr/src/file_5.17-3/
    build                  file-doc.pkg           libmagic.1.pkg
    changelog              file.pkg               source.mk
    control                format                 substvars
    copyright              libmagic-dev.pkg
    file-5.17.orig.tar.gz  libmagic-doc.pkg

Building the Source Package
---------------------------

First, install the `build-essential` binary package if you haven't already:

    # opkg install build-essential
    Installing build-essential (1.1) on root.
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/amd64-linux-glibc/all/base/../../../../../../pool/b/build-essential/build-essential_1.1_amd64-linux-glibc_all.opk.
    package cpp-4.7 suggests installing gcc-4.7-locales
    package gcc-4.7-amd64-linux-glibc suggests installing gcc-4.7-locales
    package gcc-4.7-amd64-linux-glibc suggests installing libmudflap.0-4.7-dev
    package g++-4.7-amd64-linux-glibc suggests installing gcc-4.7-locales
    Installing build-essential-amd64-linux-glibc (1.1) on root.
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/all/all/base/../../../../../../pool/b/build-essential/build-essential-amd64-linux-glibc_1.1_all_all.opk.
    [...]

Or:

    $ sudo prokit opkg $root install build-essential
    Installing build-essential (1.1) on root.
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/amd64-linux-glibc/all/base/../../../../../../pool/b/build-essential/build-essential_1.1_amd64-linux-glibc_all.opk.
    package cpp-4.7 suggests installing gcc-4.7-locales
    package gcc-4.7-amd64-linux-glibc suggests installing gcc-4.7-locales
    package gcc-4.7-amd64-linux-glibc suggests installing libmudflap.0-4.7-dev
    package g++-4.7-amd64-linux-glibc suggests installing gcc-4.7-locales
    Installing build-essential-amd64-linux-glibc (1.1) on root.
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/all/all/base/../../../../../../pool/b/build-essential/build-essential-amd64-linux-glibc_1.1_all_all.opk.
    [...]

This may take a while, depending on your network connection.

If you're using a ProteanOS shell directly, you'll have to manually find and
install the build dependencies.  Check the `control` file:

    # cd /usr/src/file_5.17-3/
    # cat control
    Maintainer: "P. J. McDermott" <pj@pehjota.net>
    Build-Depends: opkhelper-3.0, libz.1-dev
    Homepage: http://www.darwinsys.com/file/

This source package needs the `opkhelper-3.0` and `libz.1-dev` packages to
build.  Install those:

    # opkg install opkhelper-3.0 libz.1-dev
    Package opkhelper-3.0 (3.0.0-2) installed in root is up to date.
    Installing libz.1-dev (1.2.8+sip1-1) to root...
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/amd64-linux-glibc/all/base/../../../../../../pool/z/zlib/libz.1-dev_1.2.8+sip1-1_amd64-linux-glibc_all.opk.
    Configuring libz.1-dev.

Finally, run **opkbuild** to build the package:

    # opkbuild
    opkbuild: Detecting architecture and platform...
    opkbuild: Making work area...
    opkbuild: Parsing package metadata...
    opkbuild: Building source package...
    ob-genchanges: Generating "file_5.17-3_src_all.changes"...
    opkbuild: Build system:
    opkbuild:   Architecture:  amd64-linux-glibc
    opkbuild:   Platform:      dev
    opkbuild: Host system:
    opkbuild:   Architecture:  amd64-linux-glibc
    opkbuild:   Platform:      dev
    [...]
    ob-installdocs: Making link to documentation in package "file"...
    ob-installdocs: Making link to documentation in package "libmagic-dev"...
    ob-installdocs: Installing package documentation into package "libmagic.1"...
    ob-installdocs: Making link to documentation in package "file-doc"...
    ob-installdocs: Making link to documentation in package "libmagic-doc"...
    ob-genchanges: Generating "file_5.17-3_amd64-linux-glibc_dev.changes"...

Or if you're using prokit, you can simply run the following command, and prokit
will find and install the build dependencies automatically:

    $ sudo prokit build $root $root/usr/src/file_5.17-3/
    Installing prokit-builddeps-1521897985 (1.0) on root.
    Package opkhelper-3.0 (3.0.0-2) installed in root is up to date.
    Installing libz.1-dev (1.2.8+sip1-1) on root.
    Downloading http://us.mirror.gnu.dk/pub/proteanos/feeds/dev/trunk/amd64-linux-glibc/all/base/../../../../../../pool/z/zlib/libz.1-dev_1.2.8+sip1-1_amd64-linux-glibc_all.opk.
    Configuring libz.1-dev.
    Configuring prokit-builddeps-1521897985.
    opkbuild: Detecting architecture and platform...
    opkbuild: Making work area...
    opkbuild: Parsing package metadata...
    opkbuild: Building source package...
    ob-genchanges: Generating "file_5.17-3_src_all.changes"...
    opkbuild: Build system:
    opkbuild:   Architecture:  amd64-linux-glibc
    opkbuild:   Platform:      dev
    opkbuild: Host system:
    opkbuild:   Architecture:  amd64-linux-glibc
    opkbuild:   Platform:      dev
    [...]
    ob-installdocs: Making link to documentation in package "file"...
    ob-installdocs: Making link to documentation in package "libmagic-dev"...
    ob-installdocs: Installing package documentation into package "libmagic.1"...
    ob-installdocs: Making link to documentation in package "file-doc"...
    ob-installdocs: Making link to documentation in package "libmagic-doc"...
    ob-genchanges: Generating "file_5.17-3_amd64-linux-glibc_dev.changes"...
    Removing package prokit-builddeps-1521897985 from root...
    libz.1-dev was autoinstalled and is now orphaned, removing.
    Removing package libz.1-dev from root...

Find the resulting packages and changes files in `/usr/src/`:

    # ls /usr/src/
    file-doc_5.17-3_all_all.opk
    file_5.17-3
    file_5.17-3_amd64-linux-glibc_all.opk
    file_5.17-3_amd64-linux-glibc_dev.changes
    file_5.17-3_src_all.changes
    libmagic-dev_5.17-3_amd64-linux-glibc_all.opk
    libmagic-doc_5.17-3_all_all.opk
    libmagic.1_5.17-3_amd64-linux-glibc_all.opk
    src-file_5.17-3_src_all.opk

Or from a host system on which you've been using prokit:

    $ ls $root/usr/src/
    file-doc_5.17-3_all_all.opk
    file_5.17-3
    file_5.17-3_amd64-linux-glibc_all.opk
    file_5.17-3_amd64-linux-glibc_dev.changes
    file_5.17-3_src_all.changes
    libmagic-dev_5.17-3_amd64-linux-glibc_all.opk
    libmagic-doc_5.17-3_all_all.opk
    libmagic.1_5.17-3_amd64-linux-glibc_all.opk
    src-file_5.17-3_src_all.opk