# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Quasar is a full function, stand-along business accountaing package" HOMEPAGE="http://www.linuxcanada.com/quasar.shtml" SRC_URI="ftp://ftp.linuxcanada.com/pub/Quasar/${PV}/source/${P}_GPL.tgz doc? ( ftp://ftp.linuxcanada.com/pub/Quasar/${PV}/manuals/quasar_install-${PV}.pdf ftp://ftp.linuxcanada.com/pub/Quasar/${PV}/manuals/quasar_guide-${PV}.pdf ftp://ftp.linuxcanada.com/pub/Quasar/${PV}/manuals/quasar_reference-${PV}.pdf ftp://ftp.linuxcanada.com/pub/Quasar/${PV}/manuals/quasar_features-${PV}.pdf )" LICENSE="GPL-1" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="postgres firebird doc" DEPEND=">=dev-lang/tcl-8.3 >=dev-lang/tk-8.3 >=x11-libs/qt-3.0 >=dev-libs/icu-3.2" RDEPEND="${DEPEND} postgres? ( >=dev-db/postgresql-7.4 ) firebird? ( dev-db/firebird )" # Where should stuff go? The install script has more of these, but we don't # really care as the Gentoo ebuild system provide us with more advanced ways # of handling these. CONFIG_DIR=/etc/${PN} PROGRAM_DIR=/usr/bin SERVER_DIR=/usr/sbin SHARE_DIR=/usr/share/${PN} VARLIB_DIR=/var/lib/${PN} LOCALE_DIR="${SHARE_DIR}/locales" SETUP_DIR="${SHARE_DIR}/setup" DATA_DIR="${VARLIB_DIR}/data" IMPORT_DIR="${VARLIB_DIR}/import" DB_DIR="${VARLIB_DIR}/databases" BACKUP_DIR="/var/backups/${PN}" # I don't like this one! DRIVER_DIR="/usr/lib/${PN}" # Source directory; the dir where the sources can be found (automatically # unpacked) inside ${WORKDIR}. The default value for S is ${WORKDIR}/${P}, # unfortunately quasar appends _GPL to this (There is also a retail version). S="${WORKDIR}/${P}_GPL" src_compile() { # Check that at least one of the DBs is in USE use postgres || use firebird || die "You must have at least one of postgres or firebird in your USE flags" epatch "${FILESDIR}/quasar.fpic.patch" epatch "${FILESDIR}/space_fix.patch" #epatch "${FILESDIR}/quasar.printing.patch" einfo "Disabling the xinetd record by default" sed -i -e 's/disable = no/disable = yes/' setup/quasar.xinetd econf || die "econf failed" emake || die "emake failed" } function data_install() { dodir "${DATA_DIR}/${1}" insinto "${DATA_DIR}/${1}" doins "data/${1}/"${2} } function dolocale() { insinto "${LOCALE_DIR}/${1}" doins "locales/${1}/messages.qm" doins "locales/${1}/messages.ts" insinto "${LOCALE_DIR}/${1}/help" doins "locales/${1}/help/"*.html insinto "${LOCALE_DIR}/${1}/help/images" doins "locales/${1}/help/images/"*.png } src_install() { # Run the install script, we'll clean up after it # when it is done. #make PREFIX=${D} install || die # Ok, the install script is going to take some work to fix... # for now I'm much rather going to clone the entire script into # the ebuild and make it work the way I want. The scripts wants # add users etc... unless those things become optional we are going # to have our days... dodir /usr dosbin bin/quasar_setup dosbin bin/quasard dosbin bin/quasar_clientd dosbin bin/quasar_import dobin bin/quasar dobin bin/quasar_report dodir "${SHARE_DIR}" dodir "${VARLIB_DIR}" dolocale en_CA # These files are to be used by the server, running as quasar:quasar, # The ownership of these files will be modified to root:quasar _post_install_ diropts -m 0750 insopts -m 0640 data_install "cheque_fmts" "*.xml" data_install "handheld" "handheld.hex" data_install "models" "*.xml" data_install "reports" "*.xml" data_install "screens" "*.xml" data_install "shelf_labels" "*.xml" keepdir "${DATA_DIR}/companies" keepdir "${BACKUP_DIR}" insinto "${IMPORT_DIR}" doins "import/"*.xml # Need a better way of handling these, perhaps a wildcard? dodoc "Readme.txt" dodoc "Release_143.txt" dodoc "Release_144.txt" dodoc "Release_145.txt" dodoc "Release_146.txt" # Default config files. These are generated in the install script. # The optional postgres and firebird drivers are also installed here. dodir $CONFIG_DIR cat > "${D}${CONFIG_DIR}/client.cfg" < $LOCALE_DIR 1 EOCONFIG chmod 644 "${D}${CONFIG_DIR}/client.cfg" cat > "${D}${CONFIG_DIR}/server.cfg" < 0 0 $DATA_DIR $DRIVER_DIR $BACKUP_DIR $IMPORT_DIR admin EOCONFIG chmod 640 "${D}${CONFIG_DIR}/server.cfg" insinto "${DRIVER_DIR}" insopts -m 755 if use postgres; then doins drivers/libpostgresql_driver.so cat > "${D}${CONFIG_DIR}/postgresql.cfg" < localhost 5432 quasar_dba quasar UNICODE EOCONFIG chmod 640 "${D}${CONFIG_DIR}/postgresql.cfg" fi if use firebird; then doins drivers/libfirebird_driver.so cat > "${D}${CONFIG_DIR}/firebird.cfg" < localhost 3050 /usr $DB_DIR 4096 ISO8859_1 EOCONFIG chmod 640 "${D}${CONFIG_DIR}/firebird.cfg" fi # Where logs are kept. diropts -m0700 -o quasar keepdir /var/log/quasar doinitd ${FILESDIR}/quasar if use doc; then dodoc "${DISTDIR}/quasar_install-${PV}.pdf" dodoc "${DISTDIR}/quasar_guide-${PV}.pdf" dodoc "${DISTDIR}/quasar_reference-${PV}.pdf" dodoc "${DISTDIR}/quasar_features-${PV}.pdf" fi if use firebird; then ewarn ewarn "The author of this ebuild was unable to check that the default" ewarn "config file for firebird is a working one - please confirm." ewarn fi } pkg_postinst() { enewgroup quasar || die "Error adding quasar group" enewuser quasar -1 /bin/false /dev/null quasar || die "Error adding quasar user" einfo "Fixing ownership of files" chown -R root:quasar "${CONFIG_DIR}" chown -R root:quasar "${DATA_DIR}" }