#!/bin/bash # Copyright (C) 2010 Matías A. Fonzo, # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e CWD=$(pwd) TMP=${TMP:-/tmp/sources} OUT=${OUT:-/tmp/packages} V=1.4 ARCH=noarch B=1 PKG=${TMP}/package-xorgxconf rm -rf $PKG mkdir -p $PKG $OUT cd $PKG # Add the VESA configuration file for Xorg: install -D -m 644 ${CWD}/xorg.conf-vesa ${PKG}/etc/X11/xorg.conf-vesa # Add the profile for xdg-utils: install -D -m 755 ${CWD}/profile.d/xdg ${PKG}/etc/profile.d/xdg.new # Add the "wmconfig" script: install -D -m 755 ${CWD}/wmconfig/wmconfig ${PKG}/usr/bin/wmconfig ( # Make locales. cd ${CWD}/wmconfig/po for file in * ; do ext=${file#*.*.} install -d ${PKG}/usr/share/locale/${ext}/LC_MESSAGES msgfmt -o ${PKG}/usr/share/locale/${ext}/LC_MESSAGES/wmconfig.mo $file done ) # Include our script to create/re-create the X fonts: install -m 755 ${CWD}/update-xfontdir -D ${PKG}/usr/bin/update-xfontdir # Make the pre-post script: mkdir -p ${PKG}/install cat << "EOF" > ${PKG}/install/pre-post # Make/Update the X font index cache: if [ -x /usr/bin/update-xfontdir ]; then /usr/bin/update-xfontdir fi EOF # Make the post-install script: cat << "EOF" > ${PKG}/install/post-install # Handle config files: config() { local new old new="$1" old=${1%.new} if [ ! -r $old ]; then mv $new $old elif [ "$(md5sum $old | cut -f 1 -d ' ')" = "$(md5sum $new | cut -f 1 -d ' ')" ]; then rm $new else echo "You have a new config file \"${ROOT}/${new}\" at your consideration." fi } config etc/profile.d/xdg.new EOF # Copy the description files: mkdir -p ${PKG}/description cp ${CWD}/description/* ${PKG}/description cd $PKG makepkg ${OUT}/xorgxconf-${V}-${ARCH}-${B}.tlz