# Copyright 2008 - 2009 metamedia.ch # Distributed under the terms of the GNU General Public License v2 inherit eutils DESCRIPTION="SGnP official tax program of the Canton of St. Gallen" HOMEPAGE="http://www.steuern.sg.ch" # The ugly java stuff URL_BASE="http://download.java.net/dlj/binaries" X86_AT="jdk-6u11-dlj-linux-i586.bin" AMD64_AT="jdk-6u11-dlj-linux-amd64.bin" MY_PV="SGnP2008_installieren_unix.sh" SRC_URI="http://steuersoftware.sg.oca.ch/Steuern_2008/SGnP2008_installieren_unix.sh x86? ( ${URL_BASE}/${X86_AT} ) amd64? ( ${URL_BASE}/${AMD64_AT} )" LICENSE="" SLOT="2008" KEYWORDS="x86" IUSE="" RDEPEND=">=virtual/jre-1.5.0" DEPEND="${RDEPEND}" src_unpack() { # Get a jar binary in case we do not have a jdk installed sh "${DISTDIR}"/${X86_AT} --accept-license --unpack # Copy the script to the sandbox cp "${DISTDIR}/${MY_PV}" "${WORKDIR}" # Extract the installer unpacker=`cat "${MY_PV}" | grep -a "tail -c" | cut -d ' ' -f3` cat "${WORKDIR}/${MY_PV}" | tail -c $unpacker > tmp.tar.gz gunzip tmp.tar.gz mkdir -p "${P}/.install4j" cd "${P}/.install4j" tar xf "${WORKDIR}/tmp.tar" rm "${WORKDIR}/tmp.tar" # Extract the program cd "${WORKDIR}" fulllength=`ls -l ${MY_PV} | cut -d ' ' -f5` newlength=$(($fulllength-$unpacker)) unpacker=`cat ${P}/.install4j/stats.properties | grep "file.size" | cut -d '=' -f2 | tr -d '\r'` cat "${WORKDIR}/${MY_PV}" | head -c $newlength | tail -c $unpacker > tmp.jar cd "${P}" # Fix windows backslashes ${WORKDIR}/jdk1.6.0_11/bin/jar i "${WORKDIR}/tmp.jar" ${WORKDIR}/jdk1.6.0_11/bin/jar xf "${WORKDIR}/tmp.jar" rm "${WORKDIR}/tmp.jar" rm "${WORKDIR}/${MY_PV}" python "${FILESDIR}/jar_fix.py" "${WORKDIR}/${P}/META-INF/INDEX.LIST" rm -r "${WORKDIR}/${P}/META-INF" rm uninstall mv "Steuer ${PV}" "steuer_${PV}" chmod 755 "steuer_${PV}" } src_install() { dodir /opt/ cp -pPR ${WORKDIR}/${P} ${D}/opt/ dodir /usr/share/applications cp ${FILESDIR}/sgnp-2008.desktop ${D}/usr/share/applications }