~n3npq/lsb/distribution-checker

« back to all changes in this revision

Viewing changes to package/lsb-dtk-manager.spec.sed

  • Committer: biga
  • Date: 2009-04-24 14:16:44 UTC
  • Revision ID: biga@spidey.linux-foundation.org-20090424141644-7evzd6mjocix7e68
init

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# %{ver}, %{rel}, %{name} provided by Makefile
 
2
%define ver @VERSION@
 
3
%define rel @RELEASE@
 
4
%define name @NAME@
 
5
 
 
6
# LSB Compliant packages require the following in ~/.rpmmacros
 
7
#%_binary_payload       w9.gzdio
 
8
 
 
9
Summary: LSB Distribution Testkit Manager
 
10
Vendor: ISPRAS
 
11
# name, ver, rel are passed in from Makefile so we only have to set them one place
 
12
Name: %{name}
 
13
Version: %{ver}
 
14
Release: %{rel}
 
15
Source: %{name}-%{version}.src.tgz
 
16
License: GPL
 
17
URL: http://www.linuxfoundation.org/en/Downloads
 
18
Group: Development/Tools
 
19
Buildroot: %{_builddir}/%{name}-root
 
20
AutoReqProv: no
 
21
Requires: lsb-setup
 
22
 
 
23
%description
 
24
LSB Distribution Testkit wraps all the current LSB test suites into a
 
25
user-friendly "single LSB test suite" with unified test management and
 
26
analysis capabilities. This facilitates test execution and results analysis
 
27
thus making the LSB tests more attractive for upstream developers as well as
 
28
making certification process technically more inviting.
 
29
 
 
30
%prep
 
31
if [ ! -x /opt/lsb/bin/lsbcc ] ; then
 
32
    printf "lsbcc not found, required for compilation, aborting\n"
 
33
    exit 1
 
34
fi
 
35
 
 
36
%setup
 
37
 
 
38
%build
 
39
# Build ptyshell binary
 
40
export LSBCC_LSBVERSION=3.1
 
41
export CC=/opt/lsb/bin/lsbcc
 
42
#export CFLAGS=-fno-stack-protector
 
43
cd ptyshell && make clean && make && cd -
 
44
 
 
45
# Build man page
 
46
#[ -d man/man1 ] || mkdir -p man/man1
 
47
#pod2man utils/lsb-tef.pl man/man1/lsb-tef.pl.1 -r 'The Linux Foundation' -c '' -n lsb-tef.pl
 
48
#pod2man man/man1/dtk-manager.pod man/man1/dtk-manager.1 -r 'The Linux Foundation' -c '' -n dtk-manager
 
49
 
 
50
%install
 
51
 
 
52
rm -rf $RPM_BUILD_ROOT/opt/lsb/test/manager
 
53
mkdir -p $RPM_BUILD_ROOT/opt/lsb/test/manager
 
54
cp -r LICENSE README bin utils webui $RPM_BUILD_ROOT/opt/lsb/test/manager
 
55
#cp -rf man $RPM_BUILD_ROOT/opt/lsb
 
56
#rm $RPM_BUILD_ROOT/opt/lsb/man/man1/dtk-manager.pod
 
57
mkdir -p $RPM_BUILD_ROOT/opt/lsb/test/manager/ptyshell
 
58
cp ptyshell/ptyshell $RPM_BUILD_ROOT/opt/lsb/test/manager/ptyshell
 
59
rm -rf $RPM_BUILD_ROOT/var/opt/lsb/test/manager
 
60
mkdir -p $RPM_BUILD_ROOT/var/opt/lsb/test/manager/manifest
 
61
cp Manifest $RPM_BUILD_ROOT/var/opt/lsb/test/manager/manifest
 
62
mkdir -p $RPM_BUILD_ROOT/var/opt/lsb/test/manager/problem_db
 
63
cp problem_db $RPM_BUILD_ROOT/var/opt/lsb/test/manager/problem_db
 
64
mkdir -p $RPM_BUILD_ROOT/etc/opt/lsb/test/manager
 
65
cp config/dtk-server.conf.default $RPM_BUILD_ROOT/etc/opt/lsb/test/manager
 
66
 
 
67
%files
 
68
%defattr(-,root,root)
 
69
/opt/lsb/test/manager
 
70
/var/opt/lsb/test/manager
 
71
/etc/opt/lsb/test/manager
 
72
%doc /opt/lsb/test/manager/README
 
73
#%doc /opt/lsb/man/man1/lsb-tef.pl.1
 
74
#%doc /opt/lsb/man/man1/dtk-manager.1
 
75
 
 
76
%post
 
77
echo "Installed successfully."
 
78
RESULT=0
 
79
 
 
80
if [ ! -x /usr/bin/perl ] ; then
 
81
        echo
 
82
        echo "Warning: Couldn't find /usr/bin/perl."
 
83
        echo "Perl is required for LSB DTK Manager. Please, install it"
 
84
        echo "using the tools provided by your distro."
 
85
        echo
 
86
        RESULT=1
 
87
fi
 
88
 
 
89
if ! which lsb_release >/dev/null 2>&1; then
 
90
        echo
 
91
        echo "Warning: Couldn't find the required tool: lsb_release."
 
92
        echo "lsb_release should be always present for a LSB compliant distro."
 
93
        echo "You could install lsb_release and other LSB components using"
 
94
        echo "the tools provided by your distro."
 
95
        echo
 
96
        RESULT=1
 
97
fi
 
98
 
 
99
if lsb_release 2>&1 | grep "No LSB modules" >/dev/null 2>&1; then
 
100
        echo
 
101
        echo "Warning: No LSB modules are available."
 
102
        echo "You could install LSB modules using the tools provided by"
 
103
        echo "your distro."
 
104
        echo
 
105
        RESULT=1
 
106
fi
 
107
 
 
108
if ! which Xvfb >/dev/null 2>&1; then
 
109
        echo
 
110
        echo "Warning: Couldn't find the required tool: Xvfb (X Virtual Frame Buffer)."
 
111
        echo "Xvfb is required for X11 tests for LSB 3.0 and 3.1. If you are going"
 
112
        echo "to run these tests or to get certified for these LSB versions,"
 
113
        echo "you should install Xvfb using the tools provided by your distribution."
 
114
        echo
 
115
        RESULT=1
 
116
fi
 
117
 
 
118
# put out a message
 
119
echo "__________________________________________________________________________"
 
120
echo "ATTENTION!"
 
121
echo
 
122
echo "This tool runs as the root user and installs packages on its own!"
 
123
echo "Therefore it can do pretty much harm if it gets out of control."
 
124
echo "We have tried to make the script reasonably safe but there is no warranty."
 
125
echo "Use it at YOUR OWN RISK only, and only if you know what you are doing."
 
126
echo
 
127
echo "Some setuid and setgid binaries may be generated and left behind after"
 
128
echo "execution of the test suites (especially if certain tests fail)."
 
129
echo "You should not install this package on production systems"
 
130
echo "or in situations where local users are not completely trusted."
 
131
echo
 
132
echo "PLEASE DO NOT RUN IT ON A MACHINE THAT HOLDS IMPORTANT DATA, OR PROVIDES"
 
133
echo "IMPORTANT SERVICES!"
 
134
echo "__________________________________________________________________________"
 
135
echo
 
136
echo "LSB Distribution Testkit Manager has been installed to"
 
137
echo "/opt/lsb/test/manager."
 
138
if [ $RESULT -ne 0 ]; then
 
139
        echo
 
140
        echo "There were warnings."
 
141
fi
 
142
echo
 
143
echo "Use /opt/lsb/test/manager/bin/lsb-dtk-start.pl to run LSB DTK Manager."
 
144
echo
 
145
echo "Read more info at"
 
146
echo "http://ispras.linuxfoundation.org/index.php/About_LSB_Distribution_Testkit_Manager"
 
147
echo
 
148
 
 
149
# End of the postinstall script.
 
150
 
 
151
%postun
 
152
if [ $1 = "0" -o $1 = "remove" ]; then
 
153
        echo " LSB Distribution Testkit Manager has been uninstalled."
 
154
        if [ -d /var/opt/lsb/test/manager ]; then
 
155
                echo " There are files left in /var/opt/lsb/test/manager. You could delete them all."
 
156
        fi
 
157
fi
 
158
 
 
159
%clean
 
160
if [ -e "${RPM_BUILD_ROOT}"  -a "${RPM_BUILD_ROOT}" != "/" ]; then
 
161
    rm -rf ${RPM_BUILD_ROOT}
 
162
fi