summaryrefslogtreecommitdiff
path: root/pkg/mkpkg.linux
blob: 2d110416915f29fa4b876130e7d7284c8f49918d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#! /bin/sh

# Time-stamp:        "2011-10-07 16:22:48 bkorb"
##
##  This file is part of AutoGen.
##  AutoGen Copyright (c) 1992-2012 by Bruce Korb - all rights reserved
##
##  AutoGen is free software: you can redistribute it and/or modify it
##  under the terms of the GNU General Public License as published by the
##  Free Software Foundation, either version 3 of the License, or
##  (at your option) any later version.
##
##  AutoGen is distributed in the hope that it will be useful, but
##  WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
##  See the GNU General Public License for more details.
##
##  You should have received a copy of the GNU General Public License along
##  with this program.  If not, see <http://www.gnu.org/licenses/>.

case "${VERBOSE}" in
"" | f* | F* | n* | N* )
   VERBOSE=false ;;
*) VERBOSE=true  ; set -x ;;
esac
export VERBOSE

eval "`egrep '^AG_' ${top_srcdir}/VERSION`" > /dev/null

## Set directories in case they are relative paths
##
builddir=`pwd`
top_srcdir=`cd ${top_srcdir} > /dev/null ; pwd`
srcdir=`cd ${srcdir} > /dev/null ; pwd`

cd ${top_builddir}
top_builddir=`pwd`

rm -rf ./AGPKG
mkdir AGPKG
cd AGPKG
HOME=`pwd`

mkdir -p BUILD SOURCES SPECS RPMS SRPMS

[ -f ../autogen-${AG_VERSION}.tar.gz ] || (
  cd ..
  ${MAKE} dist || exit 1
) || exit 1

ln ../autogen-${AG_VERSION}.tar.gz SOURCES/.
printf "\n\nPACKAGING RPM FOR LINUX\n\n"

cd ${builddir}
AG_VERSION=`echo ${AG_VERSION} | sed 's,\.,-,g'`
specfile=autogen-${AG_VERSION}.spec
agargs="-L ${srcdir} -L ${top_srcdir}/autoopts"
agargs="${agargs} -T spec.tpl -b autogen-${AG_VERSION} --writable"
${AGexe} ${agargs} ${top_srcdir}/agen5/opts.def || exit 1

cd ${HOME}

echo "%_tmppath ${top_builddir}/AGPKG/BUILD
%_topdir $PWD" > .rpmmacros

cat > .rpmrc <<- _EOF_

	optflags: i386 -O3 -march=i486 -mcpu=i686
	optflags: i486 -O3 -march=i486
	optflags: i586 -O3 -march=i586 -mcpu=i686 -fmessage-length=0
	optflags: i686 -O3 -march=i686 -mcpu=i686
	optflags: athlon -O3 -march=athlon
	optflags: ia64 -O3
	optflags: x86_64 -O3
	optflags: amd64 -O3
	optflags: ia32e -O3

	_EOF_

RPM_OPT_FLAGS=-O3 rpmbuild -ba ${builddir}/${specfile} || exit 1
ln `find . -type f -name '*.rpm'` ${builddir}/.
cd ${builddir}
rm -rf ${HOME}
${VERBOSE} || ls -l *.rpm
:

## Local Variables:
## mode: shell-script
## indent-tabs-mode: nil
## sh-indentation: 2
## sh-basic-offset: 2
## End:
## end of mkpkg.linux