Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563580 - www-apps/otrs-5.0.15: version bump
Summary: www-apps/otrs-5.0.15: version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Stefan G. Weichinger
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-20 16:44 UTC by Stefan G. Weichinger
Modified: 2017-01-15 08:06 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch against www-apps/otrs-4.0.13.ebuild (file_563580.txt,1.80 KB, patch)
2015-10-20 16:45 UTC, Stefan G. Weichinger
Details | Diff
patch against www-apps/otrs-4.0.13.ebuild (file_563580.txt,1.75 KB, patch)
2015-10-20 16:49 UTC, Stefan G. Weichinger
Details | Diff
otrs-daemon.service (file_563580.txt,257 bytes, text/plain)
2015-10-27 08:57 UTC, Stefan G. Weichinger
Details
patch against www-apps/otrs-4.0.13.ebuild (file_563580.txt,1.89 KB, text/plain)
2015-10-30 07:18 UTC, Stefan G. Weichinger
Details
patch against www-apps/otrs-4.0.13.ebuild (file_563580.txt,2.50 KB, text/plain)
2015-11-02 09:29 UTC, Stefan G. Weichinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan G. Weichinger 2015-10-20 16:44:23 UTC
otrs helpdesk 5.0.1 has been released today:

https://www.otrs.com/release-notes-otrs-5/

they talk of version 5, but the tarball is numbered 5.0.1

In the next posting I attach a patch against otrs-4.0.13.ebuild which is in portage.

otrs-5.0.1 might become unstable version in portage at first.


Reproducible: Always
Comment 1 Stefan G. Weichinger 2015-10-20 16:45:31 UTC
Created attachment 415020 [details, diff]
patch against www-apps/otrs-4.0.13.ebuild
Comment 2 Stefan G. Weichinger 2015-10-20 16:49:36 UTC
Created attachment 415022 [details, diff]
patch against www-apps/otrs-4.0.13.ebuild

sorry, MY_P and MY_PV aren't used at all. removed that now.
Comment 3 Patrice Clement gentoo-dev 2015-10-23 08:50:03 UTC
We need to work out another solution. Calling sudo in an ebuild is forbidden.
Comment 4 Amy Liffey gentoo-dev 2015-10-23 09:13:40 UTC
I don't exactly get why you used sudo and what is it good for but it is really forbidden in ebuilds. So if you don't mind and try to figure out new solution for it, please?


If you have any questions you can ask on #gentoo-proxy-maint channel on freenode or just write me email.

Thanks.

Amynka
Comment 5 Sam Jorna (wraeth) gentoo-dev 2015-10-23 09:36:52 UTC
Also, for thoroughness, I tried runtesting the ebuild.

Firstly, the systemd service file 'otrs-daemon.service' is not present. It seems it was added with this ebuild, so will need to be attached to this bug in order to be included. If it is included in the upstream source, then it can be installed from there rather than from ${FILESDIR}.

Also, as a test I also tried removing the calls to `sudo` during the pkg_postinst() when calling the perl scripts, however that did indeed fail, noting that they shouldn't be run as the root user.
Comment 6 Stefan G. Weichinger 2015-10-24 18:11:21 UTC
thanks for all your comments, I am currently on a vacation and will try to improve the ebuild next week.
Comment 7 Stefan G. Weichinger 2015-10-27 08:57:54 UTC
Created attachment 415574 [details]
otrs-daemon.service

files/otrs-daemon.service

it is not in the upstream tarball, wrote it myself and it works for me so far
Comment 8 Ian Delaney (RETIRED) gentoo-dev 2015-10-27 12:01:53 UTC
The systemd service files appears to install fine.

OTRS_HOME="/var/lib/otrs"

on install into image;

 $ find  /mnt/gen2/TmpDir/portage/www-apps/otrs-5.0.1/image/ -name RELEASE
/mnt/gen2/TmpDir/portage/www-apps/otrs-5.0.1/image/var/lib/otrs/RELEASE

So RELEASE is installed to /var/lib/otrs/

On attampt to merge;

 * Setting correct permissions ...
Setting permissions on /var/lib/otrs
 * Rebuilding config ...
ERROR: Can't read /opt/otrs/RELEASE: No such file or directory This file is needed by central system parts of OTRS, the system will not work without this file.
Died at /var/lib/otrs/Kernel/Config/Defaults.pm line 2028.
 * ERROR: www-apps/otrs-5.0.1::gentoo failed (postinst phase):
 *   Could not rebuild config

So it is attempting to find in in the path /opt/otrs/.
Something has not been reset to find OTRS_HOME="/var/lib/otrs".
It is sought in /opt/otrs/.

sudo -u otrs /usr/bin/env perl "${OTRS_HOME}"/bin/otrs.Console.pl Maint::Config::Rebuild 

The use of sudo is still in place. sudo run from a script is not the intemded style for sudo/  If this configuration script cannot be run form an ebuild, it need be left to be run manually post emerge.
Comment 9 Stefan G. Weichinger 2015-10-27 12:13:55 UTC
(In reply to Ian Delaney from comment #8)

> ERROR: Can't read /opt/otrs/RELEASE: No such file or directory This file is
> needed by central system parts of OTRS, the system will not work without
> this file.
> Died at /var/lib/otrs/Kernel/Config/Defaults.pm line 2028.
>  * ERROR: www-apps/otrs-5.0.1::gentoo failed (postinst phase):
>  *   Could not rebuild config
> 
> So it is attempting to find in in the path /opt/otrs/.
> Something has not been reset to find OTRS_HOME="/var/lib/otrs".
> It is sought in /opt/otrs/.

Interesting. My installation does not have the dir /var/lib/otrs at all AND does not fail to install this ebuild. I will retry that in a fresh vagrant VM to check.

sudo-topic: understood
Comment 10 Stefan G. Weichinger 2015-10-27 13:33:59 UTC
upstream uses /opt/otrs as default for the installation.
It is set in $OTRS_HOME/Kernel/Config/Defaults.pm, line 885.

Older ebuilds used /var/lib/otrs.
So we have to handle fresh installations different from updates.
Comment 11 Stefan G. Weichinger 2015-10-27 13:35:04 UTC
(In reply to Stefan G. Weichinger from comment #9)

> Interesting. My installation does not have the dir /var/lib/otrs at all

correction: I meant /opt/otrs in this statement
Comment 12 Stefan G. Weichinger 2015-10-27 13:53:59 UTC
sudo-topic:

is this allowed and OK ? ->

einfo "Rebuilding config ..."
su -c "${OTRS_HOME}/bin/otrs.Console.pl Maint::Config::Rebuild" \
   -s /bin/bash otrs \
|| die "Could not rebuild config"

it works at least ...

I took this from the output of:

# /var/lib/otrs/bin/otrs.Console.pl
Error: You cannot run otrs.Console.pl as root. Please run it as the
'otrs' user or with the help of su:
  su -c "bin/otrs.Console.pl MyCommand" -s /bin/bash otrs
Comment 13 Ian Delaney (RETIRED) gentoo-dev 2015-10-30 03:29:18 UTC
As a generic answer, no.  The authors of this have made an unwinnable battle front with this. Use of su or sudo ought not be utilised within an ebuild. Al alternative is to write the whole install phase manually from scratch which means skirting use of the script in per. This is feasible but for a user such as yourself, quite beyond reasonable expectations.

I still think this is best left to running this script manually post emerge.
Comment 14 Stefan G. Weichinger 2015-10-30 07:18:30 UTC
Created attachment 415736 [details]
patch against www-apps/otrs-4.0.13.ebuild

I understand. See my next suggested patch.
Comment 15 Ian Delaney (RETIRED) gentoo-dev 2015-11-01 08:02:21 UTC
I have to hold back on this due to a tip from another dev re the use of /opt/otrs.
Everything in this bug suggests that the perl script has hard coded the path to /opt/otrs in opposition to the test of the ebuild pointing it to /var/lib/orts.

It seems to me the perl script will need patching to adjust the install location to the OTRS_HOME.  You will need to do a full run test of a full emerge followed by running the perl script manually and ensure it 'works'.
Comment 16 Stefan G. Weichinger 2015-11-01 10:15:53 UTC
What is the preferred installation DIR for gentoo? /var/lib or /opt ?
I will then install/patch everything there.
Comment 17 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2015-11-02 00:51:30 UTC
(In reply to Stefan G. Weichinger from comment #16)
> What is the preferred installation DIR for gentoo? /var/lib or /opt ?
> I will then install/patch everything there.

Stefan, our rules are clear that only binary packages should be installed into /opt. If this package is a source package or built during installation, it shouldn't use /opt.
Comment 18 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2015-11-02 00:57:23 UTC
https://devmanual.gentoo.org/general-concepts/filesystem/

It took me a while to find the reference I was looking for.
Comment 19 Ian Delaney (RETIRED) gentoo-dev 2015-11-02 01:25:22 UTC
Stefan,
It appears this can likely be resolved by the perl-module eclass.
Here's a start

PERL_EXPORT_PHASE_FUNCTIONS=no
inherit perl-module

I suggest you join in the #Gentoo-proxy-maint for further support.
Comment 20 Stefan G. Weichinger 2015-11-02 09:29:05 UTC
Created attachment 415936 [details]
patch against www-apps/otrs-4.0.13.ebuild

fix for the issue with $OTRS_HOME.
-> run sed over "${S}"/Kernel/Config.pm after cp-ing the template.
Comment 21 Stefan G. Weichinger 2015-11-02 09:31:12 UTC
(In reply to Ian Delaney from comment #19)
> Stefan,
> It appears this can likely be resolved by the perl-module eclass.
> Here's a start
> 
> PERL_EXPORT_PHASE_FUNCTIONS=no
> inherit perl-module
> 
> I suggest you join in the #Gentoo-proxy-maint for further support.

Isn't that for installing perl-modules?
I don't see anything related to *executing* a perl script in the docs for that eclass.
Comment 22 Ian Delaney (RETIRED) gentoo-dev 2015-11-04 05:51:10 UTC
This is why I suggest you join in the #Gentoo-proxy-maint for further support.
In short, a senior dev from the perl team suggested all the above as a means to install it in the correct directory. You interpretation appears far too literal. If the eclass only acted on perl modules he'd not have suggested it. The flow would be that a function in the eclass stipulates an install location which could override that set in the perl script itself. Either way, you have taken on a very challenging  package to ebuild.
Comment 23 Stefan G. Weichinger 2015-11-04 08:23:59 UTC
OK, I understand the direction ...
Today I copied the ebuild to otrs-5.0.2.ebuild as upstream released a new version. Running the 2 commands manually works for me so far.

-

otrs-5.0.x.ebuild : I won't find much time in the next weeks as I move house here in the next week etc. / but it is ~ anyway in portage, right?

not exactly belonging to this bug: there should be a otrs-4.0.14.ebuild done for stable version as there is also an upstream release for 4.x. Should I file this as a new bug?

thanks, regards, Stefan
Comment 24 Marc Schiffbauer gentoo-dev 2016-06-16 12:32:28 UTC
ping? any progress here?
Comment 25 Stefan G. Weichinger 2016-06-16 13:21:16 UTC
(In reply to Marc Schiffbauer from comment #24)
> ping? any progress here?

I use my own ebuild for 5.0.10.
Not yet ready for portage, though.
Comment 26 Stefan G. Weichinger 2016-06-20 15:42:39 UTC
(In reply to Marc Schiffbauer from comment #24)
> ping? any progress here?

If you want to test it while it still installs into /opt I can share my current ebuild (here or via github or pm). I'd be happy to have someone else helping with fixing the installation path (as I am still quite busy with other issues here). Aside from the path my otrs-installation runs fine (used daily).
Comment 27 Marc Schiffbauer gentoo-dev 2016-06-20 15:47:47 UTC
Would be nice if you'd append it to this bug. FOr me personally  installing to /opt would be ok.

Thanks!
Comment 28 Stefan G. Weichinger 2016-06-20 17:35:44 UTC
(In reply to Marc Schiffbauer from comment #27)
> Would be nice if you'd append it to this bug. FOr me personally  installing
> to /opt would be ok.
> 
> Thanks!

pls clone from here:

https://github.com/stefangweichinger/gentoo-overlay/tree/master/www-apps/otrs

and don't forget to provide any feedback ;-)
Comment 29 Stefan G. Weichinger 2016-06-28 10:13:41 UTC
OTRS help desk 5.0.11 is out:

https://www.otrs.com/release-notes-otrs-5-patch-level-11/

As I installed my new otrs-5.0.11.ebuild (check git-repo as mentioned above) I noticed that I already fixed the installation directory issue. My installation is in /var/lib/otrs which seems correct to me?

I also cp-ied over metadata.xml to clear some repoman warnings, now "repoman full" seems quite happy:

# repoman full

RepoMan scours the neighborhood...
Note: use --include-dev (-d) to check dependencies for 'dev' profiles
RepoMan sez: "If everyone were like you, I'd be out of business!"

pls review and test, maybe we can get an updated ebuild into portage soon.
thanks, Stefan
Comment 30 Marc Schiffbauer gentoo-dev 2016-06-28 14:02:30 UTC
Hi Stefan,

thanks very much for your feedback and ebuild. I will have a look at it ASAP.
Comment 31 Stefan G. Weichinger 2016-08-13 21:43:05 UTC
# cp otrs-5.0.11.ebuild otrs-5.0.12.ebuild

... works for me to install latest upstream release 5.0.12
Comment 32 Stefan G. Weichinger 2016-11-02 20:47:13 UTC
We should get 5.0.14 out, at least as unstable.

check https://bugs.gentoo.org/show_bug.cgi?id=598768 for security issues.

My local ebuild installs and works fine for me.

btw: this bug is over a year old now (remember "gentoo = bleeding edge" , someone? ;-) )
Comment 33 Stefan G. Weichinger 2016-12-14 20:37:51 UTC
OTRS Help Desk 5.0.15 :: https://www.otrs.com/release-notes-otrs-5s-patch-level-15
Comment 34 Thomas Deutschmann (RETIRED) gentoo-dev 2017-01-15 08:06:09 UTC
Now in repository, https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f478142f7e09113eda2a1618aab90c2b563f34d6