IGNOREPATH=/var:/etc:/home:/dev:/boot:/root:/tmp:/usr:/bin:/sbin:/mnt STRIPLIB=y STRIPBIN=y VERSION=6.7.0 PROGNAME="x11 $VERSION" DESC="\ x11 (X11 base package) \n\ \n\ This is the base package for X11, and provides the required binaries, \n\ shared libraries, and support files (except fonts) to run X on Linux." BUILD=1 MAINTAINER="Mark Post " SOURCE=ftp://ftp.x.org/pub/X11R6.7/tars/ PKGNAME=x11-$VERSION-s390-$BUILD TAG=ADD compile() { GLIDE=YES tar -yxvf $CWD/X11R${VERSION}-src1.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src2.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src3.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src4.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src5.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src6.tar.bz2 tar -yxvf $CWD/X11R${VERSION}-src7.tar.bz2 cd xc/ chown -R root.root . zcat $CWD/site.def.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E zcat $CWD/Xlib.h.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E # zcat $CWD/xclock.glibc.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E zcat $CWD/linux.cf.zlib.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E zcat $CWD/X11R6.7.0-VeraIt.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E zcat $CWD/xorgconfig.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E zcat $CWD/x11.libxf86config-monitor-freq.diff.gz | patch -p1 --backup --verbose --suffix=.orig -E # cat $CWD/linux390.linux.cf.diff | patch -p1 --verbose # Fix sloppiness: find . -type f -name configure -exec chmod 755 {} \; find . -type f -name mkinstalldirs -exec chmod 755 {} \; # Set various compile defaults in host.def: cat << EOF > config/cf/host.def /* * By default, the sample config files for xinit, xdm and xfs are installed * only when there is no pre-existing version installed. Uncommenting the * following lines will force the sample versions to be installed even if * it means over-writing existing versions. */ #define InstallXinitConfig YES #define InstallXdmConfig YES #define InstallFSConfig YES /* Other Slackware defaults */ #define FSUseSyslog YES #define HasPam NO #define UseUtempter YES #define HasZlib YES #define SharedLibGlu YES /* Build static libs, too */ #define ForceNormalLib YES /* Let X provide freetype2 at first, or it might not build correctly */ /* Later we can replace this with a newer version (if it passes our test suite) */ #define BuildFreetype2 YES /* We use our own expat */ #define HasExpat YES /* We will allow X to build fontconfig, but will later upgrade it. */ /* #define HasFontconfig YES */ /* These are just examples if you use Glide... */ /* #define HasGlide3 YES */ /* #define Glide3IncDir /usr/include/glide3 */ EOF # If we have the precompiled fonts, use those: if [ -r $CWD/fonts.tar.bz2 ]; then cat << EOF >> config/cf/host.def /* Don't build the fonts, as we've already got them */ #define BuildFonts NO EOF mkdir -p /usr/X11R6/lib/X11 ( cd /usr/X11R6/lib/X11 tar xyvf $CWD/fonts.tar.bz2 ) # We'll do this for the package directory in the install section else # otherwise build the fonts from source cat << EOF >> config/cf/host.def /* Build the X fonts from source */ #define BuildFonts YES EOF fi if [ "$GLIDE" = "YES" ]; then # This edits host.def to add HasGlide3. You'll need to install the a DRI capable # version of Glide for your video card class (voodoo3/banshee, or voodoo4/5), then the # tdfx DRI module will be built for that card. cat << EOF >> config/cf/host.def #define HasGlide3 YES #define Glide3IncDir /usr/include/glide3 EOF fi # pkgconfig files (like alocal files) are best placed in a single location, like /usr/lib/pkgconfig. # We'll repeat the same process for the package directory during the install section # First make sure the pkgconfig directories exist: mkdir -p /usr/lib/pkgconfig /usr/X11R6/lib/pkgconfig # Then, move any existing files. This may (and probably will) produce an error if # /usr/X11R6/lib/pkgconfig is empty, so we'll silence stderr: mv /usr/X11R6/lib/pkgconfig/* /usr/lib/pkgconfig 2> /dev/null # Finally, make a link from the old location to the system-wide one: ( cd /usr/X11R6/lib ; rm -rf pkgconfig ) ( cd /usr/X11R6/lib ; ln -sf ../../lib/pkgconfig . ) # It's VERY important to build freetype2 ourselves first (or some functions are left # out), but also to use the X supplied sources. # # Step one is to remove existing freetype2 cruft: rm -rf /usr/include/freetype2 \ /usr/X11R6/include/freetype2 \ /usr/X11R6/include/ft2build.h \ /usr/lib/libfreetype.* \ /usr/X11R6/lib/libfreetype.* # It seems prudent to move this into /usr rather than /usr/X11R6, as *many* source bits # won't find ft2build.h in /usr/X11R6/include without some patching. # Therefore, --prefix=/usr must be the ad-hoc standard. Another # rationale: /usr is also the prefix for freetype1 (for as long as that sticks around), # and putting them in different prefixes causes problems. ( cd extras/freetype2 CFLAGS=-O2 make setup CFG="--prefix=/usr \ --build=s390-slackware-linux \ --host=s390-slackware-linux \ --target=s390-slackware-linux" make # This only needs to go to the main system for now make install ) ldconfig # This shouldn't be needed (apps should pick up -I/usr/include/freetype2 from # `freetype-config --cflags` while compiling), but it's so often reported as a bug that # I'll give in to the point. Now that Freetype1 is pretty much gone having this link # shouldn't hurt anything. Try not to rely on it, though. ( cd /usr/include rm -rf freetype ln -sf freetype2/freetype . ) # Build and install X: make World -j2 -i CDEBUGFLAGS=-O2 } install() { cd $TMP/xc # Some things need to be done before the actual install happens if [ -r $CWD/fonts.tar.bz2 ]; then mkdir -p /package-x11/usr/X11R6/lib/X11 ( cd /package-x11/usr/X11R6/lib/X11 tar xyvf $CWD/fonts.tar.bz2 ) fi # Repeat the process of consolidating the pkgconfig stuff for the package directory # First make sure the pkgconfig directories exist: mkdir -p /package-x11/usr/lib/pkgconfig /package-x11/usr/X11R6/lib/pkgconfig # Then, move any existing files. This will produce an error since # /package-x11/usr/X11R6/lib/pkgconfig is empty, so we'll silence stderr: mv /package-x11/usr/X11R6/lib/pkgconfig/* /package-x11/usr/lib/pkgconfig 2> /dev/null # Finally, make a link from the old location to the system-wide one: ( cd /package-x11/usr/X11R6/lib ; rm -rf pkgconfig ) ( cd /package-x11/usr/X11R6/lib ; ln -sf ../../lib/pkgconfig . ) make -i install DESTDIR=/package-x11 make -i install.man DESTDIR=/package-x11 # Save the fonts so we don't need to build them the next time. if [ ! -r $CWD/fonts.tar.bz2 ]; then ( cd /package-x11/usr/X11R6/lib/X11/fonts find . -type f | xargs chmod 644 ) ( cd /package-x11/usr/X11R6/lib/X11 # tar -cyvf $CWD/fonts.tar.bz2 fonts ) fi # OK, now we must spam your development box to ensure that the our rebuild of # fontconfig links against the correct libraries. We'll also be doing this # with the freetype rebuild. It saves many problems that could crop up with # the compile, and besides, that's what a development box is for. It should # be disposable. :-) make install ldconfig # ( cd /package-x11/usr/X11R6/lib/X11/fonts/misc # LD_LIBRARY_PATH=$TMP/xc/exports/lib:/usr/local/lib \ # /package-x11/usr/X11R6/bin/mkfontscale -b -s -l \ # -e /package-x11/usr/X11R6/lib/X11/fonts/encodings \ # -e /package-x11/usr/X11R6/lib/X11/fonts/encodings/large . # ) # Just to be on the safe side, we should provide Compose files where # they are missing, as it's been known to cause a crash. for dir in /package-x11/usr/X11R6/lib/X11/locale/* ; do if [ -d $dir ]; then if [ -r $dir/XI18N_OBJS -o -r $dir/XLC_LOCALE ]; then if [ ! -r $dir/Compose ]; then NAME=`basename $dir` CAPN=`echo $NAME | tr [a-z] [A-Z]` cat << EOF > $dir/Compose # # $CAPN Compose Sequence # # Sequence Definition # # \$X11: xc/nls/Compose/$NAME,v 1.3 `date` volkerdi Exp $ # # This file currently has no entries. It appears that a compose file (even # just an empty one) is required for the appropriate keysyms to work for # this encoding. # # Means # Special Character # End of Sequence Definition EOF fi fi fi done # These are currently broken with Qt, but we'll install them anyway. # Someday they might work in Konsole again. mkdir -p /package-x11/usr/X11R6/lib/X11/fonts/misc cp -a $CWD/linux8x16.pcf.gz /package-x11/usr/X11R6/lib/X11/fonts/misc/linux8x16.pcf.gz cp -a $CWD/linux8x8.pcf.gz /package-x11/usr/X11R6/lib/X11/fonts/misc/linux8x8.pcf.gz # Don't need this rm -f /usr/X11R6/lib/X11/config/host.def rm -f /package-x11/usr/X11R6/lib/X11/config/host.def rm -f /usr/X11R6/lib/libz.a rm -f /package-x11/usr/X11R6/lib/libz.a # mv /package-x11/usr/X11R6/lib/libfreetype.* /package-x11/usr/lib/ # rm -f /package-x11/usr/X11R6/bin/freetype-config # rm -f /package-x11/usr/include/GL cp -a $CWD/xinit/README.Xmodmap /package-x11/etc/X11/xinit/README.Xmodmap mv /package-x11/etc/X11/xinit/xinitrc /package-x11/etc/X11/xinit/xinitrc.twm mkdir -p /package-x11/var/log/setup cp -a $CWD/setup.05.fontconfig /package-x11/var/log/setup/setup.05.fontconfig chmod 755 /package-x11/var/log/setup/setup.05.fontconfig cp -a /package-x11/etc/X11/xdm/Xsession /package-x11/etc/X11/xdm/Xsession.orig cp -a /package-x11/etc/X11/xdm/Xsetup_0 /package-x11/etc/X11/xdm/Xsetup_0.orig cp -p $CWD/xdm/Xsession /package-x11/etc/X11/xdm/Xsession cp -p $CWD/xdm/Xsetup_0 /package-x11/etc/X11/xdm/Xsetup_0 # Treat some of these as config files: mv /package-x11/etc/X11/xdm/Xsession /package-x11/etc/X11/xdm/Xsession.new mv /package-x11/etc/X11/xdm/xdm-config /package-x11/etc/X11/xdm/xdm-config.new mv /package-x11/etc/X11/xdm/Xservers /package-x11/etc/X11/xdm/Xservers.new # We'll use the encodings on the system, so hopefully they are the right ones... ( cd /package-x11/usr/X11R6/lib/X11/fonts/misc # mkfontscale -b -s -l mkfontdir \ -e /usr/X11R6/lib/X11/fonts/encodings \ -e /usr/X11R6/lib/X11/fonts/encodings/large . ) export ARCH=s390 # Replace freetype2: ( cd $CWD ./freetype2.build ldconfig DESTDIR=/package-x11 ./freetype2.build ) # Replace fontconfig: ( cd $CWD ./fontconfig.build ldconfig DESTDIR=/package-x11 ./fontconfig.build ) ( cd /package-x11/usr/X11R6/man/ for dir in 1 3 5 7; do ( cd man$dir rm -rf *.gz ls | xargs gzip -9 # needed in the man3 directory because there are too many files! ) done ) # Gloss over some sloppy forking work ;-) ( cd /package-x11 ( cd etc/X11/xkb/rules ; rm -rf xfree86.lst ) ( cd etc/X11/xkb/rules ; ln -sf xorg.lst xfree86.lst ) ( cd etc/X11/xkb/rules ; rm -rf xfree86.xml ) ( cd etc/X11/xkb/rules ; ln -sf xorg.xml xfree86.xml ) ( cd etc/X11/xkb/rules ; rm -rf xfree86-it.lst ) ( cd etc/X11/xkb/rules ; ln -sf xorg-it.lst xfree86-it.lst ) ( cd etc/X11/xkb/rules ; rm -rf xfree86 ) ( cd etc/X11/xkb/rules ; ln -sf xorg xfree86 ) ) # These files aren't copied over by the make install for Linux/390. I suspect # they are only needed by xf86cfg or xf86config, but why not include them. cp -a programs/Xserver/hw/xfree86/xf86cfg/*.xbm \ /package-x11/usr/X11R6/include/X11/bitmaps/ mkdir -p /package-x11/usr/X11R6/include/X11/pixmaps/ cp -a programs/Xserver/hw/xfree86/xf86cfg/*.xpm \ /package-x11/usr/X11R6/include/X11/pixmaps/ ( cd programs/Xserver/hw/xfree86/etc/ cp Xinstall.sh /package-x11/usr/X11R6/lib/X11/etc/ cp xmodmap.std /package-x11/usr/X11R6/lib/X11/etc/ cp sun.tcap /package-x11/usr/X11R6/lib/X11/etc/sun.termcap cp sun.tinfo /package-x11/usr/X11R6/lib/X11/etc/sun.terminfo ) # # Fix up the Xft config scripts to remove the $TMP/freetype part from the # # "freetypecflags" value. # ( cd /package-x11/usr/X11R6/lib/pkgconfig/ # echo sed -e "s%$TMP/freetype%%" xft.pc > xft.pc.new # sed -e "s%$TMP/freetype%%" xft.pc > xft.pc.new # cat xft.pc.new > xft.pc # rm xft.pc.new # ) # ( cd /package-x11/usr/X11R6/bin/ # echo sed -e "s%$TMP/freetype%%" xft-config > xft-config.new # sed -e "s%$TMP/freetype%%" xft-config > xft-config.new # cat xft-config.new > xft-config # rm xft-config.new # ) # # pkgconfig doesn't know where to put this stuff: # ( cd /package-x11/usr/X11R6/lib # mv pkgconfig/* /package-x11/usr/lib/pkgconfig/ # rm -rf pkgconfig # ln -sf /usr/lib/pkgconfig . # ) # crud removal: rm -rf /package-x11/usr/X11R6/share/doc # We don't ship fonts.cache-1 files, we create them later. find /package-x11/usr -type f -name fonts.cache-1 -exec rm {} \; } attributes() { chown -R root.bin $PKG/package-x11/usr/bin/ \ $PKG/package-x11/usr/X11R6/bin/ chmod 644 $PKG/package-x11/etc/fonts/* chmod 755 $PKG/package-x11/etc/X11/xinit/xinitrc.twm chmod 444 $PKG/package-x11/usr/X11R6/lib/X11/etc/* chmod 4711 $PKG/package-x11/usr/X11R6/bin/XFree86 # chmod 4711 $PKG/package-x11/usr/X11R6/bin/xterm chmod 444 $PKG/package-x11/usr/X11R6/include/X11/bitmaps/*.x[bp]m \ $PKG/package-x11/usr/X11R6/include/X11/pixmaps/*.xpm find $PKG/package-x11/usr/X11R6/man -type f -exec chmod 444 {} \; } special() { cd $PKG mv package-x11/* ./ rmdir package-x11 # copy the package tree cp -a $PKG $TMP/xm # # remove things that shouldn't be in the main package # rm -rf $PKG/usr/include rm -rf $PKG/usr/lib/pkgconfig rm -rf $PKG/usr/share/ rm $PKG/usr/lib/libfreetype.a # xf86doc, xf86html, xf86ps, xf86jdoc rm -rf $PKG/usr/X11R6/lib/X11/doc # xf86prog rm -rf $PKG/usr/X11R6/lib/*.a rm -rf $PKG/usr/X11R6/lib/X11/config rm -rf $PKG/usr/X11R6/man/man3 ( cd $PKG/usr/X11R6/include/ rm -rf *.h DPS GL freetype* cd X11/ rm -rf *.h extensions fonts ICE SM Xcursor Xmu Xaw PEX5 Xft PM ) # xfnts, xfnts100, xfntscal, xfntscyr, xfntslt2 rm -rf $PKG/usr/X11R6/lib/X11/fonts/* rm -rf $PKG/usr/X11R6/include/fontconfig/ # xnest, xprt, xvfb rm -rf $PKG/usr/X11R6/bin/Xnest rm -rf $PKG/usr/X11R6/bin/Xprt rm -rf $PKG/usr/X11R6/bin/Xvfb mkdir -p $PKG/usr/X11R6/lib/X11/fonts/local/ cd $CTL cat $CWD/slack-desc/slack-desc.x11 > slack-desc cat $CWD/config.sh >> doinst.sh cat << EOF >> doinst.sh config etc/X11/xdm/xdm-config.new config etc/X11/xdm/Xservers.new config etc/X11/xdm/Xsession.new EOF # break up the doinst sed -f $CWD/sed.script doinst.sh > doinst.sh.new mv doinst.sh.new doinst.sh sed -e 's%package-x11/%%g' doinst.sh > doinst.sh.new cat doinst.sh.new > doinst.sh rm doinst.sh.new } subpacks() { repack x11docs repack x11docshtml repack x11devel repack x11fnts repack x11fnts100 repack x11fntscal repack x11fntscyr repack x11nest repack x11prt repack x11vfb }