Wed, 14 Jan 2009 14:02:00 +0100
Import package vendor original specs for necessary manipulations.
1 ##
2 ## x11.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package information
25 Name: x11
26 Summary: Information Resource for X11
27 URL: -
28 Vendor: The OpenPKG Project
29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community
31 Class: BASE
32 Group: Meta
33 License: PD
34 Version: 0
35 Release: 20080101
37 # list of sources
38 Source0: rc.x11
40 # build information
41 Prefix: %{l_prefix}
42 BuildRoot: %{l_buildroot}
43 BuildPreReq: OpenPKG, openpkg >= 20060823
44 PreReq: OpenPKG, openpkg >= 20060823
45 AutoReq: no
46 AutoReqProv: no
47 Provides: X11
49 %description
50 This is the information resource package for X11.
52 %track
54 %prep
56 %build
58 %install
59 rm -rf $RPM_BUILD_ROOT
61 x11_bindir=""
62 x11_incdir=""
63 x11_libdir=""
65 # search for binary directory
66 for bindir in \
67 `echo $PATH | sed -e 's/:/ /g'` \
68 /usr/openwin/bin \
69 /usr/[xX]/bin \
70 /usr/[xX]11*/bin \
71 /usr/[xX]386/bin \
72 /usr/[xX]ree86/bin \
73 /usr/bin/[xX]11* \
74 /usr/local/[xX]/bin \
75 /usr/local/[xX]11*/bin \
76 /usr/local/[xX]386/bin \
77 /usr/local/[xX]ree86/bin \
78 /usr/athena/bin \
79 ; do
80 if [ -f "$bindir/xmkmf" ]; then
81 x11_bindir="$bindir"
82 break
83 fi
84 done
86 # search for include directory
87 for incdir in \
88 /usr/openwin/include \
89 /usr/openwin/share/include \
90 /usr/[xX]/include \
91 /usr/[xX]11*/include \
92 /usr/[xX]386/include \
93 /usr/[xX]ree86/include \
94 /usr/include \
95 /usr/include/[xX] \
96 /usr/include/[xX]11* \
97 /usr/include/[xX]386 \
98 /usr/include/[xX]free86 \
99 /usr/local/include \
100 /usr/local/include/[xX] \
101 /usr/local/include/[xX]11* \
102 /usr/local/include/[xX]386 \
103 /usr/local/include/[xX]free86 \
104 /usr/local/[xX]/include \
105 /usr/local/[xX]11*/include \
106 /usr/local/[xX]386/include \
107 /usr/local/[xX]ree86/include \
108 /usr/athena/include \
109 /usr/unsupported/include \
110 ; do
111 if [ -f "$incdir/X11/Intrinsic.h" ]; then
112 x11_incdir="$incdir"
113 break
114 fi
115 done
117 # search for library directory
118 for libdir in \
119 /usr/openwin/lib \
120 /usr/openwin/share/lib \
121 /usr/[xX]/lib64 \
122 /usr/[xX]/lib \
123 /usr/[xX]11*/lib64 \
124 /usr/[xX]11*/lib \
125 /usr/[xX]386/lib \
126 /usr/[xX]ree86/lib \
127 /usr/shlib \
128 /lib64 \
129 /lib \
130 /usr/lib64 \
131 /usr/lib \
132 /usr/lib/[xX] \
133 /usr/lib/[xX]11* \
134 /usr/lib/[xX]386 \
135 /usr/lib/[xX]free86 \
136 /usr/local/lib \
137 /usr/local/lib/[xX] \
138 /usr/local/lib/[xX]11* \
139 /usr/local/lib/[xX]386 \
140 /usr/local/lib/[xX]free86 \
141 /usr/local/[xX]/lib \
142 /usr/local/[xX]11*/lib \
143 /usr/local/[xX]386/lib \
144 /usr/local/[xX]ree86/lib \
145 /usr/athena/lib \
146 /usr/unsupported/lib \
147 ; do
148 for ext in a so sl; do
149 if [ -f "$libdir/libXt.$ext" ]; then
150 x11_libdir="$libdir"
151 break
152 fi
153 done
154 if [ ".$x11_libdir" != . ]; then
155 break
156 fi
157 done
159 # make sure everything was found
160 if [ ".$x11_bindir" = . ] ||\
161 [ ".$x11_incdir" = . ] ||\
162 [ ".$x11_libdir" = . ]; then
163 set +x
164 ( echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
165 echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
166 echo ""
167 echo "We found out:"
168 echo ""
169 echo " X11 Binary Directory: ${x11_bindir}"
170 echo " X11 Include Directory: ${x11_incdir}"
171 echo " X11 Library Directory: ${x11_libdir}"
172 echo ""
173 echo "Unfortunately, some information is missing here."
174 echo ""
175 echo "Be sure to have all system X11 components installed"
176 echo "in standard locations before building this package!"
177 echo ""
178 echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
179 echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
180 ) | %{l_rpmtool} msg -b -t error
181 exit 1
182 fi
184 # install rc file
185 %{l_shtool} mkdir -f -p -m 755 \
186 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
187 %{l_shtool} install -c -m 755 %{l_value -s -a} \
188 -e "s;@x11_bindir@;${x11_bindir};g" \
189 -e "s;@x11_incdir@;${x11_incdir};g" \
190 -e "s;@x11_libdir@;${x11_libdir};g" \
191 %{SOURCE rc.x11} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
193 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
195 %files -f files
197 %clean
198 rm -rf $RPM_BUILD_ROOT