Commit 0cdfa069 authored by Vitaly Lipatov's avatar Vitaly Lipatov

Merge branch 'master' of git.alt:packages/etersoft-build-utils

parents 94262aa7 06be9b92
......@@ -3,20 +3,22 @@ all: QuickHelp.txt QuickHelp.koi8-r.txt
$(MAKE) -C po
QuickHelp.koi8-r.txt:
for i in bin/* ; do echo -e "\n\n---------------------------"; $$i -h ; done >$@
for i in bin/* ; do echo -e "\n\n---------------------------"; $$i -h ; done | grep -v "^Note:" | grep -v "^Target" >$@
QuickHelp.txt:
for i in bin/* ; do echo -e "\n\n---------------------------"; LANG=C $$i -h ; done >$@
for i in bin/* ; do echo -e "\n\n---------------------------"; LANG=C $$i -h ; done | grep -v "^Note:" | grep -v "^Target" >$@
install:
$(MAKE) -C po install
mkdir -p $(bindir) $(sysconfdir)/eterbuild/apt
mkdir -p $(bindir) $(sysconfdir)/eterbuild/apt $(sysconfdir)/rpm
mkdir -p $(datadir)/eterbuild/functions/
mkdir -p $(datadir)/eterbuild/pkgrepl $(datadir)/eterbuild/grprepl/
install -m 755 bin/* $(bindir)
install -m 644 etc/apt/* $(sysconfdir)/eterbuild/apt/
install -m 644 etc/rpm/* $(sysconfdir)/rpm/
install -m 644 etc/config $(sysconfdir)/eterbuild/
install -m 644 etc/repos $(sysconfdir)/eterbuild/
#install -m 644 apt/apt.conf.* apt/sources.list.* %buildroot/%_sysconfdir/apt/
install -m 644 share/eterbuild/pkgrepl/pkgrepl.* $(datadir)/eterbuild/pkgrepl/
install -m 644 share/eterbuild/grprepl/grprepl.* $(datadir)/eterbuild/grprepl/
install -m 644 share/eterbuild/functions/* $(datadir)/eterbuild/functions
install -m 644 share/eterbuild/functions/* $(datadir)/eterbuild/functions/
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
ginit - initialize repo in git.alt for current project
Use: ginit without parameters
---------------------------
gpush - publish current project repo to git.alt
Use: gpush without parameters
---------------------------
loginhsh - install package in hasher / take shell
Usage: [-t -i -h -r] bin.rpm...
:
......@@ -16,11 +25,9 @@ Warning: Can't get topdir from Makefile.in
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
myhsh - build package via hasher
Usage: [-m -s -u -i -c] spec...
Usage: [-m -s -u -i -c] src.rpm...
:
-m -
-s - ()
-u - ()
-i - install built packages in test hasher
......@@ -28,8 +35,7 @@ Usage: [-m -s -u -i -c] spec...
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbb - build binary rpm from spec (with ccache using if found)
rpmbb - build binary rpm from spec
Usage: [-c -p -i -r] spec...
:
-c - start from compile stage
......@@ -39,7 +45,6 @@ Usage: [-c -p -i -r] spec...
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbph - backports spec and rebuild it
Usage: [-r -u -U -n -i -m -v] spec...
:
......@@ -51,7 +56,6 @@ Usage: [-r -u -U -n -i -m -v] spec...
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbs - make src.rpm from spec
Usage: [-s -u -c -n --nodeps] spec...
:
......@@ -66,7 +70,6 @@ Usage: [-s -u -c -n --nodeps] spec...
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbsh - BSH - build source; use hasher
Usage: [-r -s -u -m -i -c] spec...
:
......@@ -83,7 +86,6 @@ rpmbugs [-t] spec | bug number | package name | -qf command | /path/to/file - op
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmcs spec - cleanup spec (like cleanup_spec command), adapted to ALT
......@@ -102,7 +104,6 @@ rpmgp [-a -c -n] [system] pkgname - download src.rpm from 'system' repository to
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmgs - get sources for spec
Usage: [-a -r ] spec...
:
......@@ -123,7 +124,6 @@ rpmU - the same as [sudo] rpm -Uvh - update package
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmunmets - tests unmets in build packages
Usage: [-M24 -M40]
:
......@@ -132,7 +132,6 @@ Usage: [-M24 -M40]
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmurl - open package Url in browser
Usage: [-c -f -p -s] spec or package...
:
......
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
ginit - initialize repo in git.alt for current project
Use: ginit without parameters
---------------------------
gpush - publish current project repo to git.alt
Use: gpush without parameters
---------------------------
loginhsh - install package in hasher / take shell
Usage: [-t -i -h -r] bin.rpm...
Options:
......@@ -16,11 +25,9 @@ Warning: Can't get topdir from Makefile.in
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
myhsh - build package via hasher
Usage: [-m -s -u -i -c] spec...
Usage: [-m -s -u -i -c] src.rpm...
Options:
-m - mail result log
-s - sign package(s)
-u - sign and upload package(s) to Incoming
-i - install built packages in test hasher
......@@ -28,8 +35,7 @@ Options:
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbb - build binary rpm from spec (with ccache using if found)
rpmbb - build binary rpm from spec
Usage: [-c -p -i -r] spec...
Options:
-c - start from compile stage
......@@ -39,7 +45,6 @@ Options:
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbph - backports spec and rebuild it
Usage: [-r -u -U -n -i -m -v] spec...
Options:
......@@ -51,7 +56,6 @@ Options:
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbs - make src.rpm from spec
Usage: [-s -u -c -n --nodeps] spec...
Options:
......@@ -66,7 +70,6 @@ Options:
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmbsh - BSH - build source; use hasher
Usage: [-r -s -u -m -i -c] spec...
Options:
......@@ -83,7 +86,6 @@ rpmbugs [-t] spec | bug number | package name | -qf command | /path/to/file - op
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmcs spec - cleanup spec (like cleanup_spec command), adapted to ALT
......@@ -102,7 +104,6 @@ rpmgp [-a -c -n] [system] pkgname - download src.rpm from 'system' repository to
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmgs - get sources for spec
Usage: [-a -r ] spec...
Options:
......@@ -123,7 +124,6 @@ rpmU - the same as [sudo] rpm -Uvh - update package
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmunmets - tests unmets in build packages
Usage: [-M24 -M40]
Options:
......@@ -132,7 +132,6 @@ Options:
---------------------------
Target ALT Linux system: SS, use /etc/apt/apt.conf.SS
rpmurl - open package Url in browser
Usage: [-c -f -p -s] spec or package...
Options:
......
......@@ -6,16 +6,16 @@ http://www.freesource.info/wiki/AltLinux/Razrabotchiku/SborkaPaketov
See QuickHelp.txt also.
This package is tested with follow Linux distributions:
- ALT Linux 2.3/2.4/3.0/4.0/Sisyphus
- ALT Linux 2.3/2.4/3.0/4.0/4.1/Sisyphus
- ASP Linux 10/11/12
- Scientific/4.1
- Fedora Core 5/6/7/8/9
- Fedora Core 5/6/7/8/9/10
- OpenSuSe 10/10.1/11
- Mandriva 2005/2006/2007/2008
- MOPSLinux 5.0/6.0
- Mandriva 2005/2006/2007/2008/2009
- MOPSLinux 5.0/6.0/6.1
- Slackware 10.2/11
- Debian 3.1 (Sarge) / 4.0
- Ubuntu 6.06/7.04/7.10/8.04
- Debian 3.1 (Sarge) / 4.0 / 5.0
- Ubuntu 6.06/7.04/7.10/8.04/8.10
- RedHat 9 / MCBC 3.0
......@@ -77,4 +77,4 @@ hostname 'devel' in ~/.ssh/config as alias for cvs.altlinux.ru (typical for join
Please send any questions at lav@etersoft.ru
Vitaly Lipatov, 20 Jul 2008
Vitaly Lipatov, 04 Dec 2008
, () - rpmbs -s ? git
?
+ , APTCONF ,
+ sources.list i586|x86_64, x86_64
+ , () - rpmbs -s ? git
+ : src.rpm
!!
, ,
( )
......@@ -9,7 +12,6 @@
Req ( )
, hasher
src.rpm SRPMS
etersoft-build-functions /usr/share/etersoft-build-utils/functions
:
ALT -
......@@ -19,20 +21,10 @@ pkgrepl.pclinux.2007 -
, ( ALT)
-x ̣ x86_64?
# cvs_update (man cvs?)
%homedir tmp ?
rpm -bE rpm --showrc ?
> >>:) 3. ,
> >>
> >> ,
> >> , apt.conf
> >> .
> >
> > .
>
> rpmgs --help :)
=== ===
......@@ -40,6 +32,7 @@ pkgrepl.pclinux.2007 -
( ,
). , , ݣ .
=== 1.6 ===
- %changelog rpmcs
......@@ -50,7 +43,6 @@ pkgrepl.pclinux.2007 -
--init-root, .in, rpm -i src.rpm, rpmbph ( hasher), .out { }
hasher ??
# - rpm -bE , - .
- : src.rpm
- ,
- / ?
......@@ -67,16 +59,13 @@ pkgrepl.pclinux.2007 -
- pot - echog ( message)
=== 2.0 ===
- /etc/rpm/*functions
- -v ( DEBUG ) - VERBOSE
- TODO:
( -- )
+ apt ,
# - -m rpmbph rpmbsh
- -i -u
- ( )?
# - ?
# - short-circuit -bc -bi :(
# - , -m -r ( -m )
( )
......@@ -99,3 +88,16 @@ $ a=qqq
$ while read l; do a="$l"; done < <(echo "$list")
$ echo $a
line3
> >>:) 3. ,
> >>
> >> ,
> >> , apt.conf
> >> .
> >
> > .
>
> rpmgs --help :)
# - short-circuit -bc -bi :(
#!/bin/sh
. ./etersoft-build-functions
# load common functions, compatible with local and installed script
#. `dirname $0`/../share/eterbuild/functions/common
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then
echo "ginit - initialize repo in git.alt for current project"
echo "Use: ginit without parameters"
exit 1
fi
PROJECTNAME=$(basename `pwd`)
ssh git.alt git-init-db $PROJECTNAME.git
#!/bin/sh
. /etc/rpm/etersoft-build-functions
# load common functions, compatible with local and installed script
#. `dirname $0`/../share/eterbuild/functions/common
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then
echo "gpush - publish current project repo to git.alt"
echo "Use: gpush without parameters"
exit 1
fi
PROJECTNAME=$(basename `pwd`)
git push --all git.alt:packages/$PROJECTNAME.git
git push $@ git.alt:packages/$PROJECTNAME.git
git push --tags git.alt:packages/$PROJECTNAME.git
#> $ git commit -a; A='0.23-alt1'; git tag -s $A; \
......
......@@ -94,9 +94,8 @@ check_locking
echog "Prepare hasher in $HASHERDIR ..."
# there is package names in LISTRPMARGS
UTILPKG="mc"
[ "$USER" = "lav" ] && UTILPKG="mc ms-fonts-ttf"
if [ -n "$TESTMODE" ] ; then
UTILPKG="$UTILPKG XFree86-xauth"
UTILPKG="$UTILPKG XFree86-xauth fonts-ttf-liberation"
else
UTILPKG="$UTILPKG etersoft-build-utils"
fi
......
#!/bin/sh
#!/bin/sh -x
# 2003-2006, 2008 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
......@@ -11,7 +11,7 @@
. $ETERBUILDDIR/functions/hasher
#############################
Usage="Usage: $name [-m -s -u -i -c] spec..."
Usage="Usage: $name [-m -s -u -i -c] src.rpm..."
function mygetopts()
{
name=${0##*/}
......@@ -83,17 +83,23 @@ fi
echog "List of packages: \$LISTNAMES"
if [ -z "${LISTNAMES/^.*spec/}" ] ; then
if [ -z "${LISTNAMES/*spec/}" ] ; then
echo "!!!!!!!!"
fatal "Please use src.rpm as argument, not spec"
fi
echog -n "Checking with sisyphus_check..."
sisyphus_check --no-check=$HASHER_NOCHECK --files $LISTNAMES || fatal "check for sisyphus failed"
echog "OK"
# Skip checking for tar arg
if [ -n "${LISTNAMES/*tar/}" ] ; then
echog -n "Checking with sisyphus_check..."
sisyphus_check --no-check=$HASHER_NOCHECK --files $LISTNAMES || fatal "check for sisyphus failed"
echog "OK"
fi
# export OURAPTCONF with temp. file contains correct path to sources.list
prepare_aptconfig
# TODO: for add $LISTRPMARGS we need skip function for delete "our" params
HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --apt-config=$APTCONF --target $DEFAULTARCH $HASHERARG"
HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --apt-config=$OURAPTCONF --target $DEFAULTARCH $HASHERARG"
if [ "$MENV" != "SS" ] && [ "$MENV" != "DD" ]; then
HASHERARG="--build-args \"--with=build_$MENV\" --build-args \"--with=build_backport\" $HASHERARG"
fi
......
......@@ -28,8 +28,9 @@ BASERELEASE=$(get_release_number $SPECNAME)
if [ "$VENDOR" = "alt" ] ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 0.95"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=rpmbsh
# Change release according to alt policy
set_release $SPECNAME alt0.$MDISTR.$BASERELEASE
# Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N)
set_release $SPECNAME alt$(($BASERELEASE - 1)).$MDISTR.$BASERELEASE
ADDDEF=""
CLEANTEXT=""
else
......
......@@ -121,7 +121,7 @@ function release_check()
{
if [ "$MENV" = "SS" ] || [ "$MENV" = "DD" ] ; then
for i in $@ ; do
if [ -z "${i/*alt0.M[0-9][0-9]*/}" ] ; then
if [ -z "${i/*alt[0-9].M[0-9][0-9]*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for Sisyphus"
fi
......@@ -129,7 +129,7 @@ function release_check()
return
fi
for i in $@ ; do
if [ -n "${i/*alt0.$MENV*/}" ] ; then
if [ -n "${i/*alt[0-9].$MENV*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for $MENV"
fi
......@@ -153,6 +153,12 @@ fi
if [ -n "$SIGN" ]; then
release_check $LISTBUILT
# create tag according to package release
if is_git $SPECDIR ; then
# needed corrent user.name/user.email for get GPG id
gear-create-tag --force
# git push ?
fi
echog "Will try to sign follow packages with GPG: \$LISTBUILT"
cd $RPMDIR/SRPMS
# 1. only rpm command has --addsign 2. do 3 retries
......
......@@ -9,6 +9,8 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
. $ETERBUILDDIR/functions/rpm
. $ETERBUILDDIR/functions/repl
dummy_spec()
{
......@@ -202,6 +204,8 @@ do
s|%_libdir/mono|%_monodir|g" $i
subst "s|%prefix/lib|%_libdir|g
s|%prefix/%_lib|%_libdir|g
s|/usr/%_lib|%_libdir|g
s|%prefix/include|%_includedir|g
s|/usr/include|%_includedir|g
s|/usr/src|%_usrsrc|g
......@@ -276,7 +280,8 @@ do
subst "s|%perl_vendorlib|%perl_vendor_privlib|g
s|%perl_vendorarch|%perl_vendor_archlib|g" $i
subst "s|%_datadir/doc|%_docdir|g" $i
subst "s|%_datadir/doc$|%_docdir|g" $i
subst "s|%_datadir/doc/|%_docdir/|g" $i
subst "s|%_datadir/omf|%_omfdir|g" $i
subst "s|%_defaultdocdir|%_docdir|g" $i
subst "s|%__autoreconf|%autoreconf|g" $i
......@@ -284,6 +289,7 @@ do
subst "s|%rpmcflags|%optflags|g" $i
subst "s|^%clean$||g" $i
subst "s|^%debug_package$||g" $i
subst "s|^rm -rf %buildroot$||g" $i
subst "s|^%defattr(-,root,root)||g" $i
subst "s|^%defattr(644,root,root,755)||g" $i
......
......@@ -11,7 +11,8 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
. $ETERBUILDDIR/functions/rpm
load_mod rpm
load_mod repl
# path to ALT Linux's repositories
REPOSITORY="files/SRPMS obsolete orphaned"
......@@ -162,33 +163,6 @@ fi
test -z "$1" && fatal "Please run with spec/package name"
# Check concrete system
# two params: system, package
if [ -n "$2" ] ; then
NAME=$2
load_systems_list
IDX=`get_system_idx "$1"`
if [ -n "$IDX" ] ; then
check_system $IDX
else
fatal "Unknown system '$1', use rpmgp -s for get list"
fi
exit 0
else
NAME=$1
fi
# Check all systems
if [ -n "$ALLSYSTEM" ] ; then
load_systems_list
# search throw all systems
for ((i=0; i < ${#SYSNAME[*]}; i++)) ; do
echo
check_system $i
done
exit 0
fi
#
# , ( ?),
# -
......@@ -238,6 +212,35 @@ if [ "$1" = "-c" ] ; then
exit 0
fi
# Check concrete system
# two params: system, package
if [ -n "$2" ] ; then
NAME=$2
load_systems_list
IDX=`get_system_idx "$1"`
if [ -n "$IDX" ] ; then
check_system $IDX
else
#fatal "Unknown system '$1', use rpmgp -s for get list"
NAME=
fi
exit 0
else
NAME=$1
fi
# Check all systems
if [ -n "$ALLSYSTEM" ] ; then
load_systems_list
# search throw all systems
for ((i=0; i < ${#SYSNAME[*]}; i++)) ; do
echo
check_system $i
done
exit 0
fi
echo
echo "########################################"
if [ -z "${1/*src.rpm/}" ]
......
......@@ -10,6 +10,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod hasher
make_ordinalbox()
{
......@@ -71,12 +72,6 @@ ORDINALWORKDIR=$OURTMPDIR/WD1
TESTINGWORKDIR=$OURTMPDIR/WD2
ORDINALAPTCONF=$APTCONF
TESTINGAPTCONF=$OURTMPDIR/apt.conf
# Hack: subst patch to sources.list
cat $ORDINALAPTCONF | \
sed -e "s|\"/etc/.*apt/sources.*\"|\"$OURTMPDIR/sources.list\"|g" >$TESTINGAPTCONF
cat $ETERBUILDETC/apt/sources.list.$MENV >$OURTMPDIR/sources.list || fatal ""
HASHERDIR=$HASHERDIR$MENVARG
if [ ! -d $HASHERDIR/repo ] || [ -n "$SKIPTST" ] ; then
......@@ -89,7 +84,10 @@ if [ ! -d $HASHERDIR/repo ] || [ -n "$SKIPTST" ] ; then
exit 0
fi
echo "rpm file:$HASHERDIR/repo/ $DEFAULTARCH hasher" >>$OURTMPDIR/sources.list
# Prepare our confdir
prepare_aptconfig
TESTINGAPTCONF=$OURAPTCONF
echo "rpm file:$HASHERDIR/repo/ $DEFAULTARCH hasher" >>$OURSOURCES
make_ordinalbox
make_testingbox
......
......@@ -29,7 +29,8 @@
# You can uncomment it:
#DEFAULTARCH=i586
#RPMDIR=$HOME/RPM
#APTCONF=/etc/apt/apt.conf
# Use this config
#APTCONFBASE=/etc/apt/apt.conf
#REMOTERPMDIR="~/RPM"
# ,
......
# all known src.rpm repositories (for rpmgp command)
alt ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/files/SRPMS
fedora ftp://mirror.yandex.ru/fedora/linux/releases/9/Everything/source/SRPMS
#fedora ftp://mirror.yandex.ru/fedora/linux/releases/9/Everything/source/SRPMS
#fedora ftp://mirror.yandex.ru/fedora/linux/releases/test/10-Beta/Fedora/source/SRPMS
fedora ftp://mirror.yandex.ru/fedora/linux/releases/10/Fedora/source/SRPMS/
fedora-ccrma http://ccrma.stanford.edu/planetccrma/mirror/fedora/linux/planetccrma/9/SRPMS
mandriva ftp://mirror.yandex.ru/mandriva/official/2008.1/SRPMS/main/release
mandriva-contrib ftp://mirror.yandex.ru/mandriva/official/2008.1/SRPMS/contrib/release
mandriva ftp://mirror.yandex.ru/mandriva/official/2009.0/SRPMS/main/release
mandriva-contrib ftp://mirror.yandex.ru/mandriva/official/2009.0/SRPMS/contrib/release
suse ftp://mirror.yandex.ru/opensuse/distribution/11.0/repo/src-oss/suse/src
suse-edu1 http://opensuse.unixheads.net/repositories/Education:/desktop/openSUSE_10.3/src
suse-edu2 http://www.opensuse-education.org/download/repos/1.0/11.0/suse/src
alt-obsolete ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/obsolete
alt-orphaned ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/orphaned
pld ftp://ftp.pld-linux.org/branches/titanium/PLD/SRPMS/RPMS
rpmfusion http://download1.rpmfusion.org/free/fedora/releases/10/Everything/source/SRPMS/
# for backward compatibility
. /usr/share/eterbuild/functions/common
load_mod rpm
load_mod publish-compat
......@@ -50,6 +50,8 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher
%doc tools/upload-to-alt tools/ls-incoming tools/check_spec.sh
%_bindir/*
%_datadir/eterbuild/
# for backward compatibility (will removed in 2.0)
%dir %_sysconfdir/rpm/
%dir %_sysconfdir/eterbuild/
%dir %_sysconfdir/eterbuild/apt/
%config(noreplace) %_sysconfdir/eterbuild/apt/apt.conf.*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -75,7 +75,7 @@ TARGET=`distr_vendor -p`
VENDOR=`distr_vendor -s`
if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then
APTCONF=${APTCONF/.SS}.$MENV
[ -n "$APTCONF" ] || APTCONF=${APTCONFBASE/.SS}.$MENV
echog "Target ALT Linux system: `get_distr_version $MENV`, use \$APTCONF"
MENVARG="-$MENV"
......@@ -177,3 +177,8 @@ add_changelog_helper()
return $R
}
load_mod()
{
. $ETERBUILDDIR/functions/$1
}
......@@ -16,25 +16,25 @@ OURTMPDIR=$TMPDIR
[ -z "$OURTMPDIR" ] || [ -d "$OURTMPDIR" ] || OURTMPDIR=/tmp
# It can be overrides in config
DEFAULTARCH=i586
[ -n "$DEFAULTARCH" ] || DEFAULTARCH=i586
[ `uname -m` = "x86_64" ] && DEFAULTARCH=`uname -m`
NICE="nice"
RPMBUILD=rpmbuild
# TODO: check for .gear, not .git?
is_git()
{
local DIR=$1
[ -n "$DIR" ] && [ -d "$DIR/.git" ] && return 0
[ -d ".git" ] && return 0
# hack for support spec in some subdir
[ -d "../.git" ] && return 0
[ -d "../.gear" ] && return 0
return 1
}
RPMDIR="$HOME/RPM"
# apt.conf.SS is exists by default
[ -n "$APTCONF" ] || APTCONF=$ETERBUILDETC/apt/apt.conf.SS
[ -n "$APTCONFBASE" ] || APTCONFBASE=$ETERBUILDETC/apt/apt.conf
#OWNERMAIL=`grep "^%packager" ~/.rpmmacros | head -n 1 | sed -e "s/%packager[ \t]*//g"`
OWNERMAIL=`rpm --eval %packager`
......
......@@ -21,11 +21,34 @@ check_locking()
fi
}
# workaround about hard coded path to source.list in apt.conf
# workaround about hard coded path to sources.list in apt.conf
print_tmp_aptconf()
{
test -r "$1" || fatal "$1 is missed"
# Note: /etc/apt and /etc/eterbuild/apt is supported
cat "$1" | \
sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g"
sed -e "s|\"/etc/.*apt/sources.list|\"$OURTMPDIR/sources.list|g"
# sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g"
}
# workaround about hard coded arch in sources.list
print_tmp_sourceslist()
{
local SLIST
test -r "$1" || fatal "$1 is missed"
# Note: /etc/apt and /etc/eterbuild/apt is supported
SLIST=`cat "$1" | \
sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g" | \
grep "apt/sources.list" "$1" | sed -e 's|.*"\(.*\)".*|\1|g'`
test -r "$SLIST" || fatal "'$SLIST' - sources.list path from $1 is missed"
cat "$SLIST" | \
sed -e "s|i586|$DEFAULTARCH|g"
}
prepare_aptconfig()
{
print_tmp_aptconf $APTCONF >$OURTMPDIR/apt.conf.$MENV || fatal "Can't create apt.conf"
print_tmp_sourceslist $APTCONF >$OURTMPDIR/sources.list.$MENV || fatal "Can't create sources.list"
export OURAPTCONF=$OURTMPDIR/apt.conf.$MENV
export OURSOURCES=$OURTMPDIR/sources.list.$MENV
}
......@@ -20,13 +20,24 @@ uni_rpmbuild()
# FIXME: do not override -v
ONEPARAM="--define=_source_payload w9.gzdio"
fi
# TODO: add support for git
if [ "$COMMAND" = "buildreq" ] ; then
$NICE $COMMAND $@
return
fi
if is_git $SPECDIR ; then
[ -f "$SPECNAME" ] || fatal "run uni_rpmbuild with spec as 2nd parameter"
shift # skip spec name
[ -n "$SPECDIR" ] && [ "$SPECDIR" != "." ] && warning "Spec is not in git dir"
$NICE gear --commit --rpmbuild -- $COMMAND "$ONEPARAM" $@
if [ "$MENV" = "SS" ] ; then
$NICE gear --commit --rpmbuild -- $COMMAND "$ONEPARAM" $@
else
# 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 $@
fi
else
$COMMAND "$ONEPARAM" $@
$NICE $COMMAND "$ONEPARAM" $@
fi
[ -n "$VERBOSE" ] && echo "Run $COMMAND $ONEPARAM $@" || :
}
......
......@@ -29,7 +29,7 @@ get_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//")
get_release $1 | sed -e "s/alt//" | sed -e "s/%{_vendor}//" | sed -e "s/eter//" | sed -e "s/%_vendor//"
}
......
......@@ -78,3 +78,5 @@ libgtkmm2-devel|gtkmm24-devel
libpng12|libpng
sysvinit-utils|SysVinit
libltdl-devel|libtool-ltdl-devel
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
. $ETERBUILDDIR/functions/hasher
load_mod hasher
parse_cmd_pre ""
print_tmp_aptconf $APTCONF
echo "-------------------------------"
print_tmp_aptconf /etc/apt/apt.conf.SS
#print_tmp_aptconf /etc/apt/apt.conf.SS
print_tmp_sourceslist $APTCONF
prepare_aptconfig
echo
echo "apt $OURAPTCONF:"
cat $OURAPTCONF
echo
echo "sources $OURSOURCES:"
cat $OURSOURCES
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment