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
36d68e86
Commit
36d68e86
authored
Jul 20, 2008
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplified files section in spec
move spec related macros to standalone file simplified makefile
parent
3b9e044d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
130 additions
and
97 deletions
+130
-97
etersoft-build-utils.spec
etersoft-build-utils.spec
+1
-6
Makefile
etersoft-build-utils/Makefile
+1
-1
common
etersoft-build-utils/share/common
+7
-90
git
etersoft-build-utils/share/git
+25
-0
spec
etersoft-build-utils/share/spec
+96
-0
No files found.
etersoft-build-utils.spec
View file @
36d68e86
...
...
@@ -49,12 +49,7 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher
%doc AUTHORS README TODO NEWS QuickHelp*
%doc tools/upload-to-alt tools/ls-incoming tools/check_spec.sh
%_bindir/*
%dir %_datadir/eterbuild/
%_datadir/eterbuild/common
%_datadir/eterbuild/repl
%_datadir/eterbuild/publish-compat
%_datadir/eterbuild/pkgrepl/
%_datadir/eterbuild/grprepl/
%_datadir/eterbuild/
%dir %_sysconfdir/eterbuild/
%config(noreplace) %_sysconfdir/eterbuild/apt/apt.conf.*
%config(noreplace) %_sysconfdir/eterbuild/apt/sources.list.*
...
...
etersoft-build-utils/Makefile
View file @
36d68e86
...
...
@@ -19,4 +19,4 @@ install:
#install -m 644 apt/apt.conf.* apt/sources.list.* %buildroot/%_sysconfdir/apt/
install
-m
644 share/pkgrepl/pkgrepl.
*
$(datadir)
/eterbuild/pkgrepl/
install
-m
644 share/grprepl/grprepl.
*
$(datadir)
/eterbuild/grprepl/
install
-m
644 share/
common share/publish-compat share/repl
$(datadir)
/eterbuild/
install
-m
644 share/
*
$(datadir)
/eterbuild/
||
:
etersoft-build-utils/share/common
View file @
36d68e86
...
...
@@ -166,96 +166,8 @@ test -f ~/.eterbuild-config && . ~/.eterbuild-config
# obsoleted
test
-f
~/.ebconfig
&&
.
~/.ebconfig
get_var
()
{
grep
-i
"^
$1
:"
|
head
-n
1 |
sed
-e
"s/^[^:]*[
\t
]*:[
\t
]*//"
}
#
eval_spec
()
{
# Hack: just print spec if -bE failed
# TODO: use rpm -showrc instead -bE for get main variables?
if
is_alt
;
then
$RPMBUILD
-bE
--target
$DEFAULTARCH
$RPMBUILDARG
$@
||
fatal
"Check spec's fields"
else
$RPMBUILD
-bE
--target
$DEFAULTARCH
$RPMBUILDARG
$@
2>/dev/null
||
cat
$1
fi
}
get_release
()
{
eval_spec
$1
| get_var
"Release"
}
# get current release number
get_release_number
()
{
$(
get_release
$1
|
sed
-e
"s/alt//"
|
sed
-e
"s/%{_vendor}//"
|
sed
-e
"s/eter//"
|
sed
-e
"s/%_vendor//"
)
}
set_var
()
{
subst
"s|
\(
$2
:
\)
.*
\$
|
\1
$3
|"
$1
}
set_release
()
{
local
RELEASE
=
$2
if
[
-z
"
$RELEASE
"
]
;
then
RELEASE
=
alt1
fi
set_var
$1
Release
$RELEASE
}
# Set version for spec (args: spec version), f.i. test.spec 1.2.3)
# Supports %major and %ver_major macros in spec
# 2.6.1 (), 2.6 (major) .1 (minor)
set_version
()
{
local
SPEC
=
$1
local
VER
=
$2
.
$ETERBUILDDATA
/spec
if
[
-z
"
$SPEC
"
]
;
then
return
1
fi
if
[
-z
"
$VER
"
]
;
then
return
2
fi
VERMAJOR
=
`
echo
$VER
|
sed
-e
"s|
\(
[0-9]*
\.
[0-9]*
\)\.
.*|
\1
|"
`
VERMINOR
=
`
echo
$VER
|
sed
-e
"s|^[0-9]*
\.
[0-9]*||;s|^
\.
||"
`
if
[
-z
${
VER
/.*/
}
]
;
then
VERMAJOR
=
fi
MAJORMACROS
=
`
grep
"
\%
define[[:space:]]
\(\|
ver_
\)
major"
$SPEC
|
sed
-e
"s|.*[[:space:]]
\(
.*major
\)
.*|
\1
|"
`
if
[
-n
"
${
MAJORMACROS
}
"
]
;
then
# Change major define
test
-n
"
$VERMAJOR
"
&&
subst
"s|
\(\%
define[[:space:]]
$MAJORMACROS
[[:space:]]
\)
.*|
\1
$VERMAJOR
|"
$SPEC
# Change version if VERMINOR is defined
if
[
-n
"
$VERMINOR
"
]
;
then
set_var
$SPEC
Version %
$MAJORMACROS
.
$VERMINOR
||
fatal
"Error 1 with set version to spec"
else
set_var
$SPEC
Version %
$MAJORMACROS
||
fatal
"Error 2 with set version to spec"
fi
else
set_var
$SPEC
Version
$VER
||
fatal
"Error 3 with set version to spec"
fi
}
subst_namever
()
{
sed
-e
"s|%{name}|
$BASENAME
|g
s|%{version}|
$VERSION
|g
s|%name|
$BASENAME
/|g
s|%version|
$VERSION
/|g"
}
# get correct BUILDROOT, run build_rpms_name before!
build_buildroot
()
...
...
@@ -400,8 +312,12 @@ test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is
# Internal
set_target_type
()
{
if
echo
$1
|
grep
"^M[0-9][0-9]$"
>
/dev/null
;
then
MENV
=
$1
return
0
fi
case
"
$1
"
in
(
"
M23"
|
"M24"
|
"M30"
|
"M40"
|
"M41"
|
"M42"
|
"
DD"
|
"SS"
|
"EE"
)
(
"DD"
|
"SS"
|
"EE"
)
MENV
=
"
$1
"
return
0
;
;;
...
...
@@ -513,6 +429,7 @@ add_changelog_helper()
N
=
`
grep
-n
'^%changelog'
$SPEC
|
head
-n
1 |
sed
s!:.
*
!!
g
`
# +1 -- comment with date and packager name
# +2 -- place for edit comments
# +N works for mcedit and vi
${
EDITOR
}
+
$((
$N
+
2
))
$SPEC
done
fi
...
...
etersoft-build-utils/share/git
0 → 100644
View file @
36d68e86
#!/bin/bash
# 2008 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Author: Denis Smirnov <mithraen@altlinux.ru>
# Public domain
# 20.07.08
get_branch_list
()
{
git branch |
grep
'^ '
|
sed
's/^..\(.*\)/\1/'
}
is_exist_branch
()
{
test
-n
"
$1
"
||
return
1
get_branch_list |
grep
$1
>
/dev/null
}
get_current_branch
()
{
git branch |
grep
'^\*'
|
sed
's/^..//'
|
tr
-d
"
\n
"
}
etersoft-build-utils/share/spec
0 → 100644
View file @
36d68e86
#!/bin/bash
# 2006-2008 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# 20.07.08
get_var
()
{
grep
-i
"^
$1
:"
|
head
-n
1 |
sed
-e
"s/^[^:]*[
\t
]*:[
\t
]*//"
}
#
eval_spec
()
{
# Hack: just print spec if -bE failed
# TODO: use rpm -showrc instead -bE for get main variables?
if
is_alt
;
then
$RPMBUILD
-bE
--target
$DEFAULTARCH
$RPMBUILDARG
$@
||
fatal
"Check spec's fields"
else
$RPMBUILD
-bE
--target
$DEFAULTARCH
$RPMBUILDARG
$@
2>/dev/null
||
cat
$1
fi
}
get_release
()
{
eval_spec
$1
| get_var
"Release"
}
# get current release number
get_release_number
()
{
$(
get_release
$1
|
sed
-e
"s/alt//"
|
sed
-e
"s/%{_vendor}//"
|
sed
-e
"s/eter//"
|
sed
-e
"s/%_vendor//"
)
}
set_var
()
{
subst
"s|
\(
$2
:
\)
.*
\$
|
\1
$3
|"
$1
}
set_release
()
{
local
RELEASE
=
$2
if
[
-z
"
$RELEASE
"
]
;
then
RELEASE
=
alt1
fi
set_var
$1
Release
$RELEASE
}
# Set version for spec (args: spec version), f.i. test.spec 1.2.3)
# Supports %major and %ver_major macros in spec
# 2.6.1 (), 2.6 (major) .1 (minor)
set_version
()
{
local
SPEC
=
$1
local
VER
=
$2
if
[
-z
"
$SPEC
"
]
;
then
return
1
fi
if
[
-z
"
$VER
"
]
;
then
return
2
fi
VERMAJOR
=
`
echo
$VER
|
sed
-e
"s|
\(
[0-9]*
\.
[0-9]*
\)\.
.*|
\1
|"
`
VERMINOR
=
`
echo
$VER
|
sed
-e
"s|^[0-9]*
\.
[0-9]*||;s|^
\.
||"
`
if
[
-z
${
VER
/.*/
}
]
;
then
VERMAJOR
=
fi
MAJORMACROS
=
`
grep
"
\%
define[[:space:]]
\(\|
ver_
\)
major"
$SPEC
|
sed
-e
"s|.*[[:space:]]
\(
.*major
\)
.*|
\1
|"
`
if
[
-n
"
${
MAJORMACROS
}
"
]
;
then
# Change major define
test
-n
"
$VERMAJOR
"
&&
subst
"s|
\(\%
define[[:space:]]
$MAJORMACROS
[[:space:]]
\)
.*|
\1
$VERMAJOR
|"
$SPEC
# Change version if VERMINOR is defined
if
[
-n
"
$VERMINOR
"
]
;
then
set_var
$SPEC
Version %
$MAJORMACROS
.
$VERMINOR
||
fatal
"Error 1 with set version to spec"
else
set_var
$SPEC
Version %
$MAJORMACROS
||
fatal
"Error 2 with set version to spec"
fi
else
set_var
$SPEC
Version
$VER
||
fatal
"Error 3 with set version to spec"
fi
}
subst_namever
()
{
sed
-e
"s|%{name}|
$BASENAME
|g
s|%{version}|
$VERSION
|g
s|%name|
$BASENAME
/|g
s|%version|
$VERSION
/|g"
}
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