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
8302b969
Commit
8302b969
authored
Feb 13, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.alt:packages/etersoft-build-utils
parents
d0959bd7
8e4e0e6d
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
145 additions
and
47 deletions
+145
-47
TODO
TODO
+1
-0
mkpatch
bin/mkpatch
+11
-1
myhsh
bin/myhsh
+1
-1
rpmbb
bin/rpmbb
+5
-5
rpmbph
bin/rpmbph
+12
-8
rpmbs
bin/rpmbs
+3
-3
rpmbsh
bin/rpmbsh
+2
-2
rpmgp
bin/rpmgp
+2
-2
config
share/eterbuild/functions/config
+2
-0
rpm
share/eterbuild/functions/rpm
+54
-20
spec
share/eterbuild/functions/spec
+7
-0
pkgrepl.rpm
share/eterbuild/pkgrepl/pkgrepl.rpm
+4
-2
test_get_bin.sh
tests/test_get_bin.sh
+5
-1
test_tr_srpm.sh
tests/test_tr_srpm.sh
+30
-0
check_publish.sh
tools/check_publish.sh
+6
-2
No files found.
TODO
View file @
8302b969
rpmbph: --define _specdir --define _sourcedir
rpmgp -r git -
%name -
, gear-update
...
...
bin/mkpatch
View file @
8302b969
...
...
@@ -8,9 +8,14 @@
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
if
[
-f
Makefile.in
]
;
then
if
[
-f
Makefile
]
;
then
DD1
=
`
grep
^TOPOBJDIR Makefile |
sed
-e
"s| ||g"
`
DD2
=
`
grep
^top_builddir Makefile |
sed
-e
"s| ||g"
`
DD3
=
`
grep
^top_srcdir Makefile |
sed
-e
"s| ||g"
`
elif
[
-f
Makefile.in
]
;
then
DD1
=
`
grep
^TOPOBJDIR Makefile.in |
sed
-e
"s| ||g"
`
DD2
=
`
grep
^top_builddir Makefile.in |
sed
-e
"s| ||g"
`
DD3
=
`
grep
^top_srcdir Makefile.in |
sed
-e
"s| ||g"
`
else
warning
"Can't get topdir from Makefile.in"
fi
...
...
@@ -25,6 +30,11 @@ if [ -n "$DD2" ] ; then
TOPDIR
=
$top_builddir
fi
if
[
-n
"
$DD3
"
]
;
then
export
$DD3
TOPDIR
=
$top_srcdir
fi
#test -z "$TOPDIR" && exit 1
#echo "TOPDIR: $TOPDIR"
export
TOPDIR
...
...
bin/myhsh
View file @
8302b969
...
...
@@ -129,7 +129,7 @@ echo
if
[
"
$RESULT
"
=
"0"
-a
-n
"
$TESTINSTALL
"
]
;
then
# test install (only for last package in list)
# some key for build hasher from scratch
echog
"Find binary packages for
$LASTPACKAGE
..."
echog
"Find binary packages for
'
$(
basename
$LASTPACKAGE
)
' in
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher
..."
BINPACKAGES
=
`
get_binpkg_list
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher
$LASTPACKAGE
`
test
-n
"
$BINPACKAGES
"
||
fatal
"Can't find binary packages for
$LASTPACKAGE
in
`
ls
-l
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher
`
"
echo
"List:
$BINPACKAGES
"
...
...
bin/rpmbb
View file @
8302b969
...
...
@@ -18,7 +18,7 @@ load_mod rpm
# Start as helper
if
[
"
$1
"
=
"--helper"
]
;
then
shift
cd
$RPMDIR
/SPECS
&&
rpmbb
"
$@
"
cd
$RPM
TOP
DIR
/SPECS
&&
rpmbb
"
$@
"
exit
$?
fi
...
...
@@ -69,13 +69,13 @@ mygetopts $LISTARGS
mkdir
-p
"
$LOGDIR
"
mkdir
-p
"
$RPMDIR
/RPMS"
mkdir
-p
"
$RPM
TOP
DIR
/RPMS"
test
-z
"
$LISTNAMES
"
&&
fatal
"Please run with spec(s) name"
test
-n
"
$LISTRPMARGS
"
&&
echog
"Run
$RPMBUILD
with options: '
$LISTRPMARGS
'"
# instead cbuild req
if
[
-n
"
$BUILDREQ
"
]
;
then
uni_
rpmbuild
buildreq
$LISTNAMES
uni_buildreq
$LISTNAMES
RET
=
$?
echog
"You can run buildreq with -bi param for search a dependences for install section of the package"
exit
$RET
...
...
@@ -85,7 +85,7 @@ if [ -n "$BUILDOPT" ] ; then
is_alt
||
fatal
"Sorry, only ALT Linux systems support --short-circuit correctly"
for
it
in
$BUILDOPT
do
uni_rpmbuild
$
RPMBUILD
$
LISTNAMES
-b
$it
$LISTRPMARGS
--target
$DEFAULTARCH
--short-circuit
uni_rpmbuild
$LISTNAMES
-b
$it
$LISTRPMARGS
--target
$DEFAULTARCH
--short-circuit
done
exit
0
fi
...
...
@@ -109,7 +109,7 @@ do
LOGFILE
=
"
$LOGDIR
/
`
basename
$NAMESRPMIN
.src.rpm
`
$MENVARG
.log"
echo
"Build in native system"
>
$LOGFILE
rm
-f
$LOGFILE
.failed
(
uni_rpmbuild
$
RPMBUILD
$
i
-bb
$LISTRPMARGS
$NODEPS
--target
$DEFAULTARCH
2>&1
||
touch
$LOGFILE
.failed
)
|
tee
-a
$LOGFILE
(
uni_rpmbuild
$i
-bb
$LISTRPMARGS
$NODEPS
--target
$DEFAULTARCH
2>&1
||
touch
$LOGFILE
.failed
)
|
tee
-a
$LOGFILE
[
-r
"
$LOGFILE
.failed"
]
&&
RET
=
1
||
RET
=
0
if
[
"
$RET
"
=
"0"
]
;
then
...
...
bin/rpmbph
View file @
8302b969
...
...
@@ -12,7 +12,7 @@
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod repl
load_mod repl
rpm
#VENDORVERSION=`distr_vendor -e`
DISTRVERSION
=
`
distr_vendor
-v
`
...
...
@@ -255,13 +255,17 @@ fi
unset
MENV MENVARG
mkdir
-p
$RPMDIR
/SPECS/
$MDISTR
# handle src.rpm too, LISTBUILT - result src.rpms in SRPMS dir
pack_src_rpm
$LISTNAMES
for
i
in
$LISTNAMES
;
do
DEST
=
`
basename
$i
`
cp
$i
$RPMDIR
/SPECS/
$MDISTR
/
$DEST
||
fatal
"Can't copy spec"
cd
$RPMDIR
/SPECS/
$MDISTR
||
fatal
"Error"
alt_tolocal
$DEST
cd
-
export
RPMTOPDIR
=
$RPMDIR
/BP
for
i
in
$LISTBUILT
;
do
SPKG
=
$RPMDIR
/SRPMS/
$i
uni_rpminstall
$SPKG
SPECNAME
=
$RPMTOPDIR
/SPECS/
$(
spec_by_srpm
$SPKG
)
test
-r
"
$SPECNAME
"
||
fatal
"Spec
$SPECNAME
is not found"
rm
-f
$SPKG
alt_tolocal
$SPECNAME
done
bin/rpmbs
View file @
8302b969
...
...
@@ -110,7 +110,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echog
"==== Copying to build server ====="
#echog "It is recommended to rename old version at server for save traffic during rsync"
rsync
-vay
--partial
--progress
--checksum
\
-e
ssh
$LISTBUILT
$BUILDSERVER
:/
$RPMDIR
/SRPMS/
||
exit
1
-e
ssh
$LISTBUILT
$BUILDSERVER
:/
$RPM
TOP
DIR
/SRPMS/
||
exit
1
$REMCOM
rpmbs
--helper
$MENVARG
$LISTRPMARGS
$LISTBUILT
exit
0
fi
...
...
@@ -141,7 +141,7 @@ set_incoming $MENV
if
[
-n
"
${
DELETENOW
}
"
]
;
then
echog
"Removing from '
$RSYNCINCOMING
/
$INCOMING
/'"
check_key
cd
$RPMDIR
/SRPMS
cd
$RPM
TOP
DIR
/SRPMS
for
i
in
$LISTBUILT
;
do
>
$i
done
...
...
@@ -174,7 +174,7 @@ check_gear_and_tag()
if
[
-n
"
$SIGN
"
]
;
then
release_check
$LISTBUILT
cd
$RPMDIR
/SRPMS
cd
$RPM
TOP
DIR
/SRPMS
if
[
-r
"
$LISTBUILT
"
]
;
then
echo
if
one spec, check gear
check_gear_and_tag
$SPECDIR
...
...
bin/rpmbsh
View file @
8302b969
...
...
@@ -86,7 +86,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echo
echog
"==== Copying to build server ====="
#echog "It is recommended to rename old version at server for save traffic during rsync"
cd
$RPMDIR
/SRPMS
&&
rsync
-vay
--partial
--progress
--checksum
\
cd
$RPM
TOP
DIR
/SRPMS
&&
rsync
-vay
--partial
--progress
--checksum
\
-e
ssh
$LISTBUILT
$BUILDSERVER
:
$REMOTERPMDIR
/SRPMS/
||
fatal
"Error with rsync"
ssh
-t
$BUILDSERVER
"cd
$REMOTERPMDIR
/SRPMS && time myhsh
$MENVARG
$LISTRPMARGS
$LISTBUILT
"
RESULT
=
$?
...
...
@@ -94,7 +94,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echo
"-------------------------------"
test
"
$RESULT
"
=
"0"
&&
echog
"It was remote build at
$BUILDSERVER
"
||
echog
"There is error during remote build at
$BUILDSERVER
"
else
cd
$RPMDIR
/SRPMS
&&
time
myhsh
$MENVARG
$LISTRPMARGS
$LISTBUILT
cd
$RPM
TOP
DIR
/SRPMS
&&
time
myhsh
$MENVARG
$LISTRPMARGS
$LISTBUILT
RESULT
=
$?
date
echo
"-------------------------------"
...
...
bin/rpmgp
View file @
8302b969
...
...
@@ -224,7 +224,7 @@ if [ -n "$INSTALLBINARY" ] ; then
parse_cmd_pre
"
$@
"
pack_src_rpm
$LISTRPMARGS
echog
"Running apt-get for install needed packages for
$LISTBUILT
"
cd
$RPMDIR
/SRPMS
cd
$RPM
TOP
DIR
/SRPMS
# FIXME: ALT Specific
$SUDO
apt-get build-dep
$LISTBUILT
cd
-
...
...
@@ -309,7 +309,7 @@ fi
test
-z
"
$SRCRPM
"
&&
fatal
"Cannon find package for
$1
"
echog
"Try to download
$SRCRPM
"
test
-z
${
TRYINST
}
||
{
mkdir
-p
$RPM
DIR
/SRPMS
&&
cd
$RPM
DIR
/SRPMS
;
}
test
-z
${
TRYINST
}
||
{
mkdir
-p
$RPM
TOPDIR
/SRPMS
&&
cd
$RPMTOP
DIR
/SRPMS
;
}
echog
"Downloading in
$(
pwd
)
"
for
i
in
$REPOSITORY
...
...
share/eterbuild/functions/config
View file @
8302b969
...
...
@@ -22,6 +22,8 @@ NICE="nice"
RPMBUILD
=
rpmbuild
RPMDIR
=
"
$HOME
/RPM"
# Can be overrided in the scripts
[
-n
"
$RPMTOPDIR
"
]
||
RPMTOPDIR
=
"
$RPMDIR
"
[
-n
"
$APTCONFBASE
"
]
||
APTCONFBASE
=
$ETERBUILDETC
/apt/apt.conf
...
...
share/eterbuild/functions/rpm
View file @
8302b969
...
...
@@ -11,10 +11,11 @@
uni_rpmbuild
()
{
local
RET
=
0
local
COMMAND
=
$1
# hack due quotes
# just for fill by something
local
ONEPARAM
=
"-v"
shift
local
TWOPARAM
=
"-v"
local
SPECNAME
=
$1
local
SPECDIR
=
`
dirname
$SPECNAME
`
local
GEAR
=
gear
...
...
@@ -24,14 +25,9 @@ uni_rpmbuild()
# FIXME: do not override -v
ONEPARAM
=
"--define=_source_payload w9.gzdio"
fi
if
[
"
$COMMAND
"
=
"buildreq"
]
;
then
if
is_gear
$SPECDIR
;
then
$NICE
$GEARBUILDREQ
--commit
--
$@
||
RET
=
$?
else
$NICE
$COMMAND
$@
||
RET
=
$?
fi
return
$RET
if
[
-n
"
$RPMTOPDIR
"
]
;
then
TWOPARAM
=
"--define=_topdir
$RPMTOPDIR
"
fi
if
is_gear
$SPECDIR
;
then
...
...
@@ -39,16 +35,51 @@ uni_rpmbuild()
shift
# skip spec name
[
-n
"
$SPECDIR
"
]
&&
[
"
$SPECDIR
"
!=
"."
]
&&
warning
"Spec is not in git dir"
if
[
"
$MENV
"
=
"SS"
]
;
then
$NICE
$GEAR
--commit
--rpmbuild
--
$
COMMAND
"
$ONE
PARAM
"
$@
||
RET
=
$?
$NICE
$GEAR
--commit
--rpmbuild
--
$
RPMBUILD
"
$ONEPARAM
"
"
$TWO
PARAM
"
$@
||
RET
=
$?
else
fatal
"Unsupported now"
# build src.rpm via hasher (on ALT)
# $NICE gear-hsh --build-args="-bs" --rpmbuild -- $COMMAND "$ONEPARAM" $@
$NICE
$GEAR
--hasher
--
myhsh
--build-prog
=
$ETERBUILDDIR
/functions/rebuild
$@
||
RET
=
$?
fi
else
$NICE
$COMMAND
"
$ONEPARAM
"
$@
||
RET
=
$?
$NICE
$RPMBUILD
"
$ONEPARAM
"
"
$TWOPARAM
"
$@
||
RET
=
$?
fi
[
-n
"
$VERBOSE
"
]
&&
echo
"Run
$RPMBUILD
$ONEPARAM
$TWOPARAM
$@
"
||
:
return
$RET
}
uni_buildreq
()
{
local
RET
=
0
local
SPECNAME
=
$1
local
SPECDIR
=
`
dirname
$SPECNAME
`
local
GEARBUILDREQ
=
gear-buildreq
if
is_gear
$SPECDIR
;
then
$NICE
$GEARBUILDREQ
--commit
--
$@
||
RET
=
$?
else
$NICE
buildreq
$@
||
RET
=
$?
fi
return
$RET
}
uni_rpminstall
()
{
local
RET
=
0
local
TWOPARAM
=
"-v"
if
[
-n
"
$RPMTOPDIR
"
]
;
then
TWOPARAM
=
"--define=_topdir
$RPMTOPDIR
"
fi
[
-n
"
$VERBOSE
"
]
&&
echo
"Run
$COMMAND
$ONEPARAM
$@
"
||
:
#if is_gear $SPECDIR ; then
# $NICE $GEARBUILDREQ --commit -- $@ || RET=$?
#else
echo
-n
"Install package "
rpm
-iv
"
$TWOPARAM
"
$@
||
RET
=
$?
#fi
return
$RET
}
...
...
@@ -96,7 +127,6 @@ build_rpms_name()
NAMERPMIN
=
$BASENAME
-
$VERSION
-
$RELEASE
.
$PKGARCH
.rpm
NAMESRPMIN
=
$BASENAME
-
$VERSION
-
$RELEASE
.src.rpm
#RPMSOURCEDIR=$RPMDIR/SOURCES
RPMSOURCEDIR
=
`
rpm
--eval
%_sourcedir | subst_namever
`
[
-n
"
$RPMSOURCEDIR
"
]
||
fatal
"Can't detect RPM/SOURCES dir"
...
...
@@ -124,7 +154,7 @@ do
if
[
-z
${
i
/*rpm/
}
]
;
then
# if rpm not spec, guess it is src.rpm
NAMESRPMIN
=
$
i
NAMESRPMIN
=
$
(
basename
$i
)
else
#
# BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN
...
...
@@ -138,16 +168,18 @@ do
sleep
10
exit
1
fi
uni_rpmbuild
$
RPMBUILD
$
i
-bs
$ARGS
$NODEPS
--target
$DEFAULTARCH
uni_rpmbuild
$i
-bs
$ARGS
$NODEPS
--target
$DEFAULTARCH
else
echog
"Just packing
\$
NAMESRPMIN"
uni_rpmbuild
$
RPMBUILD
$
i
-bs
$ARGS
$NODEPS
--target
$DEFAULTARCH
||
fatal
"Error with rpmbuild"
uni_rpmbuild
$i
-bs
$ARGS
$NODEPS
--target
$DEFAULTARCH
||
fatal
"Error with rpmbuild"
fi
fi
if
[
-f
$RPMDIR
/SRPMS/
$NAMESRPMIN
]
;
then
# Check the package really built
if
[
-f
$RPMTOPDIR
/SRPMS/
$NAMESRPMIN
]
;
then
LISTBUILT
=
"
$LISTBUILT
$NAMESRPMIN
"
else
fatal
"Can't find '
$NAMESRPMIN
' in '
$RPMDIR
/SRPMS'"
fatal
"Can't find '
$NAMESRPMIN
' in '
$RPM
TOP
DIR
/SRPMS'"
fi
done
# remove extra space before list
...
...
@@ -157,12 +189,14 @@ test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is
}
# build binary package list (1st - repo dir, 2st - pkgname)
# algorithm: list all files in PKGDIR, print packages with our source pkg name
get_binpkg_list
()
{
local
PKGDIR
=
$1
local
PKGNAME
=
$(
basename
$2
)
find
"
$PKGDIR
"
!
-name
'*\.src\.rpm'
-name
'*\.rpm'
-execdir
\
rpmquery
-p
--qf
=
'%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n'
"{}"
\;
\
|
grep
"^
$
2
[[:space:]].*"
|
cut
-f2
| xargs
-n1
-I
"{}"
echo
"
$PKGDIR
/{} "
|
grep
"^
$
PKGNAME
[[:space:]].*"
|
cut
-f2
| xargs
-n1
-I
"{}"
echo
"
$PKGDIR
/{} "
}
drop_pkg_extensions
()
...
...
share/eterbuild/functions/spec
View file @
8302b969
...
...
@@ -163,3 +163,10 @@ add_changelog_helper()
return
$R
}
spec_by_srpm
()
{
local
PKG
=
$1
local
PKGNAME
PKGNAME
=
$(
rpm
-qp
--queryformat
"%{NAME}"
$PKG
)
[
-n
"
$PKGNAME
"
]
&&
echo
$PKGNAME
.spec
}
share/eterbuild/pkgrepl/pkgrepl.rpm
View file @
8302b969
...
...
@@ -85,4 +85,7 @@ libexpat-devel|expat-devel
libltdl-devel|libtool-ltdl-devel
libhal-devel|hal-devel
\ No newline at end of file
libhal-devel|hal-devel
liblua5-devel|lua-devel
libctemplate-devel|ctemplate-devel
libuuid-devel|uuid-devel
tests/test_get_bin.sh
View file @
8302b969
...
...
@@ -4,4 +4,8 @@
.
$ETERBUILDDIR
/functions/rpm
HASHERDIR
=
$HASHERDIR
-SS
get_binpkg_list
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher asymptote-1.43-alt1.src.rpm
for
i
in
`
ls
-1
$HASHERDIR
/repo/SRPMS.hasher
`
;
do
echo
"get for
$i
:"
get_binpkg_list
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher
$(
basename
$i
)
done
tests/test_tr_srpm.sh
0 → 100755
View file @
8302b969
#!/bin/sh
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
$ETERBUILDDIR
/functions/rpm
install_srpm_package
()
{
uni_rpminstall
$1
}
pack_srpm_package
()
{
LISTNAMES
=
$1
pack_src_rpm
}
export
IGNOREGEAR
=
1
RPMTOPDIR
=
$RPMDIR
/BP
for
i
in
`
ls
-1
$RPMDIR
/SRPMS
`
;
do
PKGNAME
=
$RPMDIR
/SRPMS/
$i
echo
"get for
$i
:"
install_srpm_package
$PKGNAME
SPECNAME
=
$RPMTOPDIR
/SPECS/
$(
spec_by_srpm
$PKGNAME
)
echo
"spec:
$SPECNAME
"
pack_srpm_package
$SPECNAME
echo
Compare
$PKGNAME
$LISTBUILT
rpmdiff
$PKGNAME
$RPMTOPDIR
/SRPMS/
$LISTBUILT
exit
1
done
tools/check_publish.sh
View file @
8302b969
...
...
@@ -21,11 +21,15 @@ print_usedby()
echo
"Required by:"
print_list
$USEDBY
echo
"Second required by:"
print_list
`
list_wd
$USEDBY
`
for
i
in
`
list_wd
$USEDBY
|
sort
-u
`
;
do
# skip repeated
echo
$USEDBY
|
grep
-q
$i
&&
continue
echo
"
$i
"
done
}
SPECLIST
=
`
find
$RPMDIR
/SPECS
-type
f
-name
"*.spec"
`
[
-n
"
$SPECLIST
"
]
||
SPECLIST
=
`
find
$RPMDIR
/SPECS
-type
f
-name
"*.spec"
`
for
i
in
$SPECLIST
;
do
if
echo
$i
|
grep
-q
HELP
;
then
continue
...
...
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