--- /usr/portage/www-apps/otrs/otrs-4.0.13.ebuild 2015-10-05 10:31:02.000000000 +0200 +++ otrs-5.0.1.ebuild 2015-10-30 08:11:36.017664139 +0100 @@ -4,7 +4,7 @@ EAPI=5 -inherit eutils confutils user +inherit eutils confutils user systemd DESCRIPTION="OTRS is an Open source Ticket Request System" HOMEPAGE="http://otrs.org/" @@ -76,7 +76,7 @@ xargs sed -i -e "s:/opt/otrs:${OTRS_HOME}:g" \ || die "sed failed" - cd Kernel/Config/ || die + cd Kernel/ || die for i in *.dist; do cp ${i} $(basename ${i} .dist) || die done @@ -107,6 +107,15 @@ keepdir "${OTRS_HOME}/var/${a}" done doenvd "${T}/50${PN}" + + systemd_dounit "${FILESDIR}/otrs-daemon.service" + +} + +# This is too automagic, either einfo telling user or installing to /etc/cron.d/ should be preferred +pkg_config() { + einfo "Installing cronjobs" + crontab -u otrs /usr/share/doc/${PF}/crontab } pkg_postinst() { @@ -115,17 +124,16 @@ --otrs-user=otrs \ --web-group=apache \ || die "Could not set permissions" - - einfo "Rebuilding config ..." - /usr/bin/env perl "${OTRS_HOME}"/bin/otrs.RebuildConfig.pl \ - || die "Could not rebuild config" - - einfo "Deleting cache ..." - /usr/bin/env perl "${OTRS_HOME}"/bin/otrs.DeleteCache.pl \ - || die "Could not delete cache" - + einfo "Installation done!" - - elog "Enable cronjobs with the following command:" + elog "1) Rebuild your config now by running the following commands:" + elog "sudo -u otrs /usr/bin/env perl "${OTRS_HOME}"/bin/otrs.Console.pl Maint::Config::Rebuild" + elog "sudo -u otrs /usr/bin/env perl "${OTRS_HOME}"/bin/otrs.Console.pl Maint::Cache::Delete" + elog "" + elog "2) Enable cronjobs with the following command:" elog "crontab -u otrs crontab" + elog "" + elog "3) systemd users: enable and start OTRS daemon:" + elog "systemctl enable otrs-daemon" + elog "systemctl start otrs-daemon" }