Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakub Panek
aports
Commits
bdace10a
Commit
bdace10a
authored
13 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
newapkbuild: add -n option for setting name
So we can set pkgname if it differs from download archive name
parent
1187cc5c
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
newapkbuild.in
+21
-15
21 additions, 15 deletions
newapkbuild.in
with
21 additions
and
15 deletions
newapkbuild.in
+
21
−
15
View file @
bdace10a
...
...
@@ -101,22 +101,25 @@ newaport() {
pv
=
${
newname
#
$pn
-
}
pv
=
${
pv
%.t*
}
#strip .tar.gz .tgz .tar.bz2 etc
fi
if
[
-e
"
$pn
"
/APKBUILD
]
&&
[
-z
"
$force
"
]
;
then
error
"
$pn
/APKBUILD already exist"
if
[
-z
"
$pkgname
"
]
;
then
pkgname
=
$pn
fi
if
[
-e
"
$pkgname
"
/APKBUILD
]
&&
[
-z
"
$force
"
]
;
then
error
"
$pkgname
/APKBUILD already exist"
return
1
fi
mkdir
-p
"
$p
n
"
cd
"
$p
n
"
mkdir
-p
"
$p
kgname
"
cd
"
$p
kgname
"
if
[
-z
"
$source
"
]
&&
[
-n
"
$sourceforge
"
]
;
then
source
=
"http://downloads.sourceforge.net/
$pn
/
$pn
-
$pv
.tar.gz"
fi
if
[
-z
"
$depends
"
]
&&[
"
$buildtype
"
=
=
"python"
]
;
then
if
[
-z
"
$depends
"
]
&&[
"
$buildtype
"
=
"python"
]
;
then
depends
=
"python"
fi
if
[
-z
"
$makedepends
"
]
&&[
"
$buildtype
"
=
=
"python"
]
;
then
if
[
-z
"
$makedepends
"
]
&&[
"
$buildtype
"
=
"python"
]
;
then
makedepends
=
"python-dev"
else
makedepends
=
"
\$
depends_dev"
...
...
@@ -129,14 +132,14 @@ newaport() {
# Copy init.d scripts if requested
if
[
-n
"
$cpinitd
"
]
;
then
cp
"
$datadir
"
/sample.initd
$p
n
.initd
cp
"
$datadir
"
/sample.confd
$p
n
.confd
cp
"
$datadir
"
/sample.pre-install
$p
n
.pre-install
cp
"
$datadir
"
/sample.post-install
$p
n
.post-install
cp
"
$datadir
"
/sample.initd
$p
kgname
.initd
cp
"
$datadir
"
/sample.confd
$p
kgname
.confd
cp
"
$datadir
"
/sample.pre-install
$p
kgname
.pre-install
cp
"
$datadir
"
/sample.post-install
$p
kgname
.post-install
install
=
"
\$
pkgname.pre-install
\$
pkgname.post-install"
source
=
"
$source
$p
n
.initd
$p
n
.confd
$p
kgname
.initd
$p
kgname
.confd
"
fi
...
...
@@ -144,7 +147,7 @@ newaport() {
cat
>
APKBUILD
<<
__EOF__
# Contributor:
${
PACKAGER
:+
" "
}${
PACKAGER
}
# Maintainer:
${
MAINTAINER
:+
" "
}${
MAINTAINER
}
pkgname=
$p
n
pkgname=
$p
kgname
pkgver=
$pv
pkgrel=0
pkgdesc="
$pkgdesc
"
...
...
@@ -255,11 +258,12 @@ __EOF__
}
__EOF__
abuild
-f
checksum
}
usage
()
{
echo
"
$prog
$version
"
echo
"usage:
$prog
[-cfh] [-d DESC] [-l LICENSE] [-u URL] PKGNAME[-PKGVER]"
echo
"usage:
$prog
[-cfh] [-d DESC] [-l LICENSE]
[-n NAME]
[-u URL] PKGNAME[-PKGVER]
|SRCURL
"
echo
"Options:"
echo
" -a Create autotools (use ./configure ...)"
echo
" -c Copy a sample init.d, conf.d, and install script to new directory"
...
...
@@ -267,6 +271,7 @@ usage() {
echo
" -f Force even if directory already exist"
echo
" -h Show this help"
echo
" -l Set package license to LICENSE"
echo
" -n Set package name to NAME"
echo
" -p Create perl package (Assume Makefile.PL is there)"
echo
" -y Create python package (Assume setup.py is there)"
echo
" -u Set package URL"
...
...
@@ -275,7 +280,7 @@ usage() {
exit
0
}
while
getopts
"acd:fhl:pyu:s"
opt
;
do
while
getopts
"acd:fhl:
n:
pyu:s"
opt
;
do
case
$opt
in
'a'
)
buildtype
=
"autotools"
;;
'c'
)
cpinitd
=
1
;;
...
...
@@ -283,6 +288,7 @@ while getopts "acd:fhl:pyu:s" opt; do
'f'
)
force
=
1
;;
'h'
)
usage
;;
'l'
)
license
=
"
$OPTARG
"
;;
'n'
)
pkgname
=
"
$OPTARG
"
;;
'p'
)
buildtype
=
"perl"
;;
'y'
)
buildtype
=
"python"
;;
'u'
)
url
=
"
$OPTARG
"
;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment