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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# rpmbuild.at: test rpmbuild
#
# Copyright (C) 2007 Ralf Corsépius <corsepiu@fedoraproject.org>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
AT_BANNER([RPM build])
# ------------------------------
# Check if rpmbuild -ba *.spec works
AT_SETUP([rpmbuild -ba *.spec])
AT_KEYWORDS([build])
AT_CHECK([
rm -rf ${TOPDIR}
AS_MKDIR_P(${TOPDIR}/SOURCES)
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
run rpmbuild \
-ba "${abs_srcdir}"/data/SPECS/hello.spec
],
[0],
[ignore],
[ignore])
AT_CLEANUP
# ------------------------------
# Check if rpmbuild -ba *.spec
# honours a relative topdir with --root
#AT_SETUP([rpmbuild --root=... -ba *.spec])
#AT_KEYWORDS([build])
#AT_XFAIL_IF([test $RPM_XFAIL -gt 0])
#AT_CHECK([
#rm -rf ${TOPDIR}
#AS_MKDIR_P(${TOPDIR}/SOURCES)
#
#cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz ${TOPDIR}/SOURCES
#
#run rpmbuild \
# --root="${abs_builddir}"/testing \
# -ba "${abs_srcdir}"/data/SPECS/hello.spec
#],
#[0],
#[ignore],
#[ignore])
#AT_CLEANUP
# ------------------------------
# Check if rpmbuild --rebuild *.src.rpm works
AT_SETUP([rpmbuild --rebuild])
AT_KEYWORDS([build])
AT_CHECK([
rm -rf ${TOPDIR}
run rpmbuild \
--rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm
],
[0],
[ignore],
[ignore])
AT_CLEANUP
# ------------------------------
# Check if rpmbuild --rebuild *.src.rpm
# honours a relative topdir with --root
#AT_SETUP([rpmbuild --root=... --rebuild])
#AT_KEYWORDS([build])
#AT_XFAIL_IF([test $RPM_XFAIL -gt 0])
#AT_CHECK([
#rm -rf ${TOPDIR}
#
#run rpmbuild \
# --root="${abs_builddir}"/testing \
# --rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm
#],
#[0],
#[ignore],
#[ignore])
#AT_CLEANUP
# ------------------------------
# Check if tar unpacking works
AT_SETUP([rpmbuild -tb <tar with bad spec>])
AT_KEYWORDS([build])
AT_CHECK([
rm -rf ${TOPDIR}
run rpmbuild \
-tb "${RPMDATA}/SOURCES/hello-1.0.tar.gz"
],
[1],
[ignore],
[error: line 5: Unknown tag: Serial: 1
])
AT_CLEANUP
# ------------------------------
# Check if tar build works
# TODO: test that the rpms are actually created...
AT_SETUP([rpmbuild -tb])
AT_KEYWORDS([build])
AT_CHECK([
rm -rf ${TOPDIR}
run rpmbuild \
-ta "${RPMDATA}/SOURCES/hello-2.0.tar.gz"
],
[0],
[ignore],
[ignore])
AT_CLEANUP
|