Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
abuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
abuild
Commits
e4a3c05d
Commit
e4a3c05d
authored
Nov 08, 2008
by
Linux User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better messages. always run fetch before checksum.
parent
ddb0b05f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
abuild
abuild
+21
-9
No files found.
abuild
View file @
e4a3c05d
...
...
@@ -27,9 +27,9 @@ default_cmds="sanitycheck builddeps clean fetch md5check unpack rootpkg"
# functions
msg
()
{
local
sub
=
[
-n
"
$subpkgname
"
]
&&
sub
=
" (
$pkgname
)
"
[
-z
"
$quiet
"
]
&&
echo
">>>
${
subpkgname
:-
$pkgname
}
$sub
:"
"
$@
"
>
&2
local
fake
=
"
${
FAKEROOTKEY
:+
(fakeroot)
}
"
local
name
=
"
${
subpkgname
:-
$pkgname
}
"
[
-z
"
$quiet
"
]
&&
echo
">>>
${
fake
}${
name
}
:"
"
$@
"
>
&2
}
warning
()
{
...
...
@@ -44,6 +44,7 @@ die() {
# check if apkbuild is basicly sane
sanitycheck
()
{
msg
"Checking sanity of
$APKBUILD
..."
[
-z
"
$pkgname
"
]
&&
die
"Missing pkgname in APKBUILD"
[
-z
"
${
pkgname
##* *
}
"
]
&&
die
"pkgname contains spaces"
[
-z
"
$pkgver
"
]
&&
die
"Missing pkgver in APKBUILD"
...
...
@@ -61,7 +62,6 @@ sanitycheck() {
# common spelling errors
[
-n
"
$depend
"
]
&&
die
"APKBUILD contains 'depend'. It should be depends"
[
-n
"
$makedepend
"
]
&&
die
"APKBUILD contains 'makedepend'. It should be makedepends"
return
0
}
...
...
@@ -76,6 +76,7 @@ md5check() {
if
[
"
$(
echo
$source
|
wc
-l
)
"
-ne
"
$(
echo
$md5sums
|
wc
-l
)
"
]
;
then
die
"Number of md5sums does not correspond to number of sources"
fi
msg
"Checking md5sums..."
cd
"
$srcdir
"
&&
echo
"
$md5sums
"
|
md5sum
-c
}
...
...
@@ -120,8 +121,10 @@ unpack() {
local
s
=
"
$SRCDEST
/
${
u
##*/
}
"
# $(basename $s)
case
"
$s
"
in
*
.tar.gz|
*
.tgz
)
msg
"Unpacking
$s
..."
tar
-C
"
$srcdir
"
-zxf
"
$s
"
||
return
1
;;
*
.tar.bz2
)
msg
"Unpacking
$s
..."
tar
-C
"
$srcdir
"
-jxf
"
$s
"
||
return
1
;;
esac
done
...
...
@@ -129,6 +132,7 @@ unpack() {
# cleanup source and package dir
clean
()
{
msg
"Cleaning temporary build dirs..."
rm
-rf
"
$srcdir
"
rm
-rf
"
$pkgdir
"
local
i
...
...
@@ -142,14 +146,16 @@ cleancache() {
local
s
for
s
in
$source
;
do
case
"
$s
"
in
http:/
*
|
ftp:/
*
)
rm
-f
"
$SRCDEST
/
$(
basename
$s
)
"
;;
http://
*
|
ftp://
*
)
msg
"Cleaning downloaded
${
s
##*/
}
..."
rm
-f
"
$SRCDEST
/
${
s
##*/
}
"
;;
esac
done
}
cleanpkg
()
{
local
i
msg
"Cleaning built packages..."
for
i
in
$pkgname
$subpackages
;
do
local
p
=
"
$i
-
$pkgver
-
$pkgrel
"
rm
-f
"
$PKGDEST
/
$p
.apk"
"
$PKGDEST
/
$p
.src.tar.gz"
...
...
@@ -158,7 +164,7 @@ cleanpkg() {
runpart
()
{
local
part
=
$1
msg
"
$part
"
[
-n
"
$DEBUG
"
]
&&
msg
"
$part
"
$part
||
die
"
$part
failed"
}
...
...
@@ -185,6 +191,7 @@ subpkg() {
for
i
in
$subpackages
;
do
local
func
=
$(
get_split_func
$i
)
# call abuild recursively, setting subpkg{dir,name}
msg
"Running split function
$func
..."
subpkgdir
=
"
$startdir
/pkg-
$func
"
subpkgname
=
"
$i
"
\
$0
$func
package
||
return
1
done
...
...
@@ -195,10 +202,11 @@ package_apk() {
[
-z
"
${
name
##* *
}
"
]
&&
die
"package name contains spaces"
local dir
=
${
subpkgdir
:-
$pkgdir
}
local
pkg
=
"
$name
-
$pkgver
-r
$pkgrel
.apk"
local
sub
[
!
-d
"
$dir
"
]
&&
die
"Missing
$dir
"
cd
"
$dir
"
msg
"Creating
$
pkg
"
msg
"Creating
$
{
subpkgname
:+sub
}
package
$pkg
...
"
local
builddate
=
$(
date
-u
"+%s"
)
local
size
=
$(
du
-sk
|
awk
'{print $1 * 1024}'
)
...
...
@@ -304,6 +312,7 @@ dev() {
# build and package in fakeroot
rootpkg
()
{
cd
"
$startdir
"
msg
"Entering fakeroot..."
fakeroot
$0
build subpkg package
}
...
...
@@ -315,6 +324,7 @@ srcpkg() {
files
=
"
$files
$prefix
/
${
i
##*/
}
"
done
mkdir
-p
"
$PKGDEST
"
msg
"Creating source package
$p
.src.tar.gz..."
(
cd
..
&&
tar
-zcf
"
$PKGDEST
/
$p
.src.tar.gz"
$files
)
}
...
...
@@ -336,6 +346,7 @@ up2date() {
# note: this must run in a subshell
find_aport
()
{
local
i
msg
"Searching for
$1
in aports tree..."
cd
../..
for
i
in
*
/
*
/APKBUILD
;
do
.
$i
...
...
@@ -359,7 +370,7 @@ builddeps() {
# sudo apk_add $dep && continue
pkg
=
$(
find_aport
$dep
)
||
die
"failed to find dependency
$dep
"
# recursively build deps
msg
"
e
ntering
${
pkg
%/*
}
"
msg
"
E
ntering
${
pkg
%/*
}
"
cd
${
pkg
%/*
}
$0
-r
||
return
1
sudo
apk_add
$pkg
...
...
@@ -395,6 +406,7 @@ usage() {
checksum
()
{
local
s files
fetch
for
s
in
$source
;
do
files
=
"
$files
${
s
##*/
}
"
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment