#!/bin/bash ## src2pkg script for: kbd ## Auto-generated by src2pkg-2.0 ## src2pkg - Copyright 2005-2009 Gilbert Ashley # This script is adapated from the kbd.SlackBuild script # Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA # See the end of this file for the original Copyright and license information SOURCE_NAME='kbd-1.15.tar.bz2' NAME='kbd' # Use ALT_NAME to override guessed value VERSION='1.15' # Use ALT_VERSION to override guessed value # ARCH='' # BUILD='1' # PRE_FIX='usr' # Any extra options go here: EXTRA_CONFIGS="--localedir=/usr/share/locale --datadir=/usr/share/kbd --enable-nls" PATCHLIST='kbd-patches/kbd-1.15-po.patch.gz kbd-patches/kbd-1.15-keycodes-man.patch.gz kbd-patches/kbd-1.15-sparc.patch.gz kbd-patches/kbd-1.15-unicode_start.patch.gz kbd-patches/kbd-1.15-resizecon-x86_64.patch.gz kbd-patches/kbd-1.15-quiet_doc.patch.gz kbd-patches/nl.euro.diff.gz' # kbd-patches/nl.euro.diff.gz # Optional function replaces configure_source, compile_source, fake_install # To use, uncomment and write/paste CODE between the {} brackets. # build() { CODE } # Get the functions and configs . /usr/libexec/src2pkg/FUNCTIONS ; # Execute the named packaging steps: pre_process find_source make_dirs unpack_source fix_source_perms # This is from Fedora's spec file: # 7-bit maps are obsolete; so are non-euro maps ( cd $SRC_DIR/data/keymaps/i386 mv qwerty/fi.map qwerty/fi-old.map cp -fa qwerty/fi-latin9.map qwerty/fi.map cp -fa qwerty/pt-latin9.map qwerty/pt.map cp -fa qwerty/sv-latin1.map qwerty/se-latin1.map mv -f azerty/fr.map azerty/fr-old.map cp -fa azerty/fr-latin9.map azerty/fr.map cp -fa azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias # Rename conflicting keymaps mv -f dvorak/no.map dvorak/no-dvorak.map mv -f fgGIod/trf.map fgGIod/trf-fgGIod.map mv -f olpc/es.map olpc/es-olpc.map mv -f olpc/pt.map olpc/pt-olpc.map mv -f qwerty/cz.map qwerty/cz-qwerty.map ) configure_source # compile_source # If used, the 'build' function replaces these 3 fake_install # # doesn't make sense to put loadkeys in /bin since # the keymaps are under /usr #( cd $PKG_DIR # mkdir -p bin # mv -f usr/bin/loadkeys bin/ # cd usr/bin ; ln -sf ../../bin/loadkeys . #) # ro_win.map.gz is useless rm -f $PKG_DIR/usr/share/kbd/keymaps/i386/qwerty/ro_win.map.gz # The rhpl keyboard layout table is indexed by kbd layout names, so we need a # Korean keyboard ln -sf us.map.gz $PKG_DIR/usr/share/kbd/keymaps/i386/qwerty/ko.map.gz # Install the setup script that will be run from the installer: mkdir -p $PKG_DIR/$ADM_DIR_NAME/setup install -m755 $PATCHES_DIR/$NAME-patches/setup.setconsolefont $PKG_DIR/$ADM_DIR_NAME/setup install -m755 $PATCHES_DIR/$NAME-patches/setconsolefont $PKG_DIR/usr/bin/ install -m755 $PATCHES_DIR/$NAME-patches/setup.setkeymap $PKG_DIR/$ADM_DIR_NAME/setup # speakup keymaps not used, for now skip() { # Additional keymaps: # This is the keymap for Speakup (http://linux-speakup.org) users: cat $PATCHES_DIR/$NAME-patches/speakupmap.map.gz > $PKG_DIR/usr/share/kbd/keymaps/i386/qwerty/speakupmap.map.gz # Another keymap for Speakup from Thomas Ward, for JFW users. ( cd $SRC_DIR tar xvf $PATCHES_DIR/$NAME-patches/speakup-jfw.tar.gz ( cd speakup-jfw cat speakup-jfw.map | gzip -9c > $PKG_DIR/usr/share/kbd/keymaps/i386/qwerty/speakup-jfw.map.gz cat readme > $PKG_DIR/usr/share/kbd/keymaps/i386/qwerty/speakup-jfw.readme ) ) } # Create the default run control script which will set the # console font to the default: mkdir -p $INIT_DIR cat << EOF > $INIT_DIR/rc.font.new #!/bin/initsh # # This loads your default screen font from among the ones in # /usr/share/kbd/consolefonts. # /usr/bin/setfont -v EOF chmod 644 $INIT_DIR/rc.font.new cat << EOF > $INIT_DIR/rc.keymap.new #!/bin/initsh # # This loads your default keyboard layout # /usr/bin/loadkeys us.map EOF chmod 644 $INIT_DIR/rc.keymap.new fix_pkg_perms strip_bins create_docs rm -f $DOC_DIR/$NAME-$VERSION/kbd.FAQ.sgml compress_man_pages make_description make_doinst make_package post_process # Original Coypright and license info: # Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.