Compare commits
327 Commits
cross-buil
...
main
Author | SHA1 | Date | |
---|---|---|---|
13bf342e37 | |||
9e1fc4ed1a | |||
056a61ccf5 | |||
b12fd561c8 | |||
![]() |
69fc8b8fc1 | ||
![]() |
6d741ffba8 | ||
![]() |
af0c88e6ab | ||
![]() |
e125a76489 | ||
![]() |
d0828c0655 | ||
![]() |
bad781082d | ||
![]() |
c9d3df08b3 | ||
![]() |
57185172c5 | ||
![]() |
5adf47c168 | ||
![]() |
4f5b0a14bd | ||
![]() |
660f793d6d | ||
![]() |
d5826968b7 | ||
![]() |
d5f4982a9a | ||
![]() |
0d3dc71833 | ||
![]() |
478d4e9452 | ||
![]() |
ec96c604e9 | ||
![]() |
bb0324e398 | ||
![]() |
0745179c4f | ||
![]() |
80a2e6f8cf | ||
![]() |
918b7b1920 | ||
![]() |
51d9e3bcb9 | ||
![]() |
95cd15c025 | ||
![]() |
21dcfb1f21 | ||
![]() |
d8cfcd5dc9 | ||
![]() |
6d321050e5 | ||
![]() |
2162348a9a | ||
![]() |
71d9d5233b | ||
![]() |
114c0cf287 | ||
![]() |
1cfbdf688c | ||
![]() |
f04a2ee34b | ||
![]() |
672032a4be | ||
![]() |
b80a27b86a | ||
![]() |
5b34b696d4 | ||
![]() |
918cba2a77 | ||
![]() |
b3dcf19ef7 | ||
![]() |
c486b3b4f3 | ||
![]() |
f3dc428ea0 | ||
![]() |
43fb2c012e | ||
![]() |
a8f564287e | ||
![]() |
6c3b2e6b58 | ||
![]() |
b09bdddff3 | ||
![]() |
511b934182 | ||
![]() |
66177eb5ec | ||
![]() |
1c075c2855 | ||
![]() |
05eee44039 | ||
![]() |
f9da71cc68 | ||
![]() |
baf17c8dd7 | ||
![]() |
dbf0e80e62 | ||
![]() |
6e5bd59d6f | ||
![]() |
aa86438443 | ||
![]() |
610f1982ef | ||
![]() |
f9707808ef | ||
![]() |
3ca7660b66 | ||
![]() |
b1b47140ea | ||
![]() |
9be3a6c6a0 | ||
![]() |
5486d877c5 | ||
![]() |
7a8b3a8e7d | ||
![]() |
6310405af8 | ||
![]() |
0d4bb95046 | ||
![]() |
9c284d4c33 | ||
![]() |
7edafd8c75 | ||
![]() |
baa554477e | ||
![]() |
9a398eac0c | ||
![]() |
c54d39d8aa | ||
![]() |
cb3a67edca | ||
![]() |
b8b8a651fc | ||
![]() |
ba16a67781 | ||
![]() |
2c2a518ac7 | ||
![]() |
beb1b41054 | ||
![]() |
e476188c6f | ||
![]() |
c9d6159637 | ||
![]() |
59c1c4a97a | ||
![]() |
7bd32679b3 | ||
![]() |
b7fd57f681 | ||
![]() |
bffe0efc06 | ||
![]() |
68a054e274 | ||
![]() |
1dd4382ea1 | ||
![]() |
f6bcaee895 | ||
![]() |
297de93aef | ||
![]() |
0b3f983772 | ||
![]() |
c26cc11905 | ||
![]() |
00beae32aa | ||
![]() |
7a9683a07b | ||
![]() |
40e6e9995b | ||
![]() |
2122fa7476 | ||
![]() |
49c7560c86 | ||
![]() |
b743186dfe | ||
![]() |
da4aca278f | ||
![]() |
635a699365 | ||
![]() |
8d092443d9 | ||
![]() |
1de902f2fa | ||
![]() |
f263cb9f49 | ||
![]() |
0a7026a485 | ||
![]() |
cf86b45836 | ||
![]() |
acf1fa5553 | ||
![]() |
ed88353836 | ||
![]() |
5b163c2d58 | ||
![]() |
dc41c1fc52 | ||
![]() |
2e77e3390f | ||
![]() |
1d854182dd | ||
![]() |
30a60d4523 | ||
![]() |
b849aae4b9 | ||
![]() |
f83d19ce79 | ||
![]() |
369e7069b8 | ||
![]() |
29bf802907 | ||
![]() |
77746a0c3d | ||
![]() |
d733d5e570 | ||
![]() |
915c7d868b | ||
![]() |
c0dc7acee7 | ||
![]() |
ff4f2253c1 | ||
![]() |
f92353f57b | ||
![]() |
e2a012cba6 | ||
![]() |
629a780b1c | ||
![]() |
801578a06a | ||
![]() |
6a6310f030 | ||
![]() |
30d296ddb3 | ||
![]() |
8fbbffd201 | ||
![]() |
0238acc51d | ||
![]() |
67181962bf | ||
![]() |
122bcd7cb2 | ||
![]() |
ede4203749 | ||
![]() |
422199858c | ||
![]() |
f98db143cb | ||
![]() |
c893530293 | ||
![]() |
27c430cc64 | ||
![]() |
0126fbdffb | ||
![]() |
0b86c457f3 | ||
![]() |
a54d3ba2ae | ||
![]() |
2d2be1ca1b | ||
![]() |
57f2830739 | ||
![]() |
0a79fc62c9 | ||
![]() |
376ccc5bd6 | ||
![]() |
22753f5701 | ||
![]() |
9b04be2f79 | ||
![]() |
909623950f | ||
![]() |
bbe4a4fdfd | ||
![]() |
832ab44934 | ||
![]() |
13aec9a141 | ||
![]() |
2f8bbc819e | ||
![]() |
0bfe4efa99 | ||
![]() |
100202920b | ||
![]() |
17cb68e9fb | ||
![]() |
70f52b9b80 | ||
![]() |
324a57592e | ||
![]() |
0bf61ee06a | ||
![]() |
3379e67551 | ||
![]() |
2fe29d5829 | ||
![]() |
4e455979e0 | ||
![]() |
def219994d | ||
![]() |
015f0f69a8 | ||
![]() |
51830efbb5 | ||
![]() |
1cbc853155 | ||
![]() |
c6609b4739 | ||
![]() |
07d9f3bf6b | ||
![]() |
3d0080de5e | ||
![]() |
6cc2e53f3f | ||
![]() |
e073ce1890 | ||
![]() |
10181d9f94 | ||
![]() |
03d07e200f | ||
![]() |
8eb4be6c78 | ||
![]() |
6a71529fe3 | ||
![]() |
3e9503bc83 | ||
![]() |
7fc859d626 | ||
![]() |
9aef4769d1 | ||
![]() |
1820691b94 | ||
![]() |
07b6609d74 | ||
![]() |
a68354ebc5 | ||
![]() |
0bb0bd8498 | ||
![]() |
c0a862930c | ||
![]() |
75b8cacaf0 | ||
![]() |
db5ca2996a | ||
![]() |
6c2fc64d74 | ||
![]() |
1264917824 | ||
![]() |
20f5ea679b | ||
![]() |
720a2c185e | ||
![]() |
be30cda326 | ||
![]() |
6d2d09840f | ||
![]() |
fd97176583 | ||
![]() |
6fc2f40a0d | ||
![]() |
683225c064 | ||
![]() |
38620eeb9f | ||
![]() |
33183dadf5 | ||
![]() |
e6ce1f1151 | ||
![]() |
4501a6cc5e | ||
![]() |
6981f3a6ae | ||
![]() |
54dbf5f383 | ||
![]() |
f5eb69a5bd | ||
![]() |
45529e54d2 | ||
![]() |
051d2ced74 | ||
![]() |
f1dfa55428 | ||
![]() |
e970c74b0e | ||
![]() |
d007f7967c | ||
![]() |
55cef04cf9 | ||
![]() |
0ea273ebca | ||
![]() |
f7b19c3454 | ||
![]() |
3225884ed3 | ||
![]() |
4b24af9e9f | ||
![]() |
800e4a8187 | ||
![]() |
573925a0dc | ||
![]() |
6261608ece | ||
![]() |
919e549a04 | ||
![]() |
4dfc57946e | ||
![]() |
83f37d0076 | ||
![]() |
17eb90499e | ||
![]() |
22fe641721 | ||
![]() |
f91242fe39 | ||
![]() |
0f9d333305 | ||
![]() |
a2f839fd27 | ||
![]() |
dc4f5cb972 | ||
![]() |
0296de9cd1 | ||
![]() |
545eed3a24 | ||
![]() |
4736a56c8e | ||
![]() |
56b8d45079 | ||
![]() |
71157f9cdc | ||
![]() |
c1a106cc6c | ||
![]() |
f1faef7868 | ||
![]() |
2b709f7e20 | ||
![]() |
d03366f80c | ||
![]() |
da720069ca | ||
![]() |
0ab473f28a | ||
![]() |
95a9455b5a | ||
![]() |
9a63a17228 | ||
![]() |
eb0a7d0811 | ||
![]() |
a74359e8e2 | ||
![]() |
829a501de7 | ||
![]() |
443fc07c79 | ||
![]() |
1efaa3996e | ||
![]() |
3923c36af9 | ||
![]() |
6f60008bc4 | ||
![]() |
f92283f5b9 | ||
![]() |
90d62ca5e0 | ||
![]() |
4aa6e2ddff | ||
![]() |
e7404e1633 | ||
![]() |
91de00773f | ||
![]() |
37cbcc6d99 | ||
![]() |
ba1d1a3d61 | ||
![]() |
cf18bf6ed9 | ||
![]() |
ee52fee11c | ||
![]() |
e3a2e14ffa | ||
![]() |
5a4e6f3889 | ||
![]() |
440bb02fd7 | ||
![]() |
6ff70e3763 | ||
![]() |
9605ce1792 | ||
![]() |
610bf6c281 | ||
![]() |
27005a2cb0 | ||
![]() |
f39ef92cde | ||
![]() |
597a7f167b | ||
![]() |
9dd4a70eb3 | ||
![]() |
67f297d3ac | ||
![]() |
56355bff21 | ||
![]() |
5268ae8076 | ||
![]() |
79525de509 | ||
![]() |
f9132fad76 | ||
![]() |
3d74cd9e8e | ||
![]() |
c8253dc83a | ||
![]() |
035a68ab11 | ||
![]() |
5dfb7a3634 | ||
![]() |
033349d31c | ||
![]() |
5b7b1f80cb | ||
![]() |
c95263d877 | ||
![]() |
ecc1f509c6 | ||
![]() |
1ddc910eb3 | ||
![]() |
dec68bd03f | ||
![]() |
0a2f7b14c2 | ||
![]() |
76f3ac4058 | ||
![]() |
834cb718f6 | ||
![]() |
3b61bfb644 | ||
![]() |
9c1595dc42 | ||
![]() |
c2e91c2f66 | ||
![]() |
36d5193776 | ||
![]() |
d8174e4f3a | ||
![]() |
c909c82ac2 | ||
![]() |
9be173c677 | ||
![]() |
32dbf36f0e | ||
![]() |
5a8993e161 | ||
![]() |
53ae72567d | ||
![]() |
ad46156cc7 | ||
![]() |
2c1aaa5536 | ||
![]() |
30c5103bfb | ||
![]() |
ab748f4eda | ||
![]() |
6fa4c26226 | ||
![]() |
a7f9bff0f7 | ||
![]() |
9d2567f1e6 | ||
![]() |
21bf69f6ad | ||
![]() |
ab79e3fe6f | ||
![]() |
4442efff6e | ||
![]() |
520cc15fe9 | ||
![]() |
14f8fcfb37 | ||
![]() |
7c1609b1bb | ||
![]() |
ea1db36f1f | ||
![]() |
89d62e9d4d | ||
![]() |
0ff2cf73f5 | ||
![]() |
ac5dbfca7f | ||
![]() |
f41036ac3a | ||
![]() |
7301f84f26 | ||
![]() |
6926e206a8 | ||
![]() |
8bddd02b10 | ||
![]() |
971504f0ec | ||
![]() |
6b2fd4a891 | ||
![]() |
454beb0c5c | ||
![]() |
4d6114bdce | ||
![]() |
e18d6228e7 | ||
![]() |
69fd2290fe | ||
![]() |
4f37c8efd3 | ||
![]() |
35077b43e8 | ||
![]() |
81c8888228 | ||
![]() |
948fedc5f7 | ||
![]() |
e8508f7b18 | ||
![]() |
8a4680cc74 | ||
![]() |
b874a4c8cd | ||
![]() |
4f7a4556a0 | ||
![]() |
042bf4297f | ||
![]() |
4134332906 | ||
![]() |
495dac7fa9 | ||
![]() |
a01d11d9bc | ||
![]() |
9207fccde2 | ||
![]() |
d13decf47b | ||
![]() |
8c8d741b32 | ||
![]() |
f7e2b48d1c | ||
![]() |
f459607da7 | ||
![]() |
b217bbb2ea | ||
![]() |
26ec31c6c2 | ||
![]() |
9f8ef6b870 |
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@ -0,0 +1,18 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[apkbuild-gem-resolver.in]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[apkbuild-pypi.in]
|
||||
indent_size = 4
|
||||
indent_style = space
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -2,7 +2,9 @@
|
||||
*.o
|
||||
abuild
|
||||
abuild-fetch
|
||||
abuild-gzsplit
|
||||
abuild-keygen
|
||||
abuild-rmtemp
|
||||
abuild-sign
|
||||
abuild-sudo
|
||||
abuild-tar
|
||||
@ -10,9 +12,12 @@ abump
|
||||
ap
|
||||
apkbuild-cpan
|
||||
apkbuild-gem-resolver
|
||||
apkbuild-pypi
|
||||
apkgrel
|
||||
buildlab
|
||||
checkapk
|
||||
devbuild
|
||||
functions.sh
|
||||
newapkbuild
|
||||
src
|
||||
pkg
|
||||
|
571
APKBUILD.5
Normal file
571
APKBUILD.5
Normal file
@ -0,0 +1,571 @@
|
||||
.Dd February 13, 2018
|
||||
.Dt APKBUILD 5 PRM
|
||||
.Os "Alpine Linux"
|
||||
.Sh NAME
|
||||
.Nm APKBUILD
|
||||
.Nd metadata and instructions to build a package
|
||||
.Sh SYNOPSIS
|
||||
.Nm /usr/src/packages/<repo>/<package>/APKBUILD
|
||||
.Sh DESCRIPTION
|
||||
An
|
||||
.Nm
|
||||
file is used by tools such as
|
||||
.Xr abuild 1
|
||||
to build a package for eventual installation by the
|
||||
.Xr apk 8
|
||||
package manager.
|
||||
It defines metadata such as the name of the package, the version information,
|
||||
the source license, and contact information for the developer.
|
||||
It additionally contains the commands needed to build, test, and install the
|
||||
package.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
format is similar to a typical shell script; you set pre-defined variables and
|
||||
implement pre-defined functions, and the
|
||||
.Xr abuild 1
|
||||
(or similar) utility will use them to create the package.
|
||||
.Ss Required Variables
|
||||
The following variables must be set in all
|
||||
.Nm
|
||||
files:
|
||||
.Bl -tag -width Ds
|
||||
.It Cm pkgname
|
||||
Specifies name of the package.
|
||||
This is typically the name of the package upstream; however, note that all
|
||||
letters must be lowercased.
|
||||
.Pp
|
||||
Libraries for scripting languages should have a prefix before the library name
|
||||
describing the language.
|
||||
Such prefixes include
|
||||
.Em lua- ,
|
||||
.Em perl- ,
|
||||
.Em py- ,
|
||||
and
|
||||
.Em rb- .
|
||||
Not all languages use prefixes.
|
||||
For a definitive list, consult the PREFIXES file in the root directory of the
|
||||
repository you are using for packaging.
|
||||
.It Cm pkgver
|
||||
Specifies the version of the software being packaged.
|
||||
The version of a package must consist of one or more numbers separated by the
|
||||
radix (decimal point).
|
||||
The final number may have a single letter following it, for upstreams that use
|
||||
such a versioning scheme (such as 1.5a, 1.5b, 1.5c).
|
||||
.Pp
|
||||
After the final number (and optional single letter), a suffix may be appended,
|
||||
which must be an underscore (_) followed by one of
|
||||
.Em alpha ,
|
||||
.Em beta ,
|
||||
.Em pre ,
|
||||
.Em rc ,
|
||||
.Em cvs ,
|
||||
.Em svn ,
|
||||
.Em git ,
|
||||
.Em hg ,
|
||||
or
|
||||
.Em p ,
|
||||
optionally followed by another number.
|
||||
If the suffix is
|
||||
.Em alpha ,
|
||||
.Em beta ,
|
||||
.Em pre ,
|
||||
or
|
||||
.Em rc ,
|
||||
it is considered to be earlier than the version without a suffix; if the suffix
|
||||
is
|
||||
.Em cvs ,
|
||||
.Em svn ,
|
||||
.Em git ,
|
||||
.Em hg ,
|
||||
or
|
||||
.Em p ,
|
||||
it is considered to be later than the version without a suffix.
|
||||
All of the following examples are valid versions, in order from lowest to
|
||||
highest:
|
||||
.Pp
|
||||
1.0, 1.1_alpha2, 1.1.3_pre, 1.1.3, 1.1.3_hg, 1.2, 1.2a, 1.2b
|
||||
.It Cm pkgrel
|
||||
Specifies the package release number of this particular package version.
|
||||
This indicates when a package has changed without a corresponding change in
|
||||
version.
|
||||
Always increment
|
||||
.Cm pkgrel
|
||||
when you change the contents, dependencies, or metadata of a package.
|
||||
The first release of a package is always
|
||||
.Li 0 .
|
||||
.It Cm pkgdesc
|
||||
Specifies what the package contains.
|
||||
.Cm pkgdesc
|
||||
must be 128 characters or less, and should concisely describe what actions the
|
||||
software or items being packaged will allow the user to perform.
|
||||
For example,
|
||||
.Dq Fully-featured word processor with spell check and many plugins
|
||||
would be a sufficient
|
||||
.Cm pkgdesc
|
||||
for AbiWord.
|
||||
.It Cm url
|
||||
Specifies the Web address of the package's upstream.
|
||||
This allows users and future maintainers to find documentation, release
|
||||
information, and contact information for the package.
|
||||
If no Web address is available for the package, you must set
|
||||
.Cm url
|
||||
to an empty string ("").
|
||||
.It Cm arch
|
||||
Specifies the architectures for which the package may be built.
|
||||
It is highly recommended that you set this variable to "all" if the package is
|
||||
portable.
|
||||
.Pp
|
||||
You may use "noarch" if the package does not contain any architecture-specific
|
||||
binary files - that is, any files that are compiled for the target only.
|
||||
Such packages may include pure Python packages, shell script packages, and
|
||||
JARs.
|
||||
If you are not sure what this means, using "all" is safe.
|
||||
.It Cm license
|
||||
Specifies the license under which the package is distributed.
|
||||
The value provided must match a SPDX license identifier.
|
||||
.It Cm source
|
||||
Specifies the location of both local and remote source files used to build the
|
||||
package.
|
||||
Typically, the remote source file(s) or archive(s) is specified, followed by
|
||||
any local patches, install scripts, configuration files, or other necessary
|
||||
files.
|
||||
.El
|
||||
.Ss Optional Variables
|
||||
The following variables are not required, but may be set in any
|
||||
.Nm
|
||||
file:
|
||||
.Bl -tag -width Ds
|
||||
.It Cm checkdepends
|
||||
Specifies test-time dependencies of the package.
|
||||
Common packages that are used for testing include check, dejagnu, and
|
||||
perl-test-command.
|
||||
.It Cm depends
|
||||
Specifies the run-time dependencies of the package.
|
||||
The
|
||||
.Xr abuild 1
|
||||
utility will automatically scan the resultant package for shared library (.so)
|
||||
dependencies; do not specify them here.
|
||||
.It Cm install
|
||||
Specifies install scripts for the package, if any.
|
||||
See
|
||||
.Sx Install Scripts
|
||||
for more information about install scripts.
|
||||
.It Cm install_if
|
||||
Specifies a condition when
|
||||
.Xr apk 8
|
||||
should automatically install the package (or subpackage).
|
||||
For instance, the OpenRC subpackages set
|
||||
.Cm install_if
|
||||
to
|
||||
.Li openrc ${subpkgname%-openrc}=$pkgver-r$pkgrel
|
||||
which means that the OpenRC subpackage will be automatically installed if
|
||||
both OpenRC and the origin package are installed on the same computer.
|
||||
.It Cm makedepends
|
||||
Specifies build dependencies for the package.
|
||||
.It Cm pkggroups
|
||||
Specifies a space-separated list of login groups to create during build-time.
|
||||
Note that you will need to create the login groups in a pre-install install
|
||||
script as well; see
|
||||
.Sx Install Scripts
|
||||
for more information about install scripts.
|
||||
.It Cm pkgusers
|
||||
Specifies a space-separated list of user logins to create during build-time.
|
||||
Note that you will ned to create the user logins in a pre-install install
|
||||
script as well; see
|
||||
.Sx Install Scripts
|
||||
for more information about install scripts.
|
||||
.It Cm provides
|
||||
Specifies that the package "provides" the same contents as another package.
|
||||
There are two formats that you may use for
|
||||
.Cm provides :
|
||||
a provider name, and a provider name with version.
|
||||
.Pp
|
||||
Specifying a provider name with version such as
|
||||
.Li foobar=1.2
|
||||
will cause the package to be an "alias" of foobar version 1.2.
|
||||
It will be automatically installed if a user then runs
|
||||
.Li apk add foobar
|
||||
or similar, and it will conflict with a package named foobar.
|
||||
.Pp
|
||||
Specifying a provider name without a version such as
|
||||
.Li baz
|
||||
will cause the package to provide a "virtual" called baz.
|
||||
Multiple packages with the same virtual provider can be installed on a system;
|
||||
however, if a user runs
|
||||
.Li apk add baz
|
||||
they will provided a list of packages that provide baz and must select one and
|
||||
install it.
|
||||
.It Cm provider_priority
|
||||
Specifies the numeric value for
|
||||
.Xr apk 8
|
||||
to use for the package when considering which provider should be installed for
|
||||
the same
|
||||
.Cm provides
|
||||
virtual provider.
|
||||
.It Cm replaces
|
||||
Specifies packages that the package replaces.
|
||||
This is typically used for packages renamed by upstream.
|
||||
.It Cm subpackages
|
||||
Specifies subpackages or split packages built with this package.
|
||||
Typically, this will include
|
||||
.Li $pkgname-dev
|
||||
for development files (such as /usr/include and static library files) and
|
||||
.Li $pkgname-doc
|
||||
for documentation (such as /usr/share/doc and /usr/share/man).
|
||||
.Pp
|
||||
Each subpackage may be specified using three different methods.
|
||||
The first, and most common, is
|
||||
.Li $pkgname-foo
|
||||
where
|
||||
.Li foo
|
||||
is the name of the split function specified later in the file.
|
||||
Similar to the
|
||||
.Cm package
|
||||
function, the
|
||||
.Li foo
|
||||
function must move files from
|
||||
.Pa $pkgdir
|
||||
or
|
||||
.Pa $srcdir
|
||||
to
|
||||
.Pa $subpkgdir
|
||||
after creating
|
||||
.Pa $subpkgdir .
|
||||
.Pp
|
||||
The second method is to simply call the subpackage
|
||||
.Li foo
|
||||
which will create a package called
|
||||
.Li foo
|
||||
instead of pkgname-foo.
|
||||
.Pp
|
||||
However,
|
||||
.Li foo
|
||||
in both of these examples cannot contain a hyphen, as shell function names
|
||||
cannot have hyphens in them. In this case, the third method may be used:
|
||||
.Li foo:funcname
|
||||
where
|
||||
.Li foo
|
||||
is the name of the subpackage and
|
||||
.Li funcname
|
||||
is the name of the shell function in the
|
||||
.Nm
|
||||
that creates it.
|
||||
.Pp
|
||||
Note that an additional colon may be used to specify an architecture for the
|
||||
subpackage; typically, this is used for marking miscellaneous files that are
|
||||
not architecture-specific as noarch.
|
||||
For example,
|
||||
.Li $pkgname-doc $pkgname-foo $pkgname-foo-misc:foo_misc:noarch
|
||||
will create the $pkgname-doc package using the
|
||||
.Cm doc
|
||||
function, the $pkgname-foo package using the
|
||||
.Cm foo
|
||||
function, and the $pkgname-foo-misc package using the
|
||||
.Cm foo_misc
|
||||
function and set $pkgname-foo-misc as noarch.
|
||||
.It Cm triggers
|
||||
Specifies a trigger script used by the package.
|
||||
A trigger script is a shell script that is called whenever monitored files or
|
||||
directories are modified.
|
||||
You may specify the paths to monitor using the triggers variable as follows:
|
||||
.Pp
|
||||
.Li $pkgname.trigger=/usr/share/man:/usr/local/share/man
|
||||
.Pp
|
||||
This will run the package trigger script whenever files in
|
||||
.Pa /usr/share/man
|
||||
or
|
||||
.Pa /usr/local/share/man
|
||||
are created, modified, or removed.
|
||||
.El
|
||||
.Ss options
|
||||
The
|
||||
.Cm options
|
||||
variable allows you to set parameters for the package at build time.
|
||||
There are a number of valid options you may set, and you may set multiple
|
||||
options by writing a space between each one.
|
||||
.Bl -tag -width Ds
|
||||
.It Cm !archcheck
|
||||
Specifies that the package contains binaries that cannot run on the target
|
||||
architecture.
|
||||
This is primarily used for packages containing firmware, and should typically
|
||||
never need to be used.
|
||||
.It Cm charset.alias
|
||||
Specifies that the package ships a /usr/lib/charset.alias file and that it
|
||||
should be installed on the user's system.
|
||||
This is almost never the case.
|
||||
Do not use this option.
|
||||
.It Cm !check
|
||||
Specifies that the package will not run a test suite.
|
||||
The reason for disabling the check phase should be noted in a comment.
|
||||
.It Cm checkroot
|
||||
Specifies that the package's test suite will be run in
|
||||
.Xr fakeroot 8 .
|
||||
This is necessary for some test suites which fail when run as non-root.
|
||||
.It Cm !dbg
|
||||
Specifies that the package should not be built with a debug information
|
||||
package.
|
||||
This is the default unless
|
||||
.Ev DEFAULT_DBG
|
||||
is set in the environment or
|
||||
.Xr abuild.conf 5 .
|
||||
It is typically used on packages that do not generate debug information (such
|
||||
as pure Python packages) or packages that do not support debug information
|
||||
packages.
|
||||
.It Cm !fhs
|
||||
Specifies that the package violates FHS and installs to a location such as
|
||||
.Pa /usr/local ,
|
||||
.Pa /opt ,
|
||||
or
|
||||
.Pa /srv .
|
||||
.It Cm ldpath-recursive
|
||||
Specifies that
|
||||
.Xr abuild 1
|
||||
should use the
|
||||
.Fl --recursive
|
||||
argument to
|
||||
.Xr scanelf 1
|
||||
when attempting to find shared library (.so) dependencies for the package.
|
||||
.It Cm libtool
|
||||
Specifies that the package requires its libtool (.la) files.
|
||||
They will not be automatically removed by
|
||||
.Xr abuild 1 .
|
||||
.It Cm net
|
||||
Specifies that the package build system requires access to a network.
|
||||
This is discouraged and an issue should be filed with the package's authors.
|
||||
.It Cm !strip
|
||||
Specifies that
|
||||
.Xr strip 1
|
||||
should not be run on any of the package's binaries.
|
||||
This is automatically implied if the -dbg subpackage is enabled, or if you are
|
||||
using
|
||||
.Ev DEFAULT_DBG .
|
||||
.It Cm suid
|
||||
Specifies that binaries in the package may be installed set-uid.
|
||||
This is a security risk and it is highly recommended to use capabilities or
|
||||
process separation instead of set-uid where available.
|
||||
.It Cm textrels
|
||||
Specifies that the package's binaries are known to contain relocations against
|
||||
text segments.
|
||||
By default,
|
||||
.Xr abuild 1
|
||||
will refuse to create such a package because this is a security concern.
|
||||
.It Cm toolchain
|
||||
Specifies that the package is part of the base toolchain set and may depend
|
||||
on packages like
|
||||
.Li g++ .
|
||||
.It Cm !tracedeps
|
||||
Specifies that
|
||||
.Xr abuild 1
|
||||
should not automatically populate
|
||||
.Cm depends
|
||||
with shared library (.so) or symlink target dependencies.
|
||||
.El
|
||||
.Ss Automatic Variables
|
||||
The following variables are defined for you by
|
||||
.Xr abuild 1 ,
|
||||
but may be overridden if necessary.
|
||||
.Bl -tag -width Ds
|
||||
.It Cm builddir
|
||||
Specifies the directory where the source code of the package will be built.
|
||||
The default value is
|
||||
.Pa $srcdir/$pkgname-$pkgver
|
||||
which is appropriate for most source distributions.
|
||||
If the source tarball does not create a $pkgname-$pkgver directory when it is
|
||||
unpacked, you must override
|
||||
.Cm builddir .
|
||||
.It Cm pkgdir
|
||||
Specifies the directory where the built files will be installed.
|
||||
Typically, you will call
|
||||
.Li make DESTDIR="$pkgdir" install
|
||||
or similar to install the files.
|
||||
The default value is
|
||||
.Pa $startdir/pkg
|
||||
and you should not modify this variable.
|
||||
.It Cm srcdir
|
||||
Specifies the directory where the files specified in
|
||||
.Cm source
|
||||
are downloaded and unpacked.
|
||||
The default value is
|
||||
.Pa $startdir/src
|
||||
and you should not need to modify this.
|
||||
.It Cm startdir
|
||||
Specifies the directory where the
|
||||
.Nm
|
||||
file resides.
|
||||
.It Cm subpkgdir
|
||||
Specifies the directory where the subpackage's files should be placed.
|
||||
This variable is only set inside subpackage functions.
|
||||
.El
|
||||
.Ss Special Variables
|
||||
The following variables are used only in special circumstances, and may be
|
||||
required or optional depending on their usage and the contents of other
|
||||
variables.
|
||||
.Bl -tag -width Ds
|
||||
.It Cm depends_dev
|
||||
Specifies the run-time dependencies of the -dev subpackage.
|
||||
.It Cm depends_doc
|
||||
Specifies the run-time dependencies of the -doc subpackage.
|
||||
.It Cm depends_libs
|
||||
Specifies the run-time dependencies of the -libs subpackage.
|
||||
.It Cm depends_openrc
|
||||
Specifies the run-time dependencies of the -openrc subpackage.
|
||||
.It Cm depends_static
|
||||
Specifies the run-time dependencies of the -static subpackage.
|
||||
.It Cm giturl
|
||||
Specifies the URL of the Git repository to use with
|
||||
.Cm abuild checkout .
|
||||
If the default branch of the repository is not desired, a different one may be
|
||||
specified by appending
|
||||
.Fl b Ar branch
|
||||
where
|
||||
.Cm branch
|
||||
is the branch to checkout.
|
||||
.El
|
||||
.Ss Functions
|
||||
Functions specified here may be present in any
|
||||
.Nm
|
||||
file, but with the exception of
|
||||
.Cm package ,
|
||||
are not strictly required.
|
||||
.Bl -tag -width Ds
|
||||
.It Cm fetch
|
||||
This function is called to download the remote files in
|
||||
.Cm source .
|
||||
.It Cm unpack
|
||||
This function unpacks any archives in
|
||||
.Cm source
|
||||
to
|
||||
.Ev srcdir .
|
||||
.It Cm prepare
|
||||
Prepares the source in
|
||||
.Ev srcdir
|
||||
to be built.
|
||||
The default
|
||||
.Cm prepare
|
||||
function ensures the build directories are set up correctly and applies any
|
||||
*.patch files specified in
|
||||
.Cm source .
|
||||
You must call
|
||||
.Cm default_prepare
|
||||
if you write a custom
|
||||
.Cm prepare
|
||||
function.
|
||||
.It Cm build
|
||||
Compiles the source in
|
||||
.Ev builddir .
|
||||
You must implement this function yourself.
|
||||
If no compilation is required, you may omit it.
|
||||
.It Cm check
|
||||
Runs the package's test suite.
|
||||
This function must be implemented unless
|
||||
.Li !check
|
||||
was specified in
|
||||
.Cm options .
|
||||
.It Cm package
|
||||
Installs the package into
|
||||
.Ev pkgdir .
|
||||
Note that
|
||||
.Ev pkgdir
|
||||
is not created for you; if this package installs no files (for example, a
|
||||
metapackage), you must use
|
||||
.Li mkdir -p "$pkgdir"
|
||||
to skip the package phase.
|
||||
.El
|
||||
.Ss Install Scripts
|
||||
An install script is run when an action is taken on a package by
|
||||
.Xr apk 8 .
|
||||
An install script must be written in shell and must have a
|
||||
.Li #!/bin/sh
|
||||
interpreter declaration as the first line.
|
||||
The
|
||||
.Cm install
|
||||
variable must contain the install scripts needed by the package.
|
||||
.Pp
|
||||
The install script will be run inside the root filesystem where the package is
|
||||
being installed.
|
||||
A single argument will be passed to all scripts, which is the version of the
|
||||
package being currently installed (or deinstalled).
|
||||
The pre-upgrade and post-upgrade scripts will have an additional second
|
||||
argument, which specifies the version of the package before the upgrade
|
||||
process.
|
||||
.Pp
|
||||
The different actions that may have install scripts specified are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Ic $pkgname.pre-install
|
||||
Executed before the package is installed.
|
||||
If this script exits with an error (non-zero exit code),
|
||||
.Xr apk 8
|
||||
will halt the installation and the package will not be installed.
|
||||
This install script is typically used to create any users or groups needed as
|
||||
described in
|
||||
.Cm pkggroups
|
||||
and
|
||||
.Cm pkgusers .
|
||||
.It Ic $pkgname.post-install
|
||||
Executed after the package is installed.
|
||||
If this script exits with an error (non-zero exit code),
|
||||
.Xr apk 8
|
||||
will mark the package as broken.
|
||||
The
|
||||
.Li apk fix
|
||||
command will attempt to re-run the post-install script if this occurs.
|
||||
.It Ic $pkgname.pre-upgrade
|
||||
Executed before the package is upgraded.
|
||||
If this script exits with an error (non-zero exit code),
|
||||
.Xr apk 8
|
||||
will mark the package as broken.
|
||||
.It Ic $pkgname.post-upgrade
|
||||
Executed after the package is upgraded.
|
||||
If this script exits with an error (non-zero exit code),
|
||||
.Xr apk 8
|
||||
will mark the package as broken.
|
||||
The
|
||||
.Li apk fix
|
||||
command will attempt to re-run the post-upgrade script if this occurs.
|
||||
.It Ic $pkgname.pre-deinstall
|
||||
Executed before the package is removed from the system.
|
||||
If this script exits with an error (non-zero exit code),
|
||||
.Xr apk 8
|
||||
will not remove the package from the system.
|
||||
.It Ic $pkgname.post-deinstall
|
||||
Executed after the package is removed from the system.
|
||||
Exiting with an error will have no effect.
|
||||
.El
|
||||
.Sh IMPLEMENTATION NOTES
|
||||
Currently,
|
||||
.Nm
|
||||
files are sourced as normal shell scripts. This may change at a later date.
|
||||
.Sh COMPATIBILITY
|
||||
The
|
||||
.Xr abuild 1
|
||||
utility as distributed by Alpine uses the BusyBox Almquist shell, a part of
|
||||
.Xr busybox 1
|
||||
that is currently undocumented.
|
||||
It is mostly compliant with
|
||||
.St -p1003.2 ,
|
||||
with some bash-like extensions.
|
||||
The
|
||||
.Xr abuild 1
|
||||
utility as distributed by Adélie uses the user's preferred /bin/sh, which is
|
||||
typically
|
||||
.Xr bash 1 .
|
||||
.Sh SEE ALSO
|
||||
SPDX license reference (on the Web at <https://spdx.org/licenses/>),
|
||||
.Xr abuild 1 ,
|
||||
.Xr newapkbuild 1 ,
|
||||
.Xr apk 8 .
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
format and
|
||||
.Xr abuild 1
|
||||
utility first appeared in Alpine Linux 1.9.
|
||||
.Sh AUTHORS
|
||||
.An Timo Teräs Aq Mt timo.teras@iki.fi
|
||||
.An Natanael Copa Aq Mt ncopa@alpinelinux.org
|
||||
.Pp
|
||||
Documentation:
|
||||
.An A. Wilcox Aq Mt awilfox@adelielinux.org
|
||||
.\" .Sh BUGS
|
||||
.\" if we end up finding bugs that should be documented, put them here.
|
50
Makefile
50
Makefile
@ -1,20 +1,21 @@
|
||||
|
||||
PACKAGE := abuild
|
||||
VERSION := 2.28.0
|
||||
VERSION := 3.5.0
|
||||
|
||||
prefix ?= /usr
|
||||
bindir ?= $(prefix)/bin
|
||||
sysconfdir ?= /etc
|
||||
datadir ?= $(prefix)/share/$(PACKAGE)
|
||||
abuildrepo ?= ~/.cache/abuild
|
||||
sharedir ?= $(prefix)/share/$(PACKAGE)
|
||||
mandir ?= $(prefix)/share/man
|
||||
|
||||
SCRIPTS := abuild abuild-keygen abuild-sign newapkbuild \
|
||||
abump apkgrel buildlab apkbuild-cpan checkapk \
|
||||
abump apkgrel buildlab apkbuild-cpan apkbuild-pypi checkapk \
|
||||
apkbuild-gem-resolver
|
||||
USR_BIN_FILES := $(SCRIPTS) abuild-tar abuild-sudo abuild-fetch
|
||||
USR_BIN_FILES := $(SCRIPTS) abuild-tar abuild-gzsplit abuild-sudo abuild-fetch abuild-rmtemp
|
||||
MAN_1_PAGES := newapkbuild.1
|
||||
MAN_5_PAGES := APKBUILD.5
|
||||
SAMPLES := sample.APKBUILD sample.initd sample.confd \
|
||||
sample.pre-install sample.post-install
|
||||
AUTOTOOLS_TOOLCHAIN_FILES := config.sub
|
||||
AUTOTOOLS_TOOLCHAIN_FILES := config.sub config.guess
|
||||
|
||||
SCRIPT_SOURCES := $(addsuffix .in,$(SCRIPTS))
|
||||
|
||||
@ -34,18 +35,21 @@ LINK = $(CC) $(OBJS-$@) -o $@ $(LDFLAGS) $(LDFLAGS-$@) $(LIBS-$@)
|
||||
SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \
|
||||
-e 's:@prefix@:$(prefix):g' \
|
||||
-e 's:@sysconfdir@:$(sysconfdir):g' \
|
||||
-e 's:@datadir@:$(datadir):g' \
|
||||
-e 's:@abuildrepo@:$(abuildrepo):g'
|
||||
-e 's:@sharedir@:$(sharedir):g' \
|
||||
|
||||
SSL_CFLAGS ?= $(shell pkg-config --cflags openssl)
|
||||
SSL_LDFLAGS ?= $(shell pkg-config --cflags openssl)
|
||||
SSL_LIBS ?= $(shell pkg-config --libs openssl)
|
||||
|
||||
ZLIB_LIBS ?= $(shell pkg-config --libs zlib)
|
||||
|
||||
OBJS-abuild-tar = abuild-tar.o
|
||||
CFLAGS-abuild-tar.o = $(SSL_CFLAGS)
|
||||
LDFLAGS-abuild-tar = $(SSL_LDFLAGS)
|
||||
LIBS-abuild-tar = $(SSL_LIBS)
|
||||
LIBS-abuild-tar.static = $(LIBS-abuild-tar)
|
||||
|
||||
OBJS-abuild-gzsplit = abuild-gzsplit.o
|
||||
LDFLAGS-abuild-gzsplit = $(ZLIB_LIBS)
|
||||
|
||||
OBJS-abuild-sudo = abuild-sudo.o
|
||||
OBJS-abuild-fetch = abuild-fetch.o
|
||||
@ -64,7 +68,7 @@ P=$(PACKAGE)-$(VERSION)
|
||||
all: $(USR_BIN_FILES) functions.sh
|
||||
|
||||
clean:
|
||||
@rm -f $(USR_BIN_FILES) functions.sh
|
||||
@rm -f $(USR_BIN_FILES) *.o functions.sh
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS-$@) -o $@ -c $<
|
||||
@ -78,29 +82,45 @@ abuild-tar: abuild-tar.o
|
||||
abuild-fetch: abuild-fetch.o
|
||||
$(LINK)
|
||||
|
||||
abuild-gzsplit: abuild-gzsplit.o
|
||||
$(LINK)
|
||||
|
||||
abuild-tar.static: abuild-tar.o
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS-$@) -o $@ -static $(LIBS-$@) $^
|
||||
$(CC) -static $(CPPFLAGS) $(CFLAGS) $(CFLAGS-$@) $^ -o $@ $(LIBS-$@)
|
||||
|
||||
help:
|
||||
@echo "$(P) makefile"
|
||||
@echo "usage: make install [ DESTDIR=<path> ]"
|
||||
|
||||
check: $(USR_BIN_FILE) functions.sh
|
||||
cd tests && bats *.bats
|
||||
|
||||
install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
|
||||
install -d $(DESTDIR)/$(bindir) $(DESTDIR)/$(sysconfdir) \
|
||||
$(DESTDIR)/$(datadir)
|
||||
$(DESTDIR)/$(sharedir) $(DESTDIR)/$(mandir)/man1 \
|
||||
$(DESTDIR)/$(mandir)/man5
|
||||
for i in $(USR_BIN_FILES); do\
|
||||
install -m 755 $$i $(DESTDIR)/$(bindir)/$$i;\
|
||||
done
|
||||
chmod 4111 $(DESTDIR)/$(prefix)/bin/abuild-sudo
|
||||
chmod 4555 $(DESTDIR)/$(prefix)/bin/abuild-sudo
|
||||
for i in adduser addgroup apk; do \
|
||||
ln -fs abuild-sudo $(DESTDIR)/$(bindir)/abuild-$$i; \
|
||||
done
|
||||
for i in $(MAN_1_PAGES); do\
|
||||
install -m 644 $$i $(DESTDIR)/$(mandir)/man1/$$i;\
|
||||
done
|
||||
for i in $(MAN_5_PAGES); do\
|
||||
install -m 644 $$i $(DESTDIR)/$(mandir)/man5/$$i;\
|
||||
done
|
||||
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
|
||||
cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
|
||||
fi
|
||||
cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild/
|
||||
cp $(AUTOTOOLS_TOOLCHAIN_FILES) $(DESTDIR)/$(prefix)/share/abuild/
|
||||
cp functions.sh $(DESTDIR)/$(datadir)/
|
||||
cp functions.sh $(DESTDIR)/$(sharedir)/
|
||||
|
||||
depends depend:
|
||||
sudo apk --no-cache -U --virtual .abuild-depends add openssl-dev zlib-dev
|
||||
|
||||
.gitignore: Makefile
|
||||
echo "*.tar.bz2" > $@
|
||||
|
@ -29,6 +29,7 @@ THE SOFTWARE.
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -50,15 +51,36 @@ void add_opt(struct cmdarray *cmd, char *opt)
|
||||
|
||||
int usage(int eval)
|
||||
{
|
||||
printf("usage: %s [-d DESTDIR] URL\n", program);
|
||||
printf("usage: %s [-h] [-d DESTDIR] URL\n", program);
|
||||
return eval;
|
||||
}
|
||||
|
||||
int fork_exec(char *argv[], int showerr)
|
||||
{
|
||||
int r = 202;
|
||||
int status = 0;
|
||||
pid_t childpid = fork();
|
||||
if (childpid < 0 )
|
||||
err(200, "fork");
|
||||
|
||||
if (childpid == 0) {
|
||||
execvp(argv[0], argv);
|
||||
if (showerr)
|
||||
warn("%s", argv[0]);
|
||||
_exit(201);
|
||||
}
|
||||
|
||||
/* wait for curl/wget and get the exit code */
|
||||
wait(&status);
|
||||
if (WIFEXITED(status))
|
||||
r = WEXITSTATUS(status);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* create or wait for an NFS-safe lockfile and fetch url with curl or wget */
|
||||
int fetch(char *url, const char *destdir)
|
||||
int fetch(char *url, const char *destdir, bool insecure)
|
||||
{
|
||||
int lockfd, status=0;
|
||||
pid_t childpid;
|
||||
char outfile[PATH_MAX], partfile[PATH_MAX];
|
||||
char *name, *p;
|
||||
struct flock fl = {
|
||||
@ -68,8 +90,8 @@ int fetch(char *url, const char *destdir)
|
||||
.l_len = 0,
|
||||
};
|
||||
struct cmdarray curlcmd = {
|
||||
.argc = 6,
|
||||
.argv = { "curl", "-k", "-L", "-f", "-o", partfile, NULL }
|
||||
.argc = 5,
|
||||
.argv = { "curl", "-L", "-f", "-o", partfile, NULL }
|
||||
};
|
||||
struct cmdarray wgetcmd = {
|
||||
.argc = 3,
|
||||
@ -84,9 +106,6 @@ int fetch(char *url, const char *destdir)
|
||||
name = url;
|
||||
*p = '\0';
|
||||
url = p + 2;
|
||||
} else if (strstr(url, "saveas-") == url) {
|
||||
*name++ = '\0';
|
||||
url += 7; /* strlen("saveas-") */
|
||||
} else {
|
||||
name++;
|
||||
}
|
||||
@ -115,6 +134,12 @@ int fetch(char *url, const char *destdir)
|
||||
if (access(outfile, F_OK) == 0)
|
||||
goto fetch_done;
|
||||
|
||||
/* enable insecure mode when http. This may be useful when it redirects to https */
|
||||
if (insecure || strstr(url, "http://") == url) {
|
||||
add_opt(&curlcmd, "--insecure");
|
||||
add_opt(&wgetcmd, "--no-check-certificate");
|
||||
}
|
||||
|
||||
if (access(partfile, F_OK) == 0) {
|
||||
printf("Partial download found. Trying to resume.\n");
|
||||
add_opt(&curlcmd, "-C");
|
||||
@ -125,27 +150,26 @@ int fetch(char *url, const char *destdir)
|
||||
add_opt(&curlcmd, url);
|
||||
add_opt(&wgetcmd, url);
|
||||
|
||||
childpid = fork();
|
||||
if (childpid < 0 )
|
||||
err(1, "fork");
|
||||
status = fork_exec(curlcmd.argv, 0);
|
||||
|
||||
if (childpid == 0) {
|
||||
execvp(curlcmd.argv[0], curlcmd.argv);
|
||||
printf("Using wget\n");
|
||||
execvp(wgetcmd.argv[0], wgetcmd.argv);
|
||||
warn("%s", wgetcmd.argv[0]);
|
||||
unlink(lockfile);
|
||||
_exit(1);
|
||||
}
|
||||
wait(&status);
|
||||
rename(partfile, outfile);
|
||||
/* CURLE_RANGE_ERROR (33)
|
||||
The server does not support or accept range requests. */
|
||||
if (status == 33)
|
||||
unlink(partfile);
|
||||
|
||||
/* is we failed execute curl, then fallback to wget */
|
||||
if (status == 201)
|
||||
status = fork_exec(wgetcmd.argv, 1);
|
||||
|
||||
/* only rename completed downloads */
|
||||
if (status == 0)
|
||||
rename(partfile, outfile);
|
||||
|
||||
fetch_done:
|
||||
unlink(lockfile);
|
||||
close(lockfd);
|
||||
lockfile[0] = '\0';
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
void sighandler(int sig)
|
||||
@ -163,13 +187,20 @@ void sighandler(int sig)
|
||||
}
|
||||
}
|
||||
|
||||
/* exit codes get passed through from curl/wget (so we can check in abuild
|
||||
whether the server does not support resuming). Additional exit codes:
|
||||
200: fork failed
|
||||
201: curl/wget could not be started
|
||||
202: curl/wget did not terminate normally
|
||||
203: usage displayed */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int opt, r=0, i;
|
||||
int opt;
|
||||
bool insecure = false;
|
||||
char *destdir = "/var/cache/distfiles";
|
||||
|
||||
program = argv[0];
|
||||
while ((opt = getopt(argc, argv, "hd:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hd:k")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
return usage(0);
|
||||
@ -177,8 +208,11 @@ int main(int argc, char *argv[])
|
||||
case 'd':
|
||||
destdir = optarg;
|
||||
break;
|
||||
case 'k':
|
||||
insecure = true;
|
||||
break;
|
||||
default:
|
||||
printf("Unkonwn option '%c'\n", opt);
|
||||
printf("Unknown option '%c'\n", opt);
|
||||
return usage(1);
|
||||
break;
|
||||
}
|
||||
@ -187,17 +221,13 @@ int main(int argc, char *argv[])
|
||||
argv += optind;
|
||||
argc -= optind;
|
||||
|
||||
if (argc < 1)
|
||||
return usage(1);
|
||||
if (argc != 1)
|
||||
return usage(203);
|
||||
|
||||
signal(SIGABRT, sighandler);
|
||||
signal(SIGINT, sighandler);
|
||||
signal(SIGQUIT, sighandler);
|
||||
signal(SIGTERM, sighandler);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (fetch(argv[i], destdir))
|
||||
r++;
|
||||
}
|
||||
return r;
|
||||
return fetch(argv[0], destdir, insecure);
|
||||
}
|
||||
|
75
abuild-gzsplit.c
Normal file
75
abuild-gzsplit.c
Normal file
@ -0,0 +1,75 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char obuf[8*1024], ibuf[8*1024];
|
||||
z_stream zs;
|
||||
int r = Z_OK, rc = 1, fd = -1;
|
||||
size_t len;
|
||||
|
||||
if (inflateInit2(&zs, 15+32) != Z_OK)
|
||||
goto err;
|
||||
|
||||
zs.avail_out = sizeof obuf;
|
||||
zs.next_out = obuf;
|
||||
|
||||
while (1) {
|
||||
if (zs.avail_in == 0) {
|
||||
zs.avail_in = read(STDIN_FILENO, ibuf, sizeof ibuf);
|
||||
zs.next_in = ibuf;
|
||||
if (zs.avail_in < 0) goto err;
|
||||
if (zs.avail_in == 0 && r == Z_STREAM_END) goto ok;
|
||||
}
|
||||
|
||||
r = inflate(&zs, Z_NO_FLUSH);
|
||||
if (r != Z_OK && r != Z_STREAM_END) goto err;
|
||||
|
||||
len = sizeof obuf - zs.avail_out;
|
||||
if (len) {
|
||||
if (fd < 0) {
|
||||
const char *fn;
|
||||
if (strncmp(obuf, ".SIGN.", 6) == 0)
|
||||
fn = "signatures.tar.gz";
|
||||
else if (strncmp(obuf, ".PKGINFO", 8) == 0)
|
||||
fn = "control.tar.gz";
|
||||
else if (rc == 1)
|
||||
fn = "data.tar.gz", rc = 2;
|
||||
else
|
||||
goto err;
|
||||
fd = open(fn, O_CREAT|O_TRUNC|O_WRONLY, 0777);
|
||||
if (fd < 0) goto err;
|
||||
}
|
||||
zs.next_out = obuf;
|
||||
zs.avail_out = sizeof obuf;
|
||||
}
|
||||
|
||||
if (zs.avail_in == 0 || r == Z_STREAM_END) {
|
||||
len = (void *)zs.next_in - (void *)ibuf;
|
||||
if (write(fd, ibuf, len) != len) goto err;
|
||||
memmove(ibuf, zs.next_in, zs.avail_in);
|
||||
zs.next_in = ibuf;
|
||||
}
|
||||
|
||||
if (r == Z_STREAM_END) {
|
||||
if (fd >= 0) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
inflateEnd(&zs);
|
||||
if (inflateInit2(&zs, 15+32) != Z_OK) goto err;
|
||||
}
|
||||
}
|
||||
ok:
|
||||
rc = 0;
|
||||
err:
|
||||
if (fd >= 0) close(fd);
|
||||
inflateEnd(&zs);
|
||||
if (rc) fprintf(stderr, "failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
@ -7,13 +7,13 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
|
||||
# ask for privkey unless non-interactive mode
|
||||
@ -50,7 +50,7 @@ do_keygen() {
|
||||
# generate the private key in a subshell with stricter umask
|
||||
(
|
||||
umask 0007
|
||||
openssl genrsa -out "$privkey" 2048
|
||||
openssl genrsa -out "$privkey" "$numbits"
|
||||
)
|
||||
openssl rsa -in "$privkey" -pubout -out "$pubkey"
|
||||
|
||||
@ -88,26 +88,29 @@ do_keygen() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - generate signing keys
|
||||
Usage: $program [-a|--append] [-i|--install] [-n]
|
||||
Options:
|
||||
-a, --append Set PACKAGER_PRIVKEY=<generated key> in
|
||||
$ABUILD_USERCONF
|
||||
-i, --install Install public key into /etc/apk/keys using sudo
|
||||
-n Non-interactive. Use defaults
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - generate signing keys
|
||||
Usage: $program [-a|--append] [-i|--install] [-n]
|
||||
Options:
|
||||
-a, --append Set PACKAGER_PRIVKEY=<generated key> in
|
||||
$ABUILD_USERCONF
|
||||
|
||||
__EOF__
|
||||
-i, --install Install public key into /etc/apk/keys using sudo
|
||||
-n Non-interactive. Use defaults
|
||||
-b, --numbits [BITS] The size of the private key to generate in bits.
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
|
||||
__EOF__
|
||||
}
|
||||
|
||||
append_config=
|
||||
install_pubkey=
|
||||
non_interactive=
|
||||
numbits=2048
|
||||
quiet=
|
||||
|
||||
args=`getopt -o ainqh --long append,install,quiet,help -n "$program" -- "$@"`
|
||||
args=$(getopt -o ab:inqh --long append,numbits:,install,quiet,help -n "$program" -- "$@")
|
||||
if [ $? -ne 0 ]; then
|
||||
usage
|
||||
exit 2
|
||||
@ -118,6 +121,7 @@ while true; do
|
||||
-a|--append) append_config=1;;
|
||||
-i|--install) install_pubkey=1;;
|
||||
-n) non_interactive=1;;
|
||||
-b|--numbits) numbits="$2"; shift 1;;
|
||||
-q|--quiet) quiet=1;; # suppresses msg
|
||||
-h|--help) usage; exit;;
|
||||
--) shift; break;;
|
||||
|
50
abuild-rmtemp.c
Normal file
50
abuild-rmtemp.c
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* abuild-rmtemp
|
||||
* Copyright (c) 2017 Kaarle Ritvanen
|
||||
* Distributed under GPL-2
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 700
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <ftw.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define PREFIX "/var/tmp/abuild."
|
||||
|
||||
static void fail() {
|
||||
errx(1, "%s", strerror(errno));
|
||||
}
|
||||
|
||||
static int handler(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) {
|
||||
return remove(fpath);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc < 2) return 0;
|
||||
|
||||
if (getuid()) {
|
||||
argv[0] = "-abuild-rmtemp";
|
||||
execv("/usr/bin/abuild-sudo", argv);
|
||||
}
|
||||
|
||||
if (strncmp(argv[1], PREFIX, strlen(PREFIX)) || \
|
||||
strchr(argv[1] + strlen(PREFIX), '/'))
|
||||
errx(1, "Invalid path: %s", argv[1]);
|
||||
|
||||
struct stat s;
|
||||
if (lstat(argv[1], &s)) fail();
|
||||
struct passwd *p = getpwnam(getenv("USER"));
|
||||
if (!p) errx(1, "Incorrect user");
|
||||
if (s.st_uid != p->pw_uid) errx(1, "Permission denied");
|
||||
|
||||
if (nftw(argv[1], handler, 512, FTW_DEPTH|FTW_PHYS)) fail();
|
||||
|
||||
return 0;
|
||||
}
|
@ -7,16 +7,19 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
gzip=$(command -v pigz || echo gzip)
|
||||
|
||||
do_sign() {
|
||||
local f i keyname repo
|
||||
local openssl=$(command -v openssl || echo libressl)
|
||||
|
||||
# we are actually only interested in the name, not the file itself
|
||||
keyname=${pubkey##*/}
|
||||
@ -25,37 +28,43 @@ do_sign() {
|
||||
i=$(readlink -f $f)
|
||||
[ -d "$i" ] && i="$i/APKINDEX.tar.gz"
|
||||
repo="${i%/*}"
|
||||
(
|
||||
trap 'die "failed to sign $i"' EXIT
|
||||
set -e
|
||||
cd "$repo"
|
||||
sig=".SIGN.RSA.$keyname"
|
||||
openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
|
||||
$openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
|
||||
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
||||
touch -h -d "@$SOURCE_DATE_EPOCH" "$sig"
|
||||
fi
|
||||
|
||||
tmptargz=$(mktemp)
|
||||
tar -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
|
||||
tar -f - -c "$sig" | abuild-tar --cut | $gzip -n -9 > "$tmptargz"
|
||||
tmpsigned=$(mktemp)
|
||||
cat "$tmptargz" "$i" > "$tmpsigned"
|
||||
rm -f "$tmptargz" "$sig"
|
||||
chmod 644 "$tmpsigned"
|
||||
mv "$tmpsigned" "$i"
|
||||
msg "Signed $i"
|
||||
) || die "failed to sign $i"
|
||||
set +e
|
||||
trap - EXIT
|
||||
done
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - sign indexes
|
||||
Usage: $program [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
|
||||
$program -e
|
||||
Options:
|
||||
-e, --installed Check only of there exist a private key for signing
|
||||
-k, --private KEY The private key to use for signing
|
||||
-p, --public KEY The name of public key. apk add will look for
|
||||
/etc/apk/keys/KEY
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - sign indexes
|
||||
Usage: $program [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
|
||||
$program -e
|
||||
Options:
|
||||
-e, --installed Check only of there exist a private key for signing
|
||||
-k, --private KEY The private key to use for signing
|
||||
-p, --public KEY The name of public key. apk add will look for
|
||||
/etc/apk/keys/KEY
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
|
||||
__EOF__
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_installed=false
|
||||
@ -63,7 +72,7 @@ privkey="$PACKAGER_PRIVKEY"
|
||||
pubkey=
|
||||
quiet=
|
||||
|
||||
args=`getopt -o ek:p:qh --long installed,private:,public:,quiet,help -n "$program" -- "$@"`
|
||||
args=$(getopt -o ek:p:qh --long installed,private:,public:,quiet,help -n "$program" -- "$@")
|
||||
if [ $? -ne 0 ]; then
|
||||
usage
|
||||
exit 2
|
||||
@ -87,15 +96,15 @@ if [ $# -eq 0 ] && ! $check_installed; then
|
||||
fi
|
||||
|
||||
if [ -z "$privkey" ]; then
|
||||
cat >&2 << __EOF__
|
||||
No private key found. Use 'abuild-keygen' to generate the keys.
|
||||
Then you can either:
|
||||
* set the PACKAGER_PRIVKEY in $ABUILD_USERCONF
|
||||
('abuild-keygen -a' does this for you)
|
||||
* set the PACKAGER_PRIVKEY in $ABUILD_CONF
|
||||
* specify the key with the -k option to $program
|
||||
cat >&2 <<-__EOF__
|
||||
No private key found. Use 'abuild-keygen' to generate the keys.
|
||||
Then you can either:
|
||||
* set the PACKAGER_PRIVKEY in $ABUILD_USERCONF
|
||||
('abuild-keygen -a' does this for you)
|
||||
* set the PACKAGER_PRIVKEY in $ABUILD_CONF
|
||||
* specify the key with the -k option to $program
|
||||
|
||||
__EOF__
|
||||
__EOF__
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include <err.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -27,9 +28,16 @@ static const char* valid_cmds[] = {
|
||||
"/bin/addgroup",
|
||||
"/usr/sbin/addgroup",
|
||||
"/sbin/apk",
|
||||
"/usr/bin/abuild-rmtemp",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* invalid_opts[] = {
|
||||
"--allow-untrusted",
|
||||
"--keys-dir",
|
||||
NULL,
|
||||
};
|
||||
|
||||
const char *get_command_path(const char *cmd)
|
||||
{
|
||||
const char *p;
|
||||
@ -44,11 +52,19 @@ const char *get_command_path(const char *cmd)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void check_option(const char *opt)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; invalid_opts[i] != NULL; i++)
|
||||
if (strcmp(opt, invalid_opts[i]) == 0)
|
||||
errx(1, "%s: not allowed option", opt);
|
||||
}
|
||||
|
||||
int is_in_group(gid_t group)
|
||||
{
|
||||
int ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
|
||||
gid_t *buf = malloc(ngroups_max * sizeof(gid_t));
|
||||
int ngroups, ret = 0;
|
||||
int ngroups;
|
||||
int i;
|
||||
if (buf == NULL) {
|
||||
perror("malloc");
|
||||
@ -69,18 +85,32 @@ int main(int argc, const char *argv[])
|
||||
const char *cmd;
|
||||
const char *path;
|
||||
int i;
|
||||
struct passwd *pw;
|
||||
|
||||
grent = getgrnam(ABUILD_GROUP);
|
||||
if (grent == NULL)
|
||||
errx(1, "%s: Group not found", ABUILD_GROUP);
|
||||
|
||||
char *name = NULL;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw)
|
||||
name = pw->pw_name;
|
||||
|
||||
if (!is_in_group(grent->gr_gid)) {
|
||||
char *name = getlogin();
|
||||
errx(1, "User %s is not a member of group %s\n",
|
||||
name ? name : "(unknown)", ABUILD_GROUP);
|
||||
}
|
||||
|
||||
cmd = strrchr(argv[0], '-');
|
||||
if (name == NULL)
|
||||
warnx("Could not find username for uid %d\n", getuid());
|
||||
setenv("USER", name ?: "", 1);
|
||||
|
||||
cmd = strrchr(argv[0], '/');
|
||||
if (cmd)
|
||||
cmd++;
|
||||
else
|
||||
cmd = argv[0];
|
||||
cmd = strchr(cmd, '-');
|
||||
if (cmd == NULL)
|
||||
errx(1, "Calling command has no '-'");
|
||||
cmd++;
|
||||
@ -89,14 +119,14 @@ int main(int argc, const char *argv[])
|
||||
if (path == NULL)
|
||||
errx(1, "%s: Not a valid subcommand", cmd);
|
||||
|
||||
/* we dont allow --allow-untrusted option */
|
||||
for (i = 1; i < argc; i++)
|
||||
if (strcmp(argv[i], "--allow-untrusted") == 0)
|
||||
errx(1, "%s: not allowed option", "--allow-untrusted");
|
||||
check_option(argv[i]);
|
||||
|
||||
argv[0] = path;
|
||||
/* set our uid to root so bbsuid --install works */
|
||||
setuid(0);
|
||||
/* set our gid to root so apk commit hooks run with the same gid as for "sudo apk add ..." */
|
||||
setgid(0);
|
||||
execv(path, (char * const*)argv);
|
||||
perror(path);
|
||||
return 1;
|
||||
|
@ -9,6 +9,9 @@ export MAKEFLAGS=-j$JOBS
|
||||
# remove line below to disable colors
|
||||
USE_COLORS=1
|
||||
|
||||
# uncomment line below to enable ccache support.
|
||||
#USE_CCACHE=1
|
||||
|
||||
SRCDEST=/var/cache/distfiles
|
||||
|
||||
# uncomment line below to store built packages in other location
|
||||
@ -22,7 +25,7 @@ REPODEST=$HOME/packages/
|
||||
#MAINTAINER="$PACKAGER"
|
||||
|
||||
# what to clean up after a successful build
|
||||
CLEANUP="srcdir pkgdir deps"
|
||||
CLEANUP="srcdir bldroot pkgdir deps"
|
||||
|
||||
# what to cleanup after a failed build
|
||||
ERROR_CLEANUP="deps"
|
||||
ERROR_CLEANUP="bldroot deps"
|
||||
|
35
abump.in
35
abump.in
@ -7,13 +7,13 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
: ${ABUILD:="abuild"}
|
||||
|
||||
@ -86,18 +86,18 @@ fixes #${fixes#\#}
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - bump pkgver in APKBUILDs
|
||||
Usage: $program [-s CVE-1,CVE-2,...] [-f ISSUE] [-R|--recursive] [-k|--keep] PKGNAME-1.2.3 ...
|
||||
Options:
|
||||
-s, --security CVE1,CVE-2,... Security update
|
||||
-f, --fixes ISSUE Fixes ISSUE
|
||||
-R, --recursive Run abuild with -R for recursive building
|
||||
-k, --keep Run abuild with -k to keep existing packages
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - bump pkgver in APKBUILDs
|
||||
Usage: $program [-s CVE-1,CVE-2,...] [-f ISSUE] [-R|--recursive] [-k|--keep] PKGNAME-1.2.3 ...
|
||||
Options:
|
||||
-s, --security CVE1,CVE-2,... Security update
|
||||
-f, --fixes ISSUE Fixes ISSUE
|
||||
-R, --recursive Run abuild with -R for recursive building
|
||||
-k, --keep Run abuild with -k to keep existing packages
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
|
||||
__EOF__
|
||||
__EOF__
|
||||
}
|
||||
|
||||
keep=
|
||||
@ -108,8 +108,8 @@ fixes=
|
||||
[ -n "$APORTSDIR" ] || error "can't locate \$APORTSDIR"
|
||||
git rev-parse 2>/dev/null || die "not in a git tree"
|
||||
|
||||
args=`getopt -o f:s:Rkqh --long fixes:,security:,recursive,keep,quiet,help \
|
||||
-n "$program" -- "$@"`
|
||||
args=$(getopt -o f:s:Rkqh --long fixes:,security:,recursive,keep,quiet,help \
|
||||
-n "$program" -- "$@")
|
||||
if [ $? -ne 0 ]; then
|
||||
usage
|
||||
exit 2
|
||||
@ -136,4 +136,3 @@ fi
|
||||
abuild_opts="$recursive $keep"
|
||||
|
||||
do_bump "$@"
|
||||
|
||||
|
175
apkbuild-cpan.in
175
apkbuild-cpan.in
@ -3,7 +3,10 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use feature qw(:5.10);
|
||||
use 5.016;
|
||||
use feature "switch";
|
||||
no if $] >= 5.018, warnings => "experimental::smartmatch";
|
||||
|
||||
use LWP::UserAgent;
|
||||
use LWP::ConnCache;
|
||||
use CPAN::Meta;
|
||||
@ -11,8 +14,9 @@ use Module::CoreList;
|
||||
use JSON;
|
||||
|
||||
my $license_mappings = {
|
||||
"perl_5" => "GPL PerlArtistic",
|
||||
"artistic_2" => "Artistic-2",
|
||||
"perl_5" => "GPL-1.0-or-later OR Artistic-1.0-Perl",
|
||||
"artistic_2" => "Artistic-2.0",
|
||||
"gpl_3" => "GPL-3.0-only",
|
||||
};
|
||||
|
||||
my $package_mappings = {
|
||||
@ -21,37 +25,31 @@ my $package_mappings = {
|
||||
};
|
||||
our $packager = "";
|
||||
my $template = <<'EOF';
|
||||
# Automatically generated by apkbuild-cpan, template 1
|
||||
# Contributor: [% packager %]
|
||||
# Maintainer: [% packager %]
|
||||
# Automatically generated by apkbuild-cpan, template 2
|
||||
[% authors %]
|
||||
pkgname=[% pkgname %]
|
||||
_pkgreal=[% pkgreal %]
|
||||
pkgver=[% pkgver %]
|
||||
pkgrel=0
|
||||
pkgdesc="Perl module for [% pkgreal %]"
|
||||
url="http://search.cpan.org/dist/[% pkgreal %]/"
|
||||
url="https://metacpan.org/release/[% pkgreal %]/"
|
||||
arch="noarch"
|
||||
license="GPL PerlArtistic"
|
||||
license="GPL-1.0-or-later Artistic-1.0-Perl"
|
||||
cpandepends=""
|
||||
cpanmakedepends=""
|
||||
cpancheckdepends=""
|
||||
depends="$cpandepends"
|
||||
makedepends="perl-dev $cpanmakedepends"
|
||||
checkdepends="$cpancheckdepends"
|
||||
subpackages="$pkgname-doc"
|
||||
source="[% source %]"
|
||||
builddir="$srcdir/$_pkgreal-$pkgver"
|
||||
|
||||
prepare() {
|
||||
default_prepare || return 1
|
||||
|
||||
cd "$builddir"
|
||||
if [ -e Build.PL ]; then
|
||||
perl Build.PL installdirs=vendor || return 1
|
||||
else
|
||||
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
|
||||
fi
|
||||
build() {
|
||||
:
|
||||
}
|
||||
|
||||
build() {
|
||||
check() {
|
||||
:
|
||||
}
|
||||
|
||||
@ -66,8 +64,7 @@ our $json = JSON->new;
|
||||
$ua->env_proxy;
|
||||
$ua->conn_cache(LWP::ConnCache->new());
|
||||
|
||||
sub read_file
|
||||
{
|
||||
sub read_file {
|
||||
my ($filename) = @_;
|
||||
local $/;
|
||||
open my $fh, "<", $filename or die "could not open $filename: $!";
|
||||
@ -76,10 +73,15 @@ sub read_file
|
||||
|
||||
sub read_assignments_from_file {
|
||||
my ($filename) = @_;
|
||||
return () if ( ! -e $filename );
|
||||
my $text = read_file($filename);
|
||||
my %sline = $text =~ /^(\w+)\s*=\s*([^\"\n]*)$/mg;
|
||||
my %mline = $text =~ /^(\w+)\s*=\s*\"([^\"]*)\"$/mg;
|
||||
my %hash = ( %sline, %mline );
|
||||
|
||||
my $authors = join("\n", $text =~ /^# Contributor: .*$/mg, $text =~ /^# Maintainer: .*$/mg);
|
||||
$hash{'authors'} = $authors if length($authors) > 1;
|
||||
|
||||
return \%hash;
|
||||
}
|
||||
|
||||
@ -96,17 +98,20 @@ sub read_apkbuild {
|
||||
}
|
||||
|
||||
sub write_apkbuild {
|
||||
my ($distdata) = @_;
|
||||
my ($distdata, $authors, $moddata) = @_;
|
||||
|
||||
my $cpanid = $distdata->{releases}[0]->{cpanid};
|
||||
my $cpanid = $distdata->{id};
|
||||
$cpanid = substr($cpanid, 0, 1) . "/" . substr($cpanid, 0, 2) . "/$cpanid";
|
||||
|
||||
my %repl = (
|
||||
packager => $packager,
|
||||
pkgname => map_cpan_to_apk($distdata->{name}),
|
||||
pkgreal => $distdata->{name},
|
||||
pkgver => $distdata->{releases}[0]->{version},
|
||||
source => "http://search.cpan.org/CPAN/authors/id/$cpanid/\$_pkgreal-\$pkgver.tar.gz",
|
||||
authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"),
|
||||
pkgname => map_cpan_to_apk($moddata->{distribution}),
|
||||
pkgreal => $moddata->{distribution},
|
||||
pkgver => $moddata->{version} =~ s/^[^0-9]+//r,
|
||||
source => $moddata->{download_url},
|
||||
pkgdesc => $distdata->{abstract},
|
||||
);
|
||||
$repl{source} =~ s/$repl{pkgver}/\$pkgver/g;
|
||||
$template =~ s/\[% (.*?) %\]/$repl{$1}/g;
|
||||
|
||||
open my $fh, '>', "APKBUILD" or die;
|
||||
@ -123,23 +128,24 @@ sub parse_deps {
|
||||
my $deps = "";
|
||||
|
||||
for my $module ($reqs->required_modules) {
|
||||
if (my $perlver = Module::CoreList->first_release($module)) {
|
||||
if (Module::CoreList->is_core($module)) {
|
||||
my $perlver = Module::CoreList->first_release($module);
|
||||
say "$module is part of core perl since $perlver.";
|
||||
next;
|
||||
}
|
||||
next if $module eq 'perl';
|
||||
|
||||
# map module name to package name
|
||||
$response = $ua->get("http://search.cpan.org/api/module/$module");
|
||||
$response = $ua->get("https://fastapi.metacpan.org/module/$module");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $moddata = $json->decode($response->decoded_content);
|
||||
$moddata->{error} and die "Error trying to locate $module: $moddata->{error}\n";
|
||||
$distfiles->{$moddata->{distvname}} = $moddata;
|
||||
$distfiles->{$moddata->{distribution}} = $moddata;
|
||||
}
|
||||
|
||||
# map package names to alpine packages
|
||||
foreach ( keys $distfiles ) {
|
||||
$response = $ua->get("http://search.cpan.org/api/dist/$_");
|
||||
foreach ( keys %{ $distfiles } ) {
|
||||
$response = $ua->get("https://fastapi.metacpan.org/release/$_");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $distdata = $json->decode($response->decoded_content);
|
||||
$distdata->{error} and die "Error trying to locate $_: $distdata->{error}\n";
|
||||
@ -147,7 +153,8 @@ sub parse_deps {
|
||||
my $pkgname = map_cpan_to_apk($distdata->{name});
|
||||
$deps .= "$pkgname ";
|
||||
}
|
||||
$deps =~ s/\s+$//;
|
||||
$deps =~ s/\h+/ /g;
|
||||
$deps =~ s/ $//;
|
||||
return $deps;
|
||||
|
||||
}
|
||||
@ -160,67 +167,58 @@ sub prepare_tree {
|
||||
sub update_functions {
|
||||
my $apkbuild = read_apkbuild;
|
||||
my $metaprefix = "src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/";
|
||||
my $prepare_func;
|
||||
my $build_func;
|
||||
my $check_func;
|
||||
my $package_func;
|
||||
|
||||
my $text = read_file "APKBUILD";
|
||||
if (-e "$metaprefix/Build.PL" ) {
|
||||
$prepare_func = <<'EOF';
|
||||
prepare() {
|
||||
default_prepare || return 1
|
||||
|
||||
cd "$builddir"
|
||||
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
|
||||
perl Build.PL installdirs=vendor || return 1
|
||||
}
|
||||
EOF
|
||||
$build_func = <<'EOF';
|
||||
build() {
|
||||
cd "$builddir"
|
||||
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
|
||||
./Build && ./Build test
|
||||
perl Build.PL installdirs=vendor
|
||||
./Build
|
||||
}
|
||||
EOF
|
||||
$package_func = <<'EOF';
|
||||
package() {
|
||||
cd "$builddir"
|
||||
./Build install destdir="$pkgdir" || return 1
|
||||
./Build install destdir="$pkgdir"
|
||||
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
|
||||
}
|
||||
EOF
|
||||
$check_func = <<'EOF';
|
||||
check() {
|
||||
./Build test
|
||||
}
|
||||
EOF
|
||||
} else {
|
||||
$prepare_func = <<'EOF';
|
||||
prepare() {
|
||||
default_prepare || return 1
|
||||
|
||||
cd "$builddir"
|
||||
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
|
||||
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
|
||||
}
|
||||
EOF
|
||||
$build_func = <<'EOF';
|
||||
build() {
|
||||
cd "$builddir"
|
||||
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
|
||||
make && make test
|
||||
PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
|
||||
make
|
||||
}
|
||||
EOF
|
||||
$package_func = <<'EOF';
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make DESTDIR="$pkgdir" install || return 1
|
||||
make DESTDIR="$pkgdir" install
|
||||
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
|
||||
}
|
||||
EOF
|
||||
$check_func = <<'EOF';
|
||||
check() {
|
||||
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
|
||||
make test
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
$text =~ s/^prepare\(\) \{.*?^\}\n/$prepare_func/smg or
|
||||
die "Can't replace prepare function APKBUILD";
|
||||
$text =~ s/^build\(\) \{.*?^\}\n/$build_func/smg or
|
||||
die "Can't replace build function APKBUILD";
|
||||
$text =~ s/^package\(\) \{.*?^\}\n/$package_func/smg or
|
||||
die "Can't replace package function APKBUILD";
|
||||
$text =~ s/^check\(\) \{.*?^\}\n/$check_func/smg or
|
||||
die "Can't replace check function APKBUILD";
|
||||
|
||||
open my $fh, '>', "APKBUILD" or die;
|
||||
print $fh $text;
|
||||
@ -228,6 +226,7 @@ EOF
|
||||
}
|
||||
|
||||
sub do_depends {
|
||||
|
||||
my $apkbuild = read_apkbuild;
|
||||
my $metaprefix = "src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/";
|
||||
my $meta;
|
||||
@ -251,14 +250,21 @@ sub do_depends {
|
||||
say "CPAN deps: $deps";
|
||||
say "Recommend: " . parse_deps $meta->effective_prereqs->requirements_for('runtime', 'recommends');
|
||||
|
||||
my $makedeps = parse_deps $meta->effective_prereqs->requirements_for('build', 'requires');
|
||||
$makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('build', 'recommends');
|
||||
$makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('test', 'requires');
|
||||
$makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('test', 'recommends');
|
||||
my $makedeps = parse_deps(
|
||||
$meta->effective_prereqs->requirements_for('configure', 'requires'),
|
||||
$meta->effective_prereqs->requirements_for('configure', 'recommends'),
|
||||
$meta->effective_prereqs->requirements_for('build', 'requires'),
|
||||
$meta->effective_prereqs->requirements_for('build', 'recommends')
|
||||
);
|
||||
say "CPAN build deps: $makedeps";
|
||||
say "CPAN requires: " . parse_deps($meta->effective_prereqs->requirements_for('configure', 'requires'), $meta->effective_prereqs->requirements_for('build', 'requires'));
|
||||
say "CPAN recommds: " . parse_deps($meta->effective_prereqs->requirements_for('configure', 'recommends'), $meta->effective_prereqs->requirements_for('build', 'recommends'));
|
||||
|
||||
my $checkdeps = parse_deps($meta->effective_prereqs->requirements_for('test', 'requires'), $meta->effective_prereqs->requirements_for('test', 'recommends'));
|
||||
say "CPAN check deps: $makedeps";
|
||||
|
||||
my $text = read_file "APKBUILD";
|
||||
if ($abstract) {
|
||||
if ($abstract && $abstract ne 'unknown') {
|
||||
$text =~ s/^pkgdesc=\"([^\"]*)\"$/pkgdesc=\"$abstract\"/mg or
|
||||
die "Can't find cpandepends line in APKBUILD";
|
||||
}
|
||||
@ -274,6 +280,8 @@ sub do_depends {
|
||||
die "Can't find cpandepends line in APKBUILD";
|
||||
$text =~ s/^cpanmakedepends=\"([^\"]*)\"$/cpanmakedepends=\"$makedeps\"/mg or
|
||||
die "Can't find cpanmakedepends line in APKBUILD";
|
||||
$text =~ s/^cpancheckdepends=\"([^\"]*)\"$/cpancheckdepends=\"$checkdeps\"/mg or
|
||||
die "Can't find cpancheckdepends line in APKBUILD";
|
||||
|
||||
open my $fh, '>', "APKBUILD" or die;
|
||||
print $fh $text;
|
||||
@ -282,52 +290,61 @@ sub do_depends {
|
||||
|
||||
sub get_data {
|
||||
my $apkbuild = read_apkbuild;
|
||||
my $response = $ua->get("http://search.cpan.org/api/dist/$apkbuild->{_pkgreal}");
|
||||
$apkbuild->{_pkgreal} or die "Not apkbuild-cpan generated APKBUILD";
|
||||
my $response = $ua->get("https://fastapi.metacpan.org/release/$apkbuild->{_pkgreal}");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $distdata = $json->decode($response->decoded_content);
|
||||
$distdata->{error} and die "Error trying to locate $apkbuild->{_pkgreal}: $distdata->{error}\n";
|
||||
|
||||
return ($apkbuild, $distdata);
|
||||
$response = $ua->get("https://fastapi.metacpan.org/module/$distdata->{main_module}");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $moddata = $json->decode($response->decoded_content);
|
||||
$moddata->{error} and die "Error trying to locate $distdata->{main_module}: $moddata->{error}\n";
|
||||
|
||||
return ($apkbuild, $distdata, $moddata);
|
||||
}
|
||||
|
||||
my $abuild_conf = read_assignments_from_file("/etc/abuild.conf");
|
||||
$packager = $abuild_conf->{PACKAGER} if $abuild_conf->{PACKAGER};
|
||||
|
||||
my $user_abuild_conf = read_assignments_from_file($ENV{"HOME"} . "/.abuild/abuild.conf");
|
||||
$packager = $user_abuild_conf->{PACKAGER} if $user_abuild_conf->{PACKAGER};
|
||||
|
||||
given ( $ARGV[0] ) {
|
||||
when ("create") {
|
||||
my $module = $ARGV[1];
|
||||
my $response;
|
||||
$module or die "Module name is a mandatory argument";
|
||||
|
||||
$response = $ua->get("http://search.cpan.org/api/module/$module");
|
||||
$response = $ua->get("https://fastapi.metacpan.org/module/$module");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $moddata = $json->decode($response->decoded_content);
|
||||
$moddata->{error} and die "Error trying to locate $module: $moddata->{error}\n";
|
||||
|
||||
$response = $ua->get("http://search.cpan.org/api/dist/$moddata->{distvname}");
|
||||
$response = $ua->get("https://fastapi.metacpan.org/release/$moddata->{distribution}");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $distdata = $json->decode($response->decoded_content);
|
||||
$distdata->{error} and die "Error trying to locate $module: $distdata->{error}\n";
|
||||
|
||||
my $apkname = map_cpan_to_apk $distdata->{name};
|
||||
my $apkname = map_cpan_to_apk $distdata->{metadata}{name};
|
||||
mkdir $apkname;
|
||||
chdir $apkname;
|
||||
write_apkbuild($distdata);
|
||||
write_apkbuild($distdata, undef, $moddata);
|
||||
prepare_tree;
|
||||
update_functions;
|
||||
do_depends;
|
||||
}
|
||||
when ("recreate") {
|
||||
my ($apkbuild, $distdata) = get_data;
|
||||
write_apkbuild($distdata);
|
||||
my ($apkbuild, $distdata, $moddata) = get_data;
|
||||
write_apkbuild($distdata, $apkbuild->{authors}, $moddata);
|
||||
prepare_tree;
|
||||
update_functions;
|
||||
do_depends;
|
||||
}
|
||||
when ("upgrade") {
|
||||
my ($apkbuild, $distdata) = get_data;
|
||||
my ($apkbuild, $distdata, $moddata) = get_data;
|
||||
|
||||
my $pkgver = $distdata->{releases}[0]->{version};
|
||||
my $pkgver = $moddata->{version} =~ s/^[^0-9]+//r;
|
||||
if ($pkgver != $apkbuild->{pkgver}) {
|
||||
say "Upgrading CPAN module from $apkbuild->{pkgver} to $pkgver";
|
||||
|
||||
@ -346,8 +363,8 @@ given ( $ARGV[0] ) {
|
||||
}
|
||||
}
|
||||
when ('check') {
|
||||
my ($apkbuild, $distdata) = get_data;
|
||||
my $pkgver = $distdata->{releases}[0]->{version};
|
||||
my ($apkbuild, $distdata, $moddata) = get_data;
|
||||
my $pkgver = $moddata->{version} =~ s/^[^0-9]+//r;
|
||||
say "$apkbuild->{pkgname}: Latest version: $pkgver Packaged version: $apkbuild->{pkgver}";
|
||||
if ($pkgver ne $apkbuild->{pkgver}) {
|
||||
exit(1);
|
||||
|
@ -211,7 +211,7 @@ end
|
||||
|
||||
|
||||
class Update
|
||||
def initialize
|
||||
def initialize
|
||||
@gems = {}
|
||||
@deps = []
|
||||
end
|
||||
|
@ -13,37 +13,40 @@ my %pkgmap = ();
|
||||
my %licenses = ();
|
||||
|
||||
my $template = <<'EOF';
|
||||
# Contributor: [% contributor %]
|
||||
# Maintainer: [% maintainer %]
|
||||
[% authors %]
|
||||
pkgname=[% pkgname %]
|
||||
_pkgreal=[% pkgreal %]
|
||||
pkgver=[% pkgver %]
|
||||
pkgrel=0
|
||||
pkgdesc=[% pkgdesc %]
|
||||
pkgdesc="[% pkgdesc %]"
|
||||
url="http://packages.python.org/pypi/[% pkgreal %]"
|
||||
arch="noarch"
|
||||
license="PSF"
|
||||
license="[% license %]"
|
||||
pydepends=""
|
||||
pymakedepends=""
|
||||
depends="python $pydepends"
|
||||
makedepends="python-dev $pymakedepends"
|
||||
subpackages="$pkgname-doc"
|
||||
depends="python3 $pydepends"
|
||||
checkdepends="python3-dev"
|
||||
makedepends="py3-setuptools $pymakedepends"
|
||||
subpackages=""
|
||||
source="[% source %]"
|
||||
builddir="$srcdir/$_pkgreal-$pkgver"
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
python setup.py build || return 1
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
python setup.py install \
|
||||
PYTHONPATH=$pkgdir`python3 -c "import site; print(site.getsitepackages()[0])"` \
|
||||
python3 setup.py install \
|
||||
--prefix=/usr \
|
||||
--root="$pkgdir" \
|
||||
--single-version-externally-managed \
|
||||
|| return 1
|
||||
--single-version-externally-managed
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 setup.py test
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
my $ua = LWP::UserAgent->new();
|
||||
@ -61,19 +64,22 @@ sub read_file {
|
||||
|
||||
sub read_assignments_from_file {
|
||||
my ($filename) = @_;
|
||||
return () if ( ! -e $filename );
|
||||
my $text = read_file($filename);
|
||||
my %sline = $text =~ /^(\w+)\s*=\s*([^\"\n]*)$/mg;
|
||||
my %mline = $text =~ /^(\w+)\s*=\s*\"([^\"]*)\"$/mg;
|
||||
my %hash = ( %sline, %mline );
|
||||
|
||||
my %temp = (%sline, %mline);
|
||||
my $authors = join("\n", $text =~ /^# Contributor: .*$/mg, $text =~ /^# Maintainer: .*$/mg);
|
||||
$hash{'authors'} = $authors if length($authors) > 1;
|
||||
|
||||
return \%temp;
|
||||
return \%hash;
|
||||
}
|
||||
|
||||
sub map_pypi_to_apk {
|
||||
my ($pypi) = @_;
|
||||
return $pkgmap{$pypi} unless !exists($pkgmap{$pypi});
|
||||
return 'py-'.lc($pypi);
|
||||
return 'py3-'.lc($pypi);
|
||||
}
|
||||
|
||||
sub map_license {
|
||||
@ -98,15 +104,16 @@ sub read_apkbuild {
|
||||
}
|
||||
|
||||
sub write_apkbuild {
|
||||
my ($distdata) = @_;
|
||||
my ($distdata, $authors) = @_;
|
||||
|
||||
my %repl = (
|
||||
packager => $packager,
|
||||
authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"),
|
||||
pkgname => map_pypi_to_apk($distdata->{info}{name}),
|
||||
pkgreal => $distdata->{info}{name},
|
||||
pkgver => $distdata->{info}{version},
|
||||
source => get_source($distdata),
|
||||
license => map_license($distdata->{info}{license}),
|
||||
pkgdesc => $distdata->{info}{summary},
|
||||
);
|
||||
$template =~ s/\[% (.*?) %\]/$repl{$1}/g;
|
||||
|
||||
@ -125,7 +132,7 @@ sub prepare_tree {
|
||||
|
||||
sub get_data {
|
||||
my ($package) = @_;
|
||||
my $response = $ua->get("http://pypi.python.org/pypi/$package/json");
|
||||
my $response = $ua->get("https://pypi.python.org/pypi/$package/json");
|
||||
$response->is_success or die $response->status_line;
|
||||
my $distdata = $json->decode($response->decoded_content);
|
||||
|
||||
@ -136,7 +143,7 @@ sub get_deps {
|
||||
my ($data) = @_;
|
||||
|
||||
chdir "src/$data->{pkgreal}-$data->{pkgver}";
|
||||
my $reqs = `python ./setup.py --requires`;
|
||||
my $reqs = `python3 ./setup.py --requires`;
|
||||
|
||||
my @reqs = split /\n/, $reqs;
|
||||
|
||||
@ -163,6 +170,9 @@ sub get_deps {
|
||||
my $abuild_conf = read_assignments_from_file('/etc/abuild.conf');
|
||||
$packager = $abuild_conf->{PACKAGER} if $abuild_conf->{PACKAGER};
|
||||
|
||||
my $user_abuild_conf = read_assignments_from_file($ENV{"HOME"} . "/.abuild/abuild.conf");
|
||||
$packager = $user_abuild_conf->{PACKAGER} if $user_abuild_conf->{PACKAGER};
|
||||
|
||||
sub usage {
|
||||
say <<'EOF';
|
||||
Usage: apkbuild-pypi [create <package> | check | recreate | upgrade | update]
|
||||
@ -189,16 +199,17 @@ given ($ARGV[0]) {
|
||||
mkdir $apkname;
|
||||
chdir $apkname;
|
||||
|
||||
my $data = write_apkbuild($distdata);
|
||||
my $data = write_apkbuild($distdata, undef);
|
||||
prepare_tree;
|
||||
|
||||
get_deps($data);
|
||||
} when ('recreate') {
|
||||
my $apkbuild = read_apkbuild;
|
||||
my $distdata = get_data($apkbuild->{_pkgreal});
|
||||
my $data = write_apkbuild($distdata, $apkbuild->{authors});
|
||||
|
||||
prepare_tree;
|
||||
get_deps;
|
||||
get_deps($data);
|
||||
} when ('upgrade') {
|
||||
my $apkbuild = read_apkbuild;
|
||||
my $distdata = get_data($apkbuild->{_pkgreal});
|
||||
|
43
apkgrel.in
43
apkgrel.in
@ -7,13 +7,13 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
|
||||
show_plain() {
|
||||
@ -73,21 +73,21 @@ do_nothing() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - display or bump pkgrel in APKBUILDs
|
||||
Usage: $program [-z|--zero] [-a|--add] [-g|--clean-git] [-s|--set NUM]
|
||||
[-t|--test] [-f|--force] DIR or APKBUILD...
|
||||
Options:
|
||||
-z, --zero Set pkgrel to 0
|
||||
-a, --add Add 1 to current pkgrel
|
||||
-g, --clean-git Only operate on APKBUILDs with clean git status (implies
|
||||
--add)
|
||||
-s, --set NUM Set pkgrel to NUM
|
||||
-t, --test Only verify that files have a valid pkgrel
|
||||
-f, --force Operate on files without a valid pkgrel
|
||||
-h, --help Show this help
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - display or bump pkgrel in APKBUILDs
|
||||
Usage: $program [-z|--zero] [-a|--add] [-g|--clean-git] [-s|--set NUM]
|
||||
[-t|--test] [-f|--force] DIR or APKBUILD...
|
||||
Options:
|
||||
-z, --zero Set pkgrel to 0
|
||||
-a, --add Add 1 to current pkgrel
|
||||
-g, --clean-git Only operate on APKBUILDs with clean git status (implies
|
||||
--add)
|
||||
-s, --set NUM Set pkgrel to NUM
|
||||
-t, --test Only verify that files have a valid pkgrel
|
||||
-f, --force Operate on files without a valid pkgrel
|
||||
-h, --help Show this help
|
||||
|
||||
__EOF__
|
||||
__EOF__
|
||||
}
|
||||
|
||||
cmd=do_show
|
||||
@ -95,8 +95,8 @@ force=
|
||||
setto=
|
||||
only_clean_git=
|
||||
|
||||
args=`getopt -o zags:tfqh --long zero,add,clean-git,set:,test,force,quiet,help \
|
||||
-n "$program" -- "$@"`
|
||||
args=$(getopt -o zags:tfqh --long zero,add,clean-git,set:,test,force,quiet,help \
|
||||
-n "$program" -- "$@")
|
||||
if [ $? -ne 0 ]; then
|
||||
usage
|
||||
exit 2
|
||||
@ -130,10 +130,9 @@ fi
|
||||
args=$(for a; do p=$(any_buildscript "$a") || die "can't find APKBUILD for $a"; echo "$p"; done)
|
||||
[ $? -eq 0 ] || exit 1
|
||||
oldifs=$IFS
|
||||
IFS=$'\n'
|
||||
IFS=$(printf '\n')
|
||||
set -- $args
|
||||
IFS=$oldifs
|
||||
|
||||
do_verify "$@" || exit 1
|
||||
$cmd "$@"
|
||||
|
||||
|
@ -178,7 +178,7 @@ stop-initfs)
|
||||
cd "$LOGDIR"
|
||||
mkdir "$NEWROOT$LOGDIR"
|
||||
cp /sbin/bootchartd $NEWROOT/sbin
|
||||
PID=`cat bootchart.pid`
|
||||
PID=$(cat bootchart.pid)
|
||||
kill -USR2 $PID
|
||||
wait $PID
|
||||
mv * "$NEWROOT$LOGDIR"
|
||||
|
98
buildlab.in
98
buildlab.in
@ -3,7 +3,7 @@
|
||||
program_version=@VERSION@
|
||||
sysconfdir=@sysconfdir@
|
||||
abuildrepo=/var/lib/buildlab/result
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
BUILD_BASE="build-base"
|
||||
SUDO=${SUDO:-"sudo"}
|
||||
@ -15,32 +15,32 @@ ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
|
||||
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
||||
|
||||
default_colors() {
|
||||
NORMAL="\033[1;0m"
|
||||
STRONG="\033[1;1m"
|
||||
RED="\033[1;31m"
|
||||
GREEN="\033[1;32m"
|
||||
YELLOW="\033[1;33m"
|
||||
BLUE="\033[1;34m"
|
||||
NORMAL="\033[1;0m"
|
||||
STRONG="\033[1;1m"
|
||||
RED="\033[1;31m"
|
||||
GREEN="\033[1;32m"
|
||||
YELLOW="\033[1;33m"
|
||||
BLUE="\033[1;34m"
|
||||
}
|
||||
|
||||
default_colors
|
||||
|
||||
is_local() {
|
||||
case "$1" in
|
||||
http://*|ftp://*|https://*|saveas-*://*)
|
||||
return 1;;
|
||||
esac
|
||||
return 0
|
||||
case "$1" in
|
||||
http://*|ftp://*|https://*|saveas-*://*)
|
||||
return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
msg() {
|
||||
local prompt="$GREEN>>>${NORMAL}"
|
||||
[ -z "$quiet" ] && printf "${prompt} $@\n" >&2
|
||||
[ -z "$quiet" ] && printf "${prompt} $@\n" >&2
|
||||
}
|
||||
|
||||
error() {
|
||||
local prompt="$RED>>>${NORMAL}"
|
||||
printf "${prompt} $@\n" >&2
|
||||
printf "${prompt} $@\n" >&2
|
||||
}
|
||||
|
||||
die() {
|
||||
@ -49,9 +49,9 @@ die() {
|
||||
}
|
||||
|
||||
runpart() {
|
||||
local part=$1
|
||||
local part=$1
|
||||
msg "Running part $part"
|
||||
$part || die "$part failed"
|
||||
$part || die "$part failed"
|
||||
}
|
||||
|
||||
is_vserver() {
|
||||
@ -161,9 +161,9 @@ prepare_chroot() {
|
||||
|
||||
msg "Generating buildlab signing keys..."
|
||||
do_chroot_action "$path" su abuild -c "'abuild-keygen -ai'"
|
||||
|
||||
|
||||
msg "Setting up repository symlink..."
|
||||
mkdir -p "$path"/home/abuild/.cache/apks
|
||||
mkdir -p "$path"/home/abuild/.cache/apks
|
||||
do_chroot_action "$path" chown abuild:abuild /home/abuild/${src}
|
||||
do_chroot_action "$path" ln -sf .cache/apks /home/abuild/repo
|
||||
|
||||
@ -221,33 +221,35 @@ build_package() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "buildlab $program_version"
|
||||
echo " "
|
||||
echo "Common options:"
|
||||
echo " "
|
||||
echo " -q Quiet operation"
|
||||
echo " -p Path to buildroot"
|
||||
echo " "
|
||||
echo "Creating build roots (buildlab -C):"
|
||||
echo " "
|
||||
echo " -m APK repository mirror"
|
||||
echo " -v APK distribution version"
|
||||
echo " -a APK repository architecture"
|
||||
echo " -k Enable APK caching"
|
||||
echo " "
|
||||
echo "Updating build roots (buildlab -u):"
|
||||
echo " "
|
||||
echo " No special options."
|
||||
echo " "
|
||||
echo "Building packages (buildlab -b):"
|
||||
echo " "
|
||||
echo " -b APKBUILD file"
|
||||
echo " "
|
||||
echo "Examples:"
|
||||
echo " "
|
||||
echo "sudo ./buildlab -C -p /home/nenolod/buildroot -m dl-3.alpinelinux.org -v edge -a x86_64"
|
||||
echo "sudo ./buildlab -b /home/nenolod/aports/main/gnome-panel/APKBUILD -p /home/nenolod/buildroot"
|
||||
echo "sudo ./buildlab -u -p /home/nenolod/buildroot"
|
||||
cat <<-EOF
|
||||
buildlab $program_version
|
||||
|
||||
Common options:
|
||||
|
||||
-q Quiet operation
|
||||
-p Path to buildroot
|
||||
|
||||
Creating build roots (buildlab -C):
|
||||
|
||||
-m APK repository mirror
|
||||
-v APK distribution version
|
||||
-a APK repository architecture
|
||||
-k Enable APK caching
|
||||
|
||||
Updating build roots (buildlab -u):
|
||||
|
||||
No special options.
|
||||
|
||||
Building packages (buildlab -b):
|
||||
|
||||
-b APKBUILD file
|
||||
|
||||
Examples:
|
||||
|
||||
sudo ./buildlab -C -p /home/nenolod/buildroot -m dl-3.alpinelinux.org -v edge -a x86_64
|
||||
sudo ./buildlab -b /home/nenolod/aports/main/gnome-panel/APKBUILD -p /home/nenolod/buildroot
|
||||
sudo ./buildlab -u -p /home/nenolod/buildroot
|
||||
EOF
|
||||
}
|
||||
|
||||
unset force
|
||||
@ -256,8 +258,8 @@ while getopts "chqCkp:v:m:a:b:u" opt; do
|
||||
case $opt in
|
||||
'c') default_colors
|
||||
color_opt="-c";;
|
||||
'h') usage;;
|
||||
'q') quiet="-q";;
|
||||
'h') usage;;
|
||||
'q') quiet="-q";;
|
||||
'C') create="-c";;
|
||||
'p') buildpath="$OPTARG";;
|
||||
'm') buildmirror="$OPTARG";;
|
||||
@ -266,7 +268,7 @@ while getopts "chqCkp:v:m:a:b:u" opt; do
|
||||
'k') enablecache=1;;
|
||||
'b') buildpkg="$OPTARG";;
|
||||
'u') update="-u";;
|
||||
esac
|
||||
esac
|
||||
done
|
||||
shift $(( $OPTIND - 1 ))
|
||||
|
||||
|
27
checkapk.in
27
checkapk.in
@ -7,23 +7,23 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - find ABI breakages in package upgrades
|
||||
Usage: $program
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - find ABI breakages in package upgrades
|
||||
Usage: $program
|
||||
|
||||
Run in the directory of a built package.
|
||||
Run in the directory of a built package.
|
||||
|
||||
__EOF__
|
||||
__EOF__
|
||||
}
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
@ -47,6 +47,7 @@ fi
|
||||
|
||||
startdir="$PWD"
|
||||
tmpdir=$(mktemp -d -t checkpkg-script.XXXXXX)
|
||||
trap "rm -rf '$tmpdir'" INT EXIT
|
||||
cd "$tmpdir" || die "failed to create temp dir"
|
||||
|
||||
for i in $pkgname $subpackages; do
|
||||
@ -63,10 +64,10 @@ for i in $pkgname $subpackages; do
|
||||
done
|
||||
[ -f "$filepath" ] || die "can't find $pkgfile"
|
||||
|
||||
# generate a temp repositories file with only the http repos
|
||||
grep ^http: /etc/apk/repositories > $tmpdir/repositories
|
||||
# generate a temp repositories file with only the http(s) repos
|
||||
grep -E "^https?:" /etc/apk/repositories > $tmpdir/repositories
|
||||
|
||||
oldpkg=$(apk fetch --repositories-file $tmpdir/repositories --simulate 2>&1 | sed 's/^Downloading //')
|
||||
oldpkg=$(apk fetch --repositories-file $tmpdir/repositories --simulate $_pkgname 2>&1 | sed 's/^Downloading //')
|
||||
if [ "${oldpkg}" = "${pkg}" ]; then
|
||||
die "the built package ($_pkgname) is already in the repo"
|
||||
fi
|
||||
@ -91,5 +92,3 @@ for i in $pkgname $subpackages; do
|
||||
msg "No soname differences for $_pkgname."
|
||||
fi
|
||||
done
|
||||
|
||||
msg "Files saved to $tmpdir"
|
||||
|
1456
config.guess
vendored
Normal file
1456
config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
91
config.sub
vendored
Executable file → Normal file
91
config.sub
vendored
Executable file → Normal file
@ -1,8 +1,8 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2016 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2013-04-24'
|
||||
timestamp='2016-06-20'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -25,7 +25,7 @@ timestamp='2013-04-24'
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
@ -33,7 +33,7 @@ timestamp='2013-04-24'
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
@ -53,8 +53,7 @@ timestamp='2013-04-24'
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION] CPU-MFR-OPSYS
|
||||
$0 [OPTION] ALIAS
|
||||
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
|
||||
|
||||
Canonicalize a configuration name.
|
||||
|
||||
@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
Copyright 1992-2016 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -117,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
@ -255,16 +254,18 @@ case $basic_machine in
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| ba \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
| e2k | epiphany \
|
||||
| fido | fr30 | frv | ft32 \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
@ -282,8 +283,10 @@ case $basic_machine in
|
||||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
@ -295,14 +298,14 @@ case $basic_machine in
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or1k | or32 \
|
||||
| open8 | or1k | or1knd | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
| riscv32 | riscv64 \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
@ -310,6 +313,7 @@ case $basic_machine in
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| visium \
|
||||
| we32k \
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
@ -324,7 +328,10 @@ case $basic_machine in
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||
leon|leon[3-9])
|
||||
basic_machine=sparc-$basic_machine
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
@ -369,18 +376,20 @@ case $basic_machine in
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| ba-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| e2k-* | elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| k1om-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
@ -400,8 +409,10 @@ case $basic_machine in
|
||||
| mips64vr5900-* | mips64vr5900el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
@ -413,16 +424,18 @@ case $basic_machine in
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| or1k*-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pyramid-* \
|
||||
| riscv32-* | riscv64-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile*-* \
|
||||
@ -430,6 +443,7 @@ case $basic_machine in
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| visium-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
@ -506,6 +520,9 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-aros
|
||||
;;
|
||||
asmjs)
|
||||
basic_machine=asmjs-unknown
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
@ -626,6 +643,14 @@ case $basic_machine in
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
e500v[12])
|
||||
basic_machine=powerpc-unknown
|
||||
os=$os"spe"
|
||||
;;
|
||||
e500v[12]-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=$os"spe"
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
@ -767,6 +792,9 @@ case $basic_machine in
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
leon-*|leon[3-9]-*)
|
||||
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
@ -794,7 +822,7 @@ case $basic_machine in
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
@ -822,6 +850,10 @@ case $basic_machine in
|
||||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
moxiebox)
|
||||
basic_machine=moxie-unknown
|
||||
os=-moxiebox
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
@ -830,7 +862,7 @@ case $basic_machine in
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
@ -1354,27 +1386,28 @@ case $os in
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -aos* | -aros* | -cloudabi* | -sortix* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
|
||||
| -onefs* | -tirtos* | -phoenix*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1506,6 +1539,8 @@ case $os in
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-ios)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@ -1546,6 +1581,9 @@ case $basic_machine in
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
@ -1589,9 +1627,6 @@ case $basic_machine in
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or1k-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
|
@ -3,6 +3,26 @@
|
||||
sysconfdir=@sysconfdir@
|
||||
program=${0##*/}
|
||||
|
||||
arch_to_hostspec() {
|
||||
case "$1" in
|
||||
aarch64) echo "aarch64-azaezel-linux-musl" ;;
|
||||
armel) echo "armv5-azaezel-linux-musleabi" ;;
|
||||
armhf) echo "armv6-azaezel-linux-musleabihf" ;;
|
||||
armv7) echo "armv7-azaezel-linux-musleabihf" ;;
|
||||
mips) echo "mips-azaezel-linux-musl" ;;
|
||||
mips64) echo "mips64-azaezel-linux-musl" ;;
|
||||
mipsel) echo "mipsel-azaezel-linux-musl" ;;
|
||||
mips64el) echo "mips64el-azaezel-linux-musl" ;;
|
||||
ppc) echo "powerpc-azaezel-linux-musl" ;;
|
||||
ppc64) echo "powerpc64-azaezel-linux-musl" ;;
|
||||
ppc64le) echo "powerpc64le-azaezel-linux-musl" ;;
|
||||
s390x) echo "s390x-azaezel-linux-musl" ;;
|
||||
x86) echo "i586-azaezel-linux-musl" ;;
|
||||
x86_64) echo "x86_64-azaezel-linux-musl" ;;
|
||||
*) echo "unknown" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
hostspec_to_arch() {
|
||||
case "$1" in
|
||||
aarch64*-*-*-*) echo "aarch64" ;;
|
||||
@ -10,6 +30,14 @@ hostspec_to_arch() {
|
||||
armv6*-*-*-*eabihf) echo "armhf" ;;
|
||||
armv7*-*-*-*eabihf) echo "armv7" ;;
|
||||
i[0-9]86-*-*-*) echo "x86" ;;
|
||||
mips-*-*-*) echo "mips" ;;
|
||||
mips64-*-*-*) echo "mips64" ;;
|
||||
mipsel-*-*-*) echo "mipsel" ;;
|
||||
mips64el-*-*-*) echo "mips64el" ;;
|
||||
powerpc-*-*-*) echo "ppc" ;;
|
||||
powerpc64-*-*-*) echo "ppc64" ;;
|
||||
powerpc64le-*-*-*) echo "ppc64le" ;;
|
||||
s390x-*-*-*) echo "s390x" ;;
|
||||
x86_64-*-*-*) echo "x86_64" ;;
|
||||
*) echo "unknown" ;;
|
||||
esac
|
||||
@ -27,7 +55,7 @@ hostspec_to_libc() {
|
||||
readconfig() {
|
||||
local _APORTSDIR _BUILDDIR _PKGDEST _SRCPKGDEST _REPODEST _SRCDEST
|
||||
local _CARCH _CHOST _CTARGET _CPPFLAGS _CFLAGS _CXXFLAGS _LDFLAGS
|
||||
local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS
|
||||
local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS _USE_CCACHE
|
||||
local gitbase=
|
||||
[ -n "${APORTSDIR+x}" ] && _APORTSDIR=$APORTSDIR
|
||||
[ -n "${BUILDDIR+x}" ] && _BUILDDIR=$BUILDDIR
|
||||
@ -46,21 +74,23 @@ readconfig() {
|
||||
[ -n "${MAKEFLAGS+x}" ] && _MAKEFLAGS=$MAKEFLAGS
|
||||
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
|
||||
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
|
||||
[ -n "${USE_CCACHE+x}" ] && _USE_CCACHE="$USE_CCACHE"
|
||||
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
|
||||
: ${ABUILD_USERDIR:=$HOME/.abuild}
|
||||
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
|
||||
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
||||
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
|
||||
APORTSDIR=${_APORTSDIR-$APORTSDIR}
|
||||
gitbase=$(git rev-parse --show-toplevel 2>/dev/null) # already is -P
|
||||
gitbase=$(git rev-parse --show-toplevel 2>/dev/null) || true # already is -P
|
||||
if [ -d "$APORTSDIR" ]; then
|
||||
APORTSDIR=$(cd "$APORTSDIR"; pwd -P)
|
||||
elif [ -z "$APORTSDIR" ] && [ -d "$HOME/aports" ]; then
|
||||
APORTSDIR=$(cd "$HOME/aports"; pwd -P)
|
||||
else
|
||||
if [ -n "$gitbase" ]; then
|
||||
case $(git config remote.origin.url) in
|
||||
*/aports) APORTSDIR=$gitbase ;;
|
||||
case $(git remote get-url origin) in
|
||||
# '.git' for SSH URLs, and no suffix for HTTPS URLs
|
||||
*/aports|*/aports.git) APORTSDIR=$gitbase ;;
|
||||
*) APORTSDIR= ;;
|
||||
esac
|
||||
else
|
||||
@ -85,15 +115,57 @@ readconfig() {
|
||||
MAKEFLAGS=${_MAKEFLAGS-$MAKEFLAGS}
|
||||
PACKAGER=${_PACKAGER-$PACKAGER}
|
||||
USE_COLORS=${_USE_COLORS-$USE_COLORS}
|
||||
USE_CCACHE=${_USE_CCACHE-$USE_CCACHE}
|
||||
|
||||
[ -z "$CBUILD" ] && CBUILD="$(gcc -dumpmachine)"
|
||||
[ -z "$CBUILD" ] && CBUILD="$(${APK:-apk} --print-arch 2>/dev/null)"
|
||||
[ -z "$CHOST" ] && CHOST="$CBUILD"
|
||||
[ -z "$CTARGET" ] && CTARGET="$CHOST"
|
||||
[ "$(arch_to_hostspec $CBUILD)" != "unknown" ] && CBUILD="$(arch_to_hostspec $CBUILD)"
|
||||
[ "$(arch_to_hostspec $CHOST)" != "unknown" ] && CHOST="$(arch_to_hostspec $CHOST)"
|
||||
[ "$(arch_to_hostspec $CTARGET)" != "unknown" ] && CTARGET="$(arch_to_hostspec $CTARGET)"
|
||||
if [ -z "$CBUILD" ]; then
|
||||
echo "Unable to deduce build architecture. Install apk-tools, or set CBUILD."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -z "$CARCH" ] && CARCH="$(hostspec_to_arch $CHOST)"
|
||||
[ -z "$CLIBC" ] && CLIBC="$(hostspec_to_libc $CHOST)"
|
||||
[ -z "$CBUILD_ARCH" ] && CBUILD_ARCH="$(hostspec_to_arch $CBUILD)"
|
||||
[ -z "$CTARGET_ARCH" ] && CTARGET_ARCH="$(hostspec_to_arch $CTARGET)"
|
||||
[ -z "$CTARGET_LIBC" ] && CTARGET_LIBC="$(hostspec_to_libc $CTARGET)"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# setup environment for creating cross compiler
|
||||
[ -z "$CBUILDROOT" ] && export CBUILDROOT="$HOME/sysroot-$CTARGET_ARCH/"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# setup build root
|
||||
[ -z "$CBUILDROOT" ] && export CBUILDROOT="$HOME/sysroot-$CTARGET_ARCH/"
|
||||
# prepare pkg-config for cross building
|
||||
[ -z "$PKG_CONFIG_PATH" ] && export PKG_CONFIG_PATH="${CBUILDROOT}/usr/lib/pkgconfig/"
|
||||
[ -z "$PKG_CONFIG_SYSROOT_DIR" ] && export PKG_CONFIG_SYSROOT_DIR="${CBUILDROOT}"
|
||||
# libtool bug workaround for extra rpaths
|
||||
[ -z "$lt_cv_sys_lib_dlsearch_path_spec" ] && \
|
||||
export lt_cv_sys_lib_dlsearch_path_spec="${CBUILDROOT}/lib ${CBUILDROOT}/usr/lib /usr/lib /lib /usr/local/lib"
|
||||
# setup cross-compiler
|
||||
if [ -z "$CROSS_COMPILE" ]; then
|
||||
export CROSS_COMPILE="${CHOST}-"
|
||||
export HOSTCC="$CC"
|
||||
export HOSTCXX="$CXX"
|
||||
export HOSTLD="$LD"
|
||||
export HOSTCPPFLAGS="$CPPFLAGS"
|
||||
export HOSTCXXFLAGS="$CXXFLAGS"
|
||||
export HOSTCFLAGS="$CFLAGS"
|
||||
export HOSTLDFLAGS="$LDFLAGS"
|
||||
export CC=${CROSS_COMPILE}gcc
|
||||
export CXX=${CROSS_COMPILE}g++
|
||||
export LD=${CROSS_COMPILE}ld
|
||||
export CPPFLAGS="--sysroot=${CBUILDROOT} $CPPFLAGS"
|
||||
export CXXFLAGS="--sysroot=${CBUILDROOT} $CXXFLAGS"
|
||||
export CFLAGS="--sysroot=${CBUILDROOT} $CFLAGS"
|
||||
export LDFLAGS="--sysroot=${CBUILDROOT} $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
readconfig
|
||||
|
||||
@ -178,7 +250,9 @@ enable_colors() {
|
||||
BLUE="\033[1;34m"
|
||||
}
|
||||
|
||||
if [ -n "$USE_COLORS" ] && [ -t 1 ]; then
|
||||
if [ "$USE_COLORS" = force ]; then
|
||||
enable_colors
|
||||
elif [ -n "$USE_COLORS" ] && [ -t 1 ]; then
|
||||
enable_colors
|
||||
else
|
||||
disable_colors
|
||||
|
175
newapkbuild.1
Normal file
175
newapkbuild.1
Normal file
@ -0,0 +1,175 @@
|
||||
.Dd November 4, 2017
|
||||
.Dt NEWAPKBUILD 1 PRM
|
||||
.Os "Alpine Linux"
|
||||
.Sh NAME
|
||||
.Nm newapkbuild
|
||||
.Nd generate a new APKBUILD
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl n Ar NAME
|
||||
.Op Fl d Ar DESC
|
||||
.Op Fl l Ar LICENSE
|
||||
.Op Fl u Ar URL
|
||||
.Op Fl aCmpy
|
||||
.Op Fl cfhs
|
||||
.Op Ar pkgname Op Ar -pkgver
|
||||
.Nm
|
||||
.Op Fl n Ar NAME
|
||||
.Op Fl d Ar DESC
|
||||
.Op Fl l Ar LICENSE
|
||||
.Op Fl u Ar URL
|
||||
.Op Fl aCmpy
|
||||
.Op Fl cfhs
|
||||
.Op Ar source_url
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
generates a new APKBUILD for use with
|
||||
.Xr abuild 1 .
|
||||
.Bl -tag -width "pkgname-pkgver" -offset indent -compact
|
||||
.It Fl n Ar NAME
|
||||
Specifies the name of the new package.
|
||||
A new directory called
|
||||
.Ar NAME
|
||||
will be created in the current directory, with the APKBUILD file.
|
||||
.It Fl d Ar DESC
|
||||
Specifies the description (pkgdesc=) for the new package.
|
||||
.It Fl l Ar LICENSE
|
||||
Specifies the license under which the new package is distributed.
|
||||
This should match an SPDX Identifier.
|
||||
.It Fl u Ar URL
|
||||
Specifies the Web page (url=) for the new package.
|
||||
This should
|
||||
.Em not
|
||||
be the source package URL; it should be the project's main Web page.
|
||||
.It Fl c
|
||||
Causes
|
||||
.Nm
|
||||
to additionally copy an init.d script, conf.d file, and sample pre- and post-
|
||||
install scripts to the APKBUILD directory.
|
||||
This allows you to have a quick start for daemon packages.
|
||||
.It Fl f
|
||||
Forces
|
||||
.Nm
|
||||
to overwrite an existing APKBUILD, if one already exists in the package
|
||||
directory.
|
||||
.It Fl h
|
||||
Displays usage information.
|
||||
.It Fl s
|
||||
Create an automatic SourceForge URL for the package based on its name and
|
||||
version.
|
||||
This is only valid if
|
||||
.Ar pkgname-pkgver
|
||||
is specified on the command line.
|
||||
.It Ar pkgname-pkgver
|
||||
Specify the package name, if not already specified by
|
||||
.Fl n .
|
||||
If followed by a dash (-) and a valid version string, additionally specify the
|
||||
package's version.
|
||||
.El
|
||||
.Ss Build system type
|
||||
.Nm
|
||||
will try to automatically detect the build system by inspecting the source
|
||||
directory if
|
||||
.Ar source_url
|
||||
is specified, and write out typical build instructions for that build system.
|
||||
If you do not specify the source URL, or you want to override auto-detection,
|
||||
you may specify one of the following four flags:
|
||||
.Bl -tag -width "-a" -offset indent -compact
|
||||
.It Fl a
|
||||
Specifies that the package uses autotools.
|
||||
The APKBUILD will contain a typical invocation of ./configure, make, and make
|
||||
install.
|
||||
.It Fl C
|
||||
Specifies that the package uses CMake.
|
||||
CMake will be added to the makedepends and a typical CMake invocation will be
|
||||
added to the APKBUILD.
|
||||
.It Fl m
|
||||
Specifies that the package uses Meson.
|
||||
A typical Meson and Ninja invocation will be added to the APKBUILD.
|
||||
.It Fl p
|
||||
Specifies that the package uses a Perl Makefile.PL file.
|
||||
The CPAN template will be used.
|
||||
.It Fl y
|
||||
Specifies that the package uses a Python setup.py build system.
|
||||
Python will be added to the makedepends.
|
||||
.El
|
||||
If you do not specify any option, and you do not specify the source URL, the
|
||||
generated APKBUILD file will not contain any build instructions.
|
||||
.Sh FILES
|
||||
All files generated will be placed in a
|
||||
.Pa pkgname
|
||||
directory inside the current working directory, with
|
||||
.Pa pkgname
|
||||
being created if it does not exist.
|
||||
.Bl -tag -width "pkgname.post-install" -compact
|
||||
.It Pa APKBUILD
|
||||
.Nm
|
||||
will create
|
||||
.Pa APKBUILD
|
||||
with the details gathered from the invocation of
|
||||
.Nm ,
|
||||
and introspection of the downloaded package source if
|
||||
.Ar source_url
|
||||
is provided.
|
||||
For more information about APKBUILD and its format, see
|
||||
.Xr APKBUILD 5 .
|
||||
.It Pa pkgname.initd
|
||||
If
|
||||
.Fl c
|
||||
is given,
|
||||
.Nm
|
||||
will create
|
||||
.Pa pkgname.initd
|
||||
with example data to assist in the creation of an init.d script for a daemon.
|
||||
.It Pa pkgname.confd
|
||||
If
|
||||
.Fl c
|
||||
is given,
|
||||
.Nm
|
||||
will create
|
||||
.Pa pkgname.confd
|
||||
to assist in the creation of a conf.d file for a daemon, used by init.d
|
||||
scripts.
|
||||
conf.d files are used to configure init.d scripts; for more information, see
|
||||
.Xr openrc 8
|
||||
and
|
||||
.Xr rc_config 3 .
|
||||
.It Pa pkgname.pre-install
|
||||
If
|
||||
.Fl c
|
||||
is given,
|
||||
.Nm
|
||||
will create
|
||||
.Pa pkgname.pre-install ,
|
||||
the contents of which will be run by
|
||||
.Xr apk 8
|
||||
before the package is installed.
|
||||
.It Pa pkgname.post-install
|
||||
If
|
||||
.Fl c
|
||||
is given,
|
||||
.Nm
|
||||
will create
|
||||
.Pa pkgname.post-install ,
|
||||
the contents of which will be run by
|
||||
.Xr apk 8
|
||||
after the package is successfully installed.
|
||||
For more information about apk install hooks, consult the
|
||||
.Xr apk 8
|
||||
manual.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
newapkbuild -n sharutils -d "Utilities for manipulating shell archives" \\
|
||||
-l "GPL-3.0+" -u "https://www.gnu.org/software/sharutils/" -a \\
|
||||
https://ftp.gnu.org/gnu/sharutils/sharutils-4.15.2.tar.xz
|
||||
.Sh SEE ALSO
|
||||
SPDX license reference (on the Web at <https://spdx.org/licenses/>),
|
||||
.Xr abuild 1 ,
|
||||
.Xr apk 8 ,
|
||||
.Xr APKBUILD 5 .
|
||||
.Sh AUTHORS
|
||||
.Nm :
|
||||
.An Natanael Copa Aq Mt ncopa@alpinelinux.org
|
||||
.Pp
|
||||
Documentation:
|
||||
.An A. Wilcox Aq Mt awilfox@adelielinux.org
|
310
newapkbuild.in
310
newapkbuild.in
@ -7,13 +7,13 @@
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
datadir=@datadir@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
|
||||
if ! [ -f "$datadir/functions.sh" ]; then
|
||||
echo "$datadir/functions.sh: not found" >&2
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
. "$datadir/functions.sh"
|
||||
. "$sharedir/functions.sh"
|
||||
|
||||
|
||||
is_url() {
|
||||
@ -33,7 +33,7 @@ is_github_url() {
|
||||
# Build sections
|
||||
build_make() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make || return 1
|
||||
make
|
||||
__EOF__
|
||||
}
|
||||
|
||||
@ -45,9 +45,8 @@ build_autotools() {
|
||||
--prefix=/usr \\
|
||||
--sysconfdir=/etc \\
|
||||
--mandir=/usr/share/man \\
|
||||
--localstatedir=/var \\
|
||||
|| return 1
|
||||
make || return 1
|
||||
--localstatedir=/var
|
||||
make
|
||||
__EOF__
|
||||
}
|
||||
|
||||
@ -58,42 +57,114 @@ build_cmake() {
|
||||
# This is incomplete: CMAKE_{HOST_,}SYSTEM_PROCESSOR needs to be set,
|
||||
# and likewise CMAKE_FIND_ROOT_PATH and a few other details.
|
||||
|
||||
sed -i -e 's/^\(makedepends="\)/\1cmake /' APKBUILD
|
||||
cat >>APKBUILD<<__EOF__
|
||||
if [ "$CBUILD" != "$CHOST" ]
|
||||
then
|
||||
if [ "\$CBUILD" != "\$CHOST" ]; then
|
||||
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
|
||||
fi
|
||||
cmake \\
|
||||
cmake -B build \\
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \\
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \\
|
||||
-DBUILD_SHARED_LIBS=True \\
|
||||
-DCMAKE_BUILD_TYPE=Release \\
|
||||
-DCMAKE_BUILD_TYPE=None \\
|
||||
-DCMAKE_CXX_FLAGS="\$CXXFLAGS" \\
|
||||
-DCMAKE_C_FLAGS="\$CFLAGS" \\
|
||||
${CMAKE_CROSSOPTS} \\
|
||||
|| return 1
|
||||
make || return 1
|
||||
\${CMAKE_CROSSOPTS} .
|
||||
make -C build
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_meson() {
|
||||
# References:
|
||||
# http://mesonbuild.com/Reference-manual.html
|
||||
# http://mesonbuild.com/Cross-compilation.html
|
||||
# TODO For cross compilation a cross_file needs to be created.
|
||||
|
||||
cat >>APKBUILD<<__EOF__
|
||||
meson \\
|
||||
--prefix=/usr \\
|
||||
--sysconfdir=/etc \\
|
||||
--mandir=/usr/share/man \\
|
||||
--localstatedir=/var \\
|
||||
--buildtype=plain \\
|
||||
. output
|
||||
ninja -C output
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_perl() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
|
||||
make || return 1
|
||||
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
|
||||
make
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_python() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
python setup.py build || return 1
|
||||
python3 setup.py build
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_rust() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
cargo build --release --locked
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper build command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
# Check sections
|
||||
check_make() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make check
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_cmake() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
CTEST_OUTPUT_ON_FAILURE=1 make -C build check
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_python() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
python3 setup.py test
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper check command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_meson() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
ninja -C output test
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_rust() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
cargo test --release
|
||||
__EOF__
|
||||
}
|
||||
|
||||
# Package sections
|
||||
package_make() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make DESTDIR="\$pkgdir" install || return 1
|
||||
make DESTDIR="\$pkgdir" install
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_cmake() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make -C build DESTDIR="\$pkgdir" install
|
||||
__EOF__
|
||||
}
|
||||
|
||||
@ -101,16 +172,36 @@ package_autotools() {
|
||||
package_make
|
||||
}
|
||||
|
||||
package_meson() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
DESTDIR="\$pkgdir" ninja -C output install
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_perl() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make DESTDIR="\$pkgdir" install || return 1
|
||||
make DESTDIR="\$pkgdir" install
|
||||
find "\$pkgdir" \\( -name perllocal.pod -o -name .packlist \\) -delete
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_python() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
python setup.py install --prefix=/usr --root="\$pkgdir" || return 1
|
||||
python3 setup.py install --prefix=/usr --root="\$pkgdir"
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper package command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_rust() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
cargo install --path . --root="\$pkgdir/usr"
|
||||
rm "\$pkgdir"/usr/.crates.toml
|
||||
__EOF__
|
||||
}
|
||||
|
||||
@ -129,7 +220,7 @@ newaport() {
|
||||
fi
|
||||
pv=${newname%.t*} #strip .tar.gz .tgz .tar.bz2 etc
|
||||
pv=${pv#*[a-z]}
|
||||
source="$pkgname-$pv.tar.gz::$source"
|
||||
source="${source%.t*}/$pkgname-$pv.tar.gz"
|
||||
elif [ "$pn" != "$newname" ]; then
|
||||
pv=${newname#$pn-}
|
||||
pv=${pv%.t*} #strip .tar.gz .tgz .tar.bz2 etc
|
||||
@ -138,25 +229,27 @@ newaport() {
|
||||
pkgname=$pn
|
||||
fi
|
||||
if [ -e "$pkgname"/APKBUILD ] && [ -z "$force" ]; then
|
||||
error "$pkgname/APKBUILD already exist"
|
||||
error "$pkgname/APKBUILD already exists"
|
||||
return 1
|
||||
fi
|
||||
mkdir -p "$pkgname"
|
||||
cd "$pkgname"
|
||||
|
||||
if [ -z "$source" ] && [ -n "$sourceforge" ]; then
|
||||
source="http://downloads.sourceforge.net/$pn/$pn-$pv.tar.gz"
|
||||
source="https://downloads.sourceforge.net/$pn/$pn-$pv.tar.gz"
|
||||
fi
|
||||
|
||||
if [ -z "$depends" ] &&[ "$buildtype" = "python" ]; then
|
||||
depends="python"
|
||||
depends="python3"
|
||||
fi
|
||||
|
||||
if [ -z "$makedepends" ] &&[ "$buildtype" = "python" ]; then
|
||||
makedepends="python-dev"
|
||||
else
|
||||
makedepends="\$depends_dev"
|
||||
fi
|
||||
case "$buildtype" in
|
||||
python) makedepends="py3-setuptools";;
|
||||
cmake) makedepends="cmake";;
|
||||
meson) makedepends="meson";;
|
||||
rust) makedepends="cargo";;
|
||||
*) makedepends="\$depends_dev";;
|
||||
esac
|
||||
|
||||
# Replace pkgver in $source
|
||||
if [ -n "$source" ]; then
|
||||
@ -165,10 +258,10 @@ newaport() {
|
||||
|
||||
# Copy init.d scripts if requested
|
||||
if [ -n "$cpinitd" ]; then
|
||||
cp "$datadir"/sample.initd $pkgname.initd
|
||||
cp "$datadir"/sample.confd $pkgname.confd
|
||||
cp "$datadir"/sample.pre-install $pkgname.pre-install
|
||||
cp "$datadir"/sample.post-install $pkgname.post-install
|
||||
cp "$sharedir"/sample.initd $pkgname.initd
|
||||
cp "$sharedir"/sample.confd $pkgname.confd
|
||||
cp "$sharedir"/sample.pre-install $pkgname.pre-install
|
||||
cp "$sharedir"/sample.post-install $pkgname.post-install
|
||||
install="\$pkgname.pre-install \$pkgname.post-install"
|
||||
source="$source
|
||||
$pkgname.initd
|
||||
@ -180,8 +273,8 @@ newaport() {
|
||||
cat >APKBUILD<<__EOF__
|
||||
# Contributor:${PACKAGER:+" "}${PACKAGER}
|
||||
# Maintainer:${MAINTAINER:+" "}${MAINTAINER}
|
||||
pkgname=$pkgname
|
||||
pkgver=$pv
|
||||
pkgname="$pkgname"
|
||||
pkgver="$pv"
|
||||
pkgrel=0
|
||||
pkgdesc="$pkgdesc"
|
||||
url="$url"
|
||||
@ -195,7 +288,7 @@ subpackages="\$pkgname-dev \$pkgname-doc"
|
||||
source="$source"
|
||||
__EOF__
|
||||
|
||||
abuild -f fetch unpack
|
||||
abuild -f fetch checksum unpack
|
||||
# Figure out the builddir
|
||||
for i in src/*; do
|
||||
if [ -d "$i" ]; then
|
||||
@ -211,7 +304,7 @@ __EOF__
|
||||
| head -n 1 | grep -q ".*" \
|
||||
|| sed -i -e '/^depends_dev=.*/d' -e 's/\$depends_dev\s*//' APKBUILD
|
||||
|
||||
# Check if its autotools
|
||||
# Try to autodetect the buildtype
|
||||
if [ -z "$buildtype" ]; then
|
||||
if [ -x "$sdir"/configure ]; then
|
||||
buildtype="autotools"
|
||||
@ -219,19 +312,22 @@ __EOF__
|
||||
buildtype="perl"
|
||||
elif [ -r "$sdir"/waf ]; then
|
||||
buildtype="waf"
|
||||
elif [ -d "$sdir"/cmake ]; then
|
||||
elif [ -r "$sdir"/meson.build ]; then
|
||||
buildtype="meson"
|
||||
elif [ -d "$sdir"/cmake ] || [ -r "$sdir/CMakeLists.txt" ]; then
|
||||
buildtype="cmake"
|
||||
elif [ -r "$sdir"/Makefile ]; then
|
||||
buildtype="make"
|
||||
elif [ -r "$sdir"/setup.py ]; then
|
||||
buildtype="python"
|
||||
elif [ -r "$sdir"/Cargo.toml ]; then
|
||||
buildtype="rust"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create build() function
|
||||
cat >>APKBUILD<<__EOF__
|
||||
build() {
|
||||
cd "\$builddir"
|
||||
__EOF__
|
||||
|
||||
case "$buildtype" in
|
||||
@ -239,12 +335,41 @@ __EOF__
|
||||
build_make;;
|
||||
cmake)
|
||||
build_cmake;;
|
||||
meson)
|
||||
build_meson;;
|
||||
autotools)
|
||||
build_autotools;;
|
||||
perl)
|
||||
build_perl;;
|
||||
python)
|
||||
build_python;;
|
||||
rust)
|
||||
build_rust;;
|
||||
*)
|
||||
build_empty;;
|
||||
esac
|
||||
|
||||
cat >>APKBUILD<<__EOF__
|
||||
}
|
||||
|
||||
__EOF__
|
||||
|
||||
# Create check() function
|
||||
cat >>APKBUILD<<__EOF__
|
||||
check() {
|
||||
__EOF__
|
||||
|
||||
case "$buildtype" in
|
||||
make|autotools|perl)
|
||||
check_make;;
|
||||
cmake)
|
||||
check_cmake;;
|
||||
python)
|
||||
check_python;;
|
||||
rust)
|
||||
check_rust;;
|
||||
*)
|
||||
check_empty;;
|
||||
esac
|
||||
|
||||
cat >>APKBUILD<<__EOF__
|
||||
@ -255,78 +380,117 @@ __EOF__
|
||||
# Create package() function
|
||||
cat >>APKBUILD<<__EOF__
|
||||
package() {
|
||||
cd "\$builddir"
|
||||
__EOF__
|
||||
|
||||
case "$buildtype" in
|
||||
make)
|
||||
package_make;;
|
||||
cmake)
|
||||
package_cmake;;
|
||||
autotools)
|
||||
package_autotools;;
|
||||
meson)
|
||||
package_meson;;
|
||||
perl)
|
||||
package_perl;;
|
||||
python)
|
||||
package_python;;
|
||||
rust)
|
||||
package_rust;;
|
||||
*)
|
||||
package_empty;;
|
||||
esac
|
||||
|
||||
if [ -n "$cpinitd" ]; then
|
||||
cat >>APKBUILD<<__EOF__
|
||||
|
||||
install -m755 -D "\$srcdir"/\$pkgname.initd \\
|
||||
"\$pkgdir"/etc/init.d/\$pkgname || return 1
|
||||
"\$pkgdir"/etc/init.d/\$pkgname
|
||||
install -m644 -D "\$srcdir"/\$pkgname.confd \\
|
||||
"\$pkgdir"/etc/conf.d/\$pkgname || return 1
|
||||
"\$pkgdir"/etc/conf.d/\$pkgname
|
||||
__EOF__
|
||||
fi
|
||||
cat >>APKBUILD<<__EOF__
|
||||
}
|
||||
|
||||
__EOF__
|
||||
|
||||
# regenerate checksum so they end last in APKBUILD
|
||||
abuild -f checksum
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat >&2 <<__EOF__
|
||||
$program $program_version - generate a new APKBUILD
|
||||
Usage: $program [-cfh] [-d DESC] [-l LICENSE] [-n NAME] [-u URL]
|
||||
PKGNAME[-PKGVER]|SRCURL
|
||||
Options:
|
||||
-n Set package name to NAME
|
||||
-d Set package description (pkgdesc) to DESC
|
||||
-l Set package license to LICENSE
|
||||
-u Set package URL
|
||||
-a Create autotools (use ./configure ...)
|
||||
-C Create CMake pakckage (Assume cmake/ is there)
|
||||
-p Create perl package (Assume Makefile.PL is there)
|
||||
-y Create python package (Assume setup.py is there)
|
||||
-s Use sourceforge source URL
|
||||
-c Copy a sample init.d, conf.d, and install script to new directory
|
||||
-f Force even if directory already exist
|
||||
-h Show this help
|
||||
|
||||
__EOF__
|
||||
cat >&2 <<-__EOF__
|
||||
$program $program_version - generate a new APKBUILD
|
||||
Usage: $program [-n PKGNAME] [-d PKGDESC] [-l LICENSE] [-u URL]
|
||||
[-a | -C | -m | -p | -y | -r] [-s] [-c] [-f] [-h]
|
||||
PKGNAME[-PKGVER] | SRCURL
|
||||
Options:
|
||||
-n Set package name to PKGNAME (only use with SRCURL)
|
||||
-d Set package description to PKGDESC
|
||||
-l Set package license to LICENSE, use identifiers from:
|
||||
<https://spdx.org/licenses/>
|
||||
-u Set package URL
|
||||
-a Create autotools package (use ./configure ...)
|
||||
-C Create CMake package (Assume cmake/ is there)
|
||||
-m Create meson package (Assume meson.build is there)
|
||||
-p Create perl package (Assume Makefile.PL is there)
|
||||
-y Create python package (Assume setup.py is there)
|
||||
-r Crate rust package (Assume Cargo.toml is there)
|
||||
-s Use sourceforge source URL
|
||||
-c Copy a sample init.d, conf.d, and install script
|
||||
-f Force even if directory already exists
|
||||
-h Show this help
|
||||
__EOF__
|
||||
}
|
||||
|
||||
while getopts "acd:fhl:n:pyu:s" opt; do
|
||||
set_buildtype() {
|
||||
if [ -n "$buildtype" ]; then
|
||||
error "More than one buildtype flag specified ($buildtype and $1)"
|
||||
exit 1
|
||||
fi
|
||||
buildtype="$1"
|
||||
}
|
||||
|
||||
check_arguments() {
|
||||
if [ $# -eq 0 ]; then
|
||||
error "Missing required argument: PKGNAME[-PKGVER] | SRCURL"
|
||||
exit 1
|
||||
fi
|
||||
if [ $# -gt 1 ]; then
|
||||
shift
|
||||
error "Unrecognized arguments: $*"
|
||||
exit 1
|
||||
fi
|
||||
if ! is_url "$1" && [ -n "$pkgname" ]; then
|
||||
error "-n is only allowed when using SRCURL as last argument"
|
||||
exit 1
|
||||
fi
|
||||
if is_url "$1" && [ -n "$sourceforge" ]; then
|
||||
error "-s is only allowed when using PKGNAME as last argument"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "acCmd:fhl:n:pyu:sr" opt; do
|
||||
case $opt in
|
||||
'a') buildtype="autotools";;
|
||||
'a') set_buildtype "autotools";;
|
||||
'c') cpinitd=1;;
|
||||
'C') buildtype="cmake";;
|
||||
'C') set_buildtype "cmake";;
|
||||
'm') set_buildtype "meson";;
|
||||
'd') pkgdesc="$OPTARG";;
|
||||
'f') force=1;;
|
||||
'h') usage; exit;;
|
||||
'l') license="$OPTARG";;
|
||||
'n') pkgname="$OPTARG";;
|
||||
'p') buildtype="perl";;
|
||||
'y') buildtype="python";;
|
||||
'p') set_buildtype "perl";;
|
||||
'y') set_buildtype "python";;
|
||||
'r') set_buildtype "rust";;
|
||||
'u') url="$OPTARG";;
|
||||
's') sourceforge=1;;
|
||||
esac
|
||||
done
|
||||
shift $(( $OPTIND - 1 ))
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
newaport $1 || exit 1
|
||||
shift
|
||||
done
|
||||
|
||||
check_arguments "$@"
|
||||
newaport $1
|
||||
|
@ -17,7 +17,7 @@ depends_dev=
|
||||
makedepends="$depends_dev"
|
||||
install=
|
||||
subpackages="$pkgname-dev $pkgname-doc"
|
||||
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
|
||||
source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
|
||||
|
||||
builddir="$srcdir"/$pkgname-$pkgver
|
||||
|
||||
@ -31,16 +31,23 @@ build() {
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info
|
||||
make || return 1
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make DESTDIR="$pkgdir" install || return 1
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
# remove the 2 lines below (and this) if there is no init.d script
|
||||
# install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
|
||||
# install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
|
||||
}
|
||||
|
||||
check() {
|
||||
# uncomment the 2 lines below if there is a testsuite. we assume the testsuite
|
||||
# is run using "make check", which is the default for autotools-based build systems.
|
||||
# cd "$builddir"
|
||||
# make check
|
||||
}
|
||||
|
||||
md5sums="" #generate with 'abuild checksum'
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
# add something which happends after install
|
||||
# add something which happens after install
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
# add something which happends before install
|
||||
# add something which happens before install
|
||||
|
||||
|
12
tests/abuild.bats
Normal file
12
tests/abuild.bats
Normal file
@ -0,0 +1,12 @@
|
||||
setup() {
|
||||
export ABUILD=../abuild
|
||||
export ABUILD_SHAREDIR=$PWD/..
|
||||
}
|
||||
|
||||
@test "help text" {
|
||||
$ABUILD -h
|
||||
}
|
||||
|
||||
@test "version string" {
|
||||
$ABUILD -V
|
||||
}
|
11
tests/functions.bats
Normal file
11
tests/functions.bats
Normal file
@ -0,0 +1,11 @@
|
||||
setup() {
|
||||
export FUNCS=../functions.sh
|
||||
}
|
||||
|
||||
@test "check if CBUILD is set" {
|
||||
. $FUNCS && test -n "$CBUILD"
|
||||
}
|
||||
|
||||
@test "check that missing gcc does not kill us" {
|
||||
sh -e -c "CC=false; . $FUNCS && test -z \"$CBUILD\""
|
||||
}
|
34
tests/testrepo/pkg1/APKBUILD
Normal file
34
tests/testrepo/pkg1/APKBUILD
Normal file
@ -0,0 +1,34 @@
|
||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||
|
||||
# test package
|
||||
pkgname="pkg1"
|
||||
pkgver="1.0"
|
||||
pkgrel=0
|
||||
pkgdesc="Dummy test package"
|
||||
url="https://gitlab.alpinelinux.org/alpine/aports"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
subpackages="$pkgname-dev $pkgname-doc"
|
||||
source=""
|
||||
builddir="$srcdir/pkg1-1.0"
|
||||
|
||||
prepare() {
|
||||
mkdir -p "$builddir"
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p usr/include usr/bin usr/share/man/man1
|
||||
touch usr/include/$pkgname.h
|
||||
touch usr/bin/$pkgname
|
||||
touch usr/share/man/man1/$pkgname.1
|
||||
}
|
||||
|
||||
check() {
|
||||
true
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"
|
||||
cp -r * "$pkgdir"/
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user