Fini la conversion du stage3 (nouveau format répertoire pkg)
[hvlinux.git] / stage3 / pkg / fontconfig
index fd696a2..e3ff347 100644 (file)
@@ -1,48 +1,31 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-if [ -z "${HV_FONTS_PATH}" ]; then
-    echo "Missing HV_FONTS_PATH environment variable"
-    exit 1
-fi
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --localstatedir=/var \
-    --disable-docs \
-    --without-add-fonts \
-    --with-docdir=/usr/share/doc/${PACKAGE} \
-    ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-mkdir -v -p ${HV_FONTS_PATH}/{TrueType,Type1}
-mkdir -v -p /etc/fonts
-
-if [ -f /etc/fonts/local.conf ]; then
-    mv -v /etc/fonts/local.conf /etc/fonts/local.conf.old
-fi
-
-# Adding X and our local fonts directory to local configuration file
-cat > /etc/fonts/local.conf << "EOF"
+#!/bin/bash
+
+hvconfig_pre()
+{
+    if [ -z "${HV_FONTS_PATH}" ]; then
+        echo "Missing HV_FONTS_PATH environment variable"
+        exit 1
+    fi
+
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --localstatedir=/var \
+        --disable-docs \
+        --without-add-fonts \
+        --with-docdir=/usr/share/doc/${PACKAGE}"
+}
+
+hvbuild_post()
+{
+    mkdir -v -p ${HV_FONTS_PATH}/{TrueType,Type1}
+    mkdir -v -p /etc/fonts
+
+    if [ -f /etc/fonts/local.conf ]; then
+        mv -v /etc/fonts/local.conf /etc/fonts/local.conf.old
+    fi
+
+    # Adding X and our local fonts directory to local configuration file
+    cat > /etc/fonts/local.conf << "EOF"
 <?xml version="1.0"?>
 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <!-- /etc/fonts/local.conf file for local customizations -->
@@ -52,9 +35,8 @@ cat > /etc/fonts/local.conf << "EOF"
 </fontconfig>
 EOF
 
-sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/fonts/local.conf
-
-# Updating cache database.
-fc-cache -f
+    sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/fonts/local.conf
 
-exit $?
+    # Updating cache database.
+    fc-cache -f
+}