michael@82: ## michael@82: ## x11.spec -- OpenPKG RPM Package Specification michael@82: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@82: ## michael@82: ## Permission to use, copy, modify, and distribute this software for michael@82: ## any purpose with or without fee is hereby granted, provided that michael@82: ## the above copyright notice and this permission notice appear in all michael@82: ## copies. michael@82: ## michael@82: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@82: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@82: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@82: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@82: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@82: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@82: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@82: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@82: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@82: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@82: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@82: ## SUCH DAMAGE. michael@82: ## michael@82: michael@82: # package information michael@82: Name: x11 michael@82: Summary: Information Resource for X11 michael@82: URL: - michael@82: Vendor: The OpenPKG Project michael@82: Packager: OpenPKG Foundation e.V. michael@82: Distribution: OpenPKG Community michael@82: Class: BASE michael@82: Group: Meta michael@82: License: PD michael@82: Version: 0 michael@83: Release: 20090106 michael@82: michael@82: # list of sources michael@82: Source0: rc.x11 michael@82: michael@82: # build information michael@82: Prefix: %{l_prefix} michael@82: BuildRoot: %{l_buildroot} michael@82: BuildPreReq: OpenPKG, openpkg >= 20060823 michael@82: PreReq: OpenPKG, openpkg >= 20060823 michael@82: AutoReq: no michael@82: AutoReqProv: no michael@82: Provides: X11 michael@82: michael@82: %description michael@82: This is the information resource package for X11. michael@82: michael@82: %track michael@82: michael@82: %prep michael@82: michael@82: %build michael@82: michael@82: %install michael@82: rm -rf $RPM_BUILD_ROOT michael@82: michael@82: x11_bindir="" michael@82: x11_incdir="" michael@82: x11_libdir="" michael@82: michael@82: # search for binary directory michael@82: for bindir in \ michael@82: `echo $PATH | sed -e 's/:/ /g'` \ michael@82: /usr/openwin/bin \ michael@82: /usr/[xX]/bin \ michael@82: /usr/[xX]11*/bin \ michael@82: /usr/[xX]386/bin \ michael@82: /usr/[xX]ree86/bin \ michael@82: /usr/bin/[xX]11* \ michael@82: /usr/local/[xX]/bin \ michael@82: /usr/local/[xX]11*/bin \ michael@82: /usr/local/[xX]386/bin \ michael@82: /usr/local/[xX]ree86/bin \ michael@82: /usr/athena/bin \ michael@82: ; do michael@82: if [ -f "$bindir/xmkmf" ]; then michael@82: x11_bindir="$bindir" michael@82: break michael@82: fi michael@82: done michael@82: michael@82: # search for include directory michael@82: for incdir in \ michael@82: /usr/openwin/include \ michael@90: /usr/openwin/share/include \ michael@82: /usr/[xX]/include \ michael@82: /usr/[xX]11*/include \ michael@82: /usr/[xX]386/include \ michael@82: /usr/[xX]ree86/include \ michael@82: /usr/include \ michael@82: /usr/include/[xX] \ michael@82: /usr/include/[xX]11* \ michael@82: /usr/include/[xX]386 \ michael@82: /usr/include/[xX]free86 \ michael@82: /usr/local/include \ michael@82: /usr/local/include/[xX] \ michael@82: /usr/local/include/[xX]11* \ michael@82: /usr/local/include/[xX]386 \ michael@82: /usr/local/include/[xX]free86 \ michael@82: /usr/local/[xX]/include \ michael@82: /usr/local/[xX]11*/include \ michael@82: /usr/local/[xX]386/include \ michael@82: /usr/local/[xX]ree86/include \ michael@82: /usr/athena/include \ michael@82: /usr/unsupported/include \ michael@82: ; do michael@82: if [ -f "$incdir/X11/Intrinsic.h" ]; then michael@82: x11_incdir="$incdir" michael@90: if [ -d "/usr/X11/include" ]; then michael@90: x11_incdir="$x11_incdir /usr/X11/include" michael@83: fi michael@82: break michael@82: fi michael@82: done michael@82: michael@82: # search for library directory michael@82: for libdir in \ michael@82: /usr/openwin/lib \ michael@82: /usr/openwin/share/lib \ michael@82: /usr/[xX]/lib64 \ michael@82: /usr/[xX]/lib \ michael@82: /usr/[xX]11*/lib64 \ michael@82: /usr/[xX]11*/lib \ michael@82: /usr/[xX]386/lib \ michael@82: /usr/[xX]ree86/lib \ michael@82: /usr/shlib \ michael@82: /lib64 \ michael@82: /lib \ michael@82: /usr/lib64 \ michael@82: /usr/lib \ michael@82: /usr/lib/[xX] \ michael@82: /usr/lib/[xX]11* \ michael@82: /usr/lib/[xX]386 \ michael@82: /usr/lib/[xX]free86 \ michael@82: /usr/local/lib \ michael@82: /usr/local/lib/[xX] \ michael@82: /usr/local/lib/[xX]11* \ michael@82: /usr/local/lib/[xX]386 \ michael@82: /usr/local/lib/[xX]free86 \ michael@82: /usr/local/[xX]/lib \ michael@82: /usr/local/[xX]11*/lib \ michael@82: /usr/local/[xX]386/lib \ michael@82: /usr/local/[xX]ree86/lib \ michael@82: /usr/athena/lib \ michael@82: /usr/unsupported/lib \ michael@82: ; do michael@82: for ext in a so sl; do michael@82: if [ -f "$libdir/libXt.$ext" ]; then michael@82: x11_libdir="$libdir" michael@82: break michael@82: fi michael@82: done michael@82: if [ ".$x11_libdir" != . ]; then michael@82: break michael@82: fi michael@82: done michael@82: michael@82: # make sure everything was found michael@82: if [ ".$x11_bindir" = . ] ||\ michael@82: [ ".$x11_incdir" = . ] ||\ michael@82: [ ".$x11_libdir" = . ]; then michael@82: set +x michael@82: ( echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!" michael@82: echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!" michael@82: echo "" michael@82: echo "We found out:" michael@82: echo "" michael@82: echo " X11 Binary Directory: ${x11_bindir}" michael@82: echo " X11 Include Directory: ${x11_incdir}" michael@82: echo " X11 Library Directory: ${x11_libdir}" michael@82: echo "" michael@82: echo "Unfortunately, some information is missing here." michael@82: echo "" michael@82: echo "Be sure to have all system X11 components installed" michael@82: echo "in standard locations before building this package!" michael@82: echo "" michael@82: echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!" michael@82: echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!" michael@82: ) | %{l_rpmtool} msg -b -t error michael@82: exit 1 michael@82: fi michael@82: michael@82: # install rc file michael@82: %{l_shtool} mkdir -f -p -m 755 \ michael@82: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@82: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@82: -e "s;@x11_bindir@;${x11_bindir};g" \ michael@82: -e "s;@x11_incdir@;${x11_incdir};g" \ michael@82: -e "s;@x11_libdir@;${x11_libdir};g" \ michael@82: %{SOURCE rc.x11} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@82: michael@82: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@82: michael@82: %files -f files michael@82: michael@82: %clean michael@82: rm -rf $RPM_BUILD_ROOT michael@82: