Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
78db5e89
Commit
78db5e89
authored
May 19, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
define DISTRNAME and DISTRVERSION globally and use it
parent
dcc8603f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
25 deletions
+23
-25
rpmbph
bin/rpmbph
+13
-17
rpmgp
bin/rpmgp
+1
-1
rpmqf
bin/rpmqf
+1
-1
common
share/eterbuild/functions/common
+4
-2
repl
share/eterbuild/functions/repl
+3
-3
rpmpkg
share/eterbuild/functions/rpmpkg
+1
-1
No files found.
bin/rpmbph
View file @
78db5e89
#!/bin/bash
#!/bin/bash
# 2003-2010 (c) Etersoft www.etersoft.ru
# 2003-2010
, 2012
(c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# Public domain
#
#
# BPH - backport; use hasher
# BPH - backport; use hasher
# Used ROOTDIR if defined
# Makes backport package to any target platfrom (RPM, DEB, TGZ)
# Makes backport package to any target platfrom (RPM, DEB, TGZ)
# Релиз строится на основе релиза из Сизифа. Если там был alt4
# Релиз строится на основе релиза из Сизифа. Если там был alt4, то здесь будет alt0.M24.4
# то здесь будет alt0.M24.4
# TODO: use RPMBUILDARG
# TODO: use RPMBUILDARG
# load common functions, compatible with local and installed script
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod repl rpm git buildsrpm
load_mod repl rpm git buildsrpm
DISTRVERSION
=
`
$DISTRVENDOR
-v
`
altspec_to_local
()
altspec_to_local
()
{
{
local
i
local
i
...
@@ -50,8 +48,8 @@ if [ "$VENDOR" = "alt" ] ; then
...
@@ -50,8 +48,8 @@ if [ "$VENDOR" = "alt" ] ; then
%undefine __libtoolize"
%undefine __libtoolize"
fi
fi
else
else
# Hack for repack on x86_64 packages with ExclusiveArch: %{ix586}
# Hack for
allow
repack on x86_64 packages with ExclusiveArch: %{ix586}
subst
"s|^ExclusiveArch:.*||g"
$SPECNAME
[
"
$SYSARCH
"
=
"x86_64"
]
&&
subst
"s|^ExclusiveArch:.*||g"
$SPECNAME
# Need our compat package and disable strong patch checking
# Need our compat package and disable strong patch checking
BUILDREQ
=
"BuildRequires: rpm-build-altlinux-compat >= 0.95 make gcc
\n
$FIXPATCHFUZZ
"
BUILDREQ
=
"BuildRequires: rpm-build-altlinux-compat >= 0.95 make gcc
\n
$FIXPATCHFUZZ
"
[
-z
"
$BUILDCOMMAND
"
]
&&
BUILDCOMMAND
=
$ETERBUILDBIN
/rpmbb
[
-z
"
$BUILDCOMMAND
"
]
&&
BUILDCOMMAND
=
$ETERBUILDBIN
/rpmbb
...
@@ -79,10 +77,8 @@ fi
...
@@ -79,10 +77,8 @@ fi
# Do not add BuildReq if already exist
# Do not add BuildReq if already exist
cat
$SPECNAME
|
grep
rpm-build-compat &>/dev/null
&&
BUILDREQ
=
""
cat
$SPECNAME
|
grep
rpm-build-compat &>/dev/null
&&
BUILDREQ
=
""
DISTRSYS
=
"
$(
$DISTRVENDOR
-d
)
"
# fix readlink -m, introduced by new libtool and missed in RHEL4 (replace with readlink -f)
# fix readlink -m, introduced by new libtool and missed in RHEL4 (replace with readlink -f)
if
[
"
$DISTR
SYS
/
$DISTRVERSION
"
=
"ASPLinux/11.2"
]
;
then
if
[
"
$DISTR
NAME
/
$DISTRVERSION
"
=
"ASPLinux/11.2"
]
;
then
test
-z
"
$VERBOSE
"
||
echo
"Add subst readlink -m"
test
-z
"
$VERBOSE
"
||
echo
"Add subst readlink -m"
ADDFIXCOMMAND
=
"
$ADDFIXCOMMAND
ADDFIXCOMMAND
=
"
$ADDFIXCOMMAND
%__subst 's|readlink -m|readlink -f|g' libtool ltmain.sh"
%__subst 's|readlink -m|readlink -f|g' libtool ltmain.sh"
...
@@ -97,6 +93,7 @@ fi
...
@@ -97,6 +93,7 @@ fi
# FIXME HACK need only for wine on x86_64
# FIXME HACK need only for wine on x86_64
#if [ "$DISTRSYS" = "Ubuntu" ] || [ "$DISTRSYS" = "Debian" ]; then
#if [ "$DISTRSYS" = "Ubuntu" ] || [ "$DISTRSYS" = "Debian" ]; then
# FIXME: add BUILDARCH using
if
echo
$SPECNAME
|
grep
-q
wine
;
then
if
echo
$SPECNAME
|
grep
-q
wine
;
then
test
-z
"
$VERBOSE
"
||
echo
"Add remove_optflags -m64"
test
-z
"
$VERBOSE
"
||
echo
"Add remove_optflags -m64"
ADDFIXCOMMAND
=
"
$ADDFIXCOMMAND
ADDFIXCOMMAND
=
"
$ADDFIXCOMMAND
...
@@ -130,8 +127,6 @@ LISTGROUP=`eval_spec $SPECNAME | grep Group | sed -e "s|^.*:||g" | xargs -n1 ec
...
@@ -130,8 +127,6 @@ LISTGROUP=`eval_spec $SPECNAME | grep Group | sed -e "s|^.*:||g" | xargs -n1 ec
ALLREPLRULES
=
""
ALLREPLRULES
=
""
[
-n
"
$VERBOSE
"
]
&&
echo
"Checking req names for
$LISTDEP
"
[
-n
"
$VERBOSE
"
]
&&
echo
"Checking req names for
$LISTDEP
"
export
DISTRVERSION
if
[
-n
"
$VERBOSE
"
]
;
then
if
[
-n
"
$VERBOSE
"
]
;
then
echo
-n
"Use replacement file: "
echo
-n
"Use replacement file: "
print_pkgrepl_list
print_pkgrepl_list
...
@@ -239,7 +234,7 @@ else
...
@@ -239,7 +234,7 @@ else
subst
"s|^popd|cd - >/dev/null|g"
$SPECNAME
subst
"s|^popd|cd - >/dev/null|g"
$SPECNAME
fi
fi
if
[
"
$DISTR
SYS
/
$DISTRVERSION
"
=
"CentOS/5"
]
;
then
if
[
"
$DISTR
NAME
/
$DISTRVERSION
"
=
"CentOS/5"
]
;
then
test
-z
"
$VERBOSE
"
||
echo
"Remove egg-info from file list"
test
-z
"
$VERBOSE
"
||
echo
"Remove egg-info from file list"
subst
"s|.*
\.
egg-info.*||g"
$SPECNAME
subst
"s|.*
\.
egg-info.*||g"
$SPECNAME
fi
fi
...
@@ -263,12 +258,12 @@ if [ "$VENDOR" = "alt" ] ; then
...
@@ -263,12 +258,12 @@ if [ "$VENDOR" = "alt" ] ; then
export
USE_LEGACY_COMPRESSION
=
1
export
USE_LEGACY_COMPRESSION
=
1
fi
fi
subst
"1i# This spec is backported to
$DISTR
SYS
$DISTRVERSION
automatically by rpmbph script. Do not edit it."
$SPECNAME
subst
"1i# This spec is backported to
$DISTR
NAME
$DISTRVERSION
automatically by rpmbph script. Do not edit it."
$SPECNAME
ENTRY
=
"- backport to
$DISTR
SYS
$DISTRVERSION
(by rpmbph script)"
ENTRY
=
"- backport to
$DISTR
NAME
$DISTRVERSION
(by rpmbph script)"
DISTRARG
=
"-
$MDISTR
"
DISTRARG
=
"-
$MDISTR
"
else
else
subst
"1i# This spec is autoported from ALT Linux Sisyphus to
$DISTR
SYS
$DISTRVERSION
automatically by rpmbph script. Do not edit it."
$SPECNAME
subst
"1i# This spec is autoported from ALT Linux Sisyphus to
$DISTR
NAME
$DISTRVERSION
automatically by rpmbph script. Do not edit it."
$SPECNAME
ENTRY
=
"- autoport to
$DISTR
SYS
$DISTRVERSION
(by rpmbph script)"
ENTRY
=
"- autoport to
$DISTR
NAME
$DISTRVERSION
(by rpmbph script)"
export
USE_VENDOR
=
$RPMVENDOR
export
USE_VENDOR
=
$RPMVENDOR
export
USE_LEGACY_COMPRESSION
=
1
export
USE_LEGACY_COMPRESSION
=
1
DISTRARG
=
""
DISTRARG
=
""
...
@@ -304,6 +299,7 @@ phelp()
...
@@ -304,6 +299,7 @@ phelp()
echog
" -r remote build"
# will pass to rpmbs/rpmbsh
echog
" -r remote build"
# will pass to rpmbs/rpmbsh
echog
" -v more verbose"
echog
" -v more verbose"
echog
" -q quiet"
echog
" -q quiet"
echog
"Set ROOTDIR variable for backport to the other system"
# echog " -m - send result via e-mail"
# echog " -m - send result via e-mail"
}
}
...
...
bin/rpmgp
View file @
78db5e89
...
@@ -238,7 +238,7 @@ if [ -n "$INSTALLBINARY" ] ; then
...
@@ -238,7 +238,7 @@ if [ -n "$INSTALLBINARY" ] ; then
# pack by LISTNAMES list
# pack by LISTNAMES list
pack_src_rpm
--commit
$LISTRPMARGS
pack_src_rpm
--commit
$LISTRPMARGS
LISTPKG
=
$(
rpmquery
--requires
-p
$LISTBUILT
| clean_pkgreq |
sed
-e
"s|rpm-build-altlinux-compat||g"
|
sed
-e
"s|gcc-c++||g"
)
LISTPKG
=
$(
rpmquery
--requires
-p
$LISTBUILT
| clean_pkgreq |
sed
-e
"s|rpm-build-altlinux-compat||g"
|
sed
-e
"s|gcc-c++||g"
)
CMD
=
$(
get_install_package_command
`
$DISTRVENDOR
-d
`
interactive
)
CMD
=
$(
get_install_package_command
$DISTRNAME
interactive
)
docmd
$SUDO
$CMD
$LISTPKG
docmd
$SUDO
$CMD
$LISTPKG
exit
exit
fi
fi
...
...
bin/rpmqf
View file @
78db5e89
...
@@ -53,7 +53,7 @@ real_file()
...
@@ -53,7 +53,7 @@ real_file()
real_file
"
$1
"
real_file
"
$1
"
case
"
$(
$DISTRVENDOR
-p
)
"
in
case
$TARGET
in
"rpm"
)
"rpm"
)
rpmquery
-f
$ARG
"
$FULLFILEPATH
"
rpmquery
-f
$ARG
"
$FULLFILEPATH
"
;;
;;
...
...
share/eterbuild/functions/common
View file @
78db5e89
...
@@ -148,10 +148,12 @@ if [ -n "$NEEDETERBUILD" ] ; then
...
@@ -148,10 +148,12 @@ if [ -n "$NEEDETERBUILD" ] ; then
fi
fi
# Internal
# Internal
# Detect distro name / vendor according to ROOTDIR system or current system
detect_target_env
()
detect_target_env
()
{
{
local
DISTRNAME
=
$(
$DISTRVENDOR
-e
)
MENVARG
=
""
MENVARG
=
""
DISTRNAME
=
$(
$DISTRVENDOR
-d
)
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
TARGET
=
$(
$DISTRVENDOR
-p
)
TARGET
=
$(
$DISTRVENDOR
-p
)
VENDOR
=
$(
$DISTRVENDOR
-s
)
VENDOR
=
$(
$DISTRVENDOR
-s
)
RPMVENDOR
=
$(
$DISTRVENDOR
-n
)
RPMVENDOR
=
$(
$DISTRVENDOR
-n
)
...
@@ -164,7 +166,7 @@ if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then
...
@@ -164,7 +166,7 @@ if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then
MENVARG
=
"-
$MENV
"
MENVARG
=
"-
$MENV
"
else
else
# FIXME: echog breaks vars
# FIXME: echog breaks vars
echog
"Distribution:
\$
DISTRNAME (
\$
VENDOR) (target package:
\$
TARGET)"
echog
"Distribution:
\$
DISTRNAME
/
\$
DISTRVERSION
(
\$
VENDOR) (target package:
\$
TARGET)"
fi
fi
}
}
...
...
share/eterbuild/functions/repl
View file @
78db5e89
...
@@ -7,6 +7,8 @@ PKGREPLBASE=$ETERBUILDDIR/pkgrepl
...
@@ -7,6 +7,8 @@ PKGREPLBASE=$ETERBUILDDIR/pkgrepl
# Get replacement rule for ALT package to local in $1 (scan for files in $@)
# Get replacement rule for ALT package to local in $1 (scan for files in $@)
# set ALTPKGNAME, TARGETPKGNAME variable
# set ALTPKGNAME, TARGETPKGNAME variable
# used: TARGET, VENDOR, DEFAULTARCH
# FIXME: BUILDARCH?
tolocal_anyrepl
()
tolocal_anyrepl
()
{
{
local
i REPLRULE WARULES
local
i REPLRULE WARULES
...
@@ -79,6 +81,7 @@ print_grpreq()
...
@@ -79,6 +81,7 @@ print_grpreq()
eval_spec
${
1
}
|
grep
"^Group"
|
sed
-e
"s|^.*:||g"
|
sort
-u
| filter_strip_spaces
eval_spec
${
1
}
|
grep
"^Group"
|
sed
-e
"s|^.*:||g"
|
sort
-u
| filter_strip_spaces
}
}
# VENDOR, TARGET, DISTRVERSION is already defined in detect_target_env() func
internal_repl_list
()
internal_repl_list
()
{
{
local
REPLBASE
=
"
$1
"
local
REPLBASE
=
"
$1
"
...
@@ -98,9 +101,6 @@ internal_repl_list()
...
@@ -98,9 +101,6 @@ internal_repl_list()
print_replbased_list
()
print_replbased_list
()
{
{
local
REPLBASE
=
"
$1
"
local
REPLBASE
=
"
$1
"
# VENDOR, TARGET is already defined in detect_target_env() func
[
-z
"
$DISTRVERSION
"
]
&&
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
if
[
"
$DEFAULTARCH
"
=
"x86_64"
]
;
then
if
[
"
$DEFAULTARCH
"
=
"x86_64"
]
;
then
internal_repl_list
$REPLBASE
.x86_64
internal_repl_list
$REPLBASE
.x86_64
fi
fi
...
...
share/eterbuild/functions/rpmpkg
View file @
78db5e89
...
@@ -25,7 +25,7 @@ drop_pkg_extensions()
...
@@ -25,7 +25,7 @@ drop_pkg_extensions()
# TODO: add get_update_repo_command
# TODO: add get_update_repo_command
# TODO: migrate to file using (as repos)
# TODO: migrate to file using (as repos)
# args:
distr_vendor
[interactive]
# args:
VENDORNAME
[interactive]
get_install_package_command
()
get_install_package_command
()
{
{
local
VENDORNAME
=
$1
local
VENDORNAME
=
$1
...
...
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