Bug 5232 - debian lintian complains about files in /etc/opt
Summary: debian lintian complains about files in /etc/opt
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Client (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.7.0
Assignee: Henrik Andersson
URL:
Keywords: relnotes, thomas_tester
Depends on:
Blocks:
 
Reported: 2014-08-27 11:45 CEST by Pierre Ossman
Modified: 2016-12-05 15:08 CET (History)
3 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2014-08-27 11:45:06 CEST
So Ubuntu/Debian has apparently made the work we did on bug 3995 rather pointless. A default installed and updated Ubuntu 14.04 complains that files aren't allowed in /etc/opt:

Lintian check results for /home/tluser/Downloads/thinlinc-client_4.2.0-4356_amd64.deb:
E: thinlinc-client: dir-or-file-in-etc-opt etc/opt/thinlinc/
E: thinlinc-client: dir-or-file-in-etc-opt etc/opt/thinlinc/ssh_known_hosts
E: thinlinc-client: dir-or-file-in-etc-opt etc/opt/thinlinc/tlclient.conf
Comment 1 Peter Åstrand cendio 2014-10-29 13:12:57 CET
This problem can probably be avoided by shipping a file /usr/share/lintian/overrides/thinlinc-client. Ugly, but apparently that's the way they want it. 

With such a file, we could consider un-doing the move to /etc/opt/thinlinc.
Comment 2 Peter Åstrand cendio 2014-11-12 10:56:58 CET
The lintian command when installing from Ubuntu Software Center is:
/usr/bin/lintian --no-cfg --fail-on-warnings --profile ubuntu/aptdaemon /home/cendio/Downloads/thinlinc-client_4.3.0-4538_amd64.deb
Comment 3 Pierre Ossman cendio 2015-02-17 10:39:13 CET
I'm not sure the solution in comment 2 will work as the lintian check is done early, probably before we've had any chance to install that file.
Comment 4 Henrik Andersson cendio 2016-08-12 08:38:27 CEST
(In reply to comment #3)
> I'm not sure the solution in comment 2 will work as the lintian check is done
> early, probably before we've had any chance to install that file.

The overrides file should be placed in the deb package which is read by lintian. No need to have a file in place before lintian runs.
Comment 5 Henrik Andersson cendio 2016-08-12 10:42:36 CEST
I have now an update rpm2debpkg script which takes an lintian override file and embed into the debian package with the following content:

  #
  # Thinlinc Client lintian policy override
  #
  # To update this file, run lintian -i thinlinc-client..deb and add
  # newly identified errors
  #

  thinlinc-client binary: dir-or-file-in-opt
  thinlinc-client binary: dir-or-file-in-etc-opt
  thinlinc-client binary: description-is-pkg-name
  thinlinc-client binary: no-copyright-file
  thinlinc-client binary: debian-changelog-file-missing
  thinlinc-client binary: embedded-library 

And this is working fine for 4 of 6 overrides. However, there are profiles for lintian which controls which lintian-tag that actually could be overridden. In debian / ubuntu case the dir-or-file-in-opt and dir-or-file-in-etc-opt is not allowed to be overridden.

Profiles are located /usr/share/lintian/profiles/debian
Comment 6 Henrik Andersson cendio 2016-08-12 10:44:41 CEST
(In reply to comment #5)

> And this is working fine for 4 of 6 overrides. However, there are profiles for
> lintian which controls which lintian-tag that actually could be overridden. In
> debian / ubuntu case the dir-or-file-in-opt and dir-or-file-in-etc-opt is not
> allowed to be overridden.
> 

Related upstream bug regarding dir-or-file-in-opt and dir-or-file-in-etc-opt is found here [1]

[1] https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/712377
Comment 7 Henrik Andersson cendio 2016-08-12 10:47:59 CEST
(In reply to comment #5)
>
> Profiles are located /usr/share/lintian/profiles/debian
>

More information about vendor profiles are found here [1] 

https://lintian.debian.org/manual/section-2.5.html
Comment 8 Henrik Andersson cendio 2016-08-12 11:13:52 CEST
(In reply to comment #5)
> And this is working fine for 4 of 6 overrides. However, there are profiles for
> lintian which controls which lintian-tag that actually could be overridden. In
> debian / ubuntu case the dir-or-file-in-opt and dir-or-file-in-etc-opt is not
> allowed to be overridden.
> 

This [1] is what debian thinks about add-on software. I can read that as, add-on software should not be debian packages.

[1] https://lintian.debian.org/tags/dir-or-file-in-opt.html
Comment 9 Henrik Andersson cendio 2016-08-12 11:17:33 CEST
(In reply to comment #6)

> 
> Related upstream bug regarding dir-or-file-in-opt and dir-or-file-in-etc-opt is
> found here [1]
> 
> [1] https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/712377


This upstream bug is related to lintian and the inherited disallow of override of 
dir-or-file-in-opt from debian provided ftp-master-auto-reject which is inherited into debian and ubuntu profile.

https://bugs.launchpad.net/ubuntu/+source/lintian/+bug/824122
Comment 10 Henrik Andersson cendio 2016-08-12 13:40:06 CEST
This source 
(In reply to comment #8)
> (In reply to comment #5)
> > And this is working fine for 4 of 6 overrides. However, there are profiles for
> > lintian which controls which lintian-tag that actually could be overridden. In
> > debian / ubuntu case the dir-or-file-in-opt and dir-or-file-in-etc-opt is not
> > allowed to be overridden.
> > 
> 
> This [1] is what debian thinks about add-on software. I can read that as,
> add-on software should not be debian packages.
> 
> [1] https://lintian.debian.org/tags/dir-or-file-in-opt.html

Also this [1] source actually says that no deb packages shoudl install into /opt

[1] https://wiki.debian.org/FilesystemHierarchyStandard
Comment 11 Henrik Andersson cendio 2016-08-12 13:47:19 CEST
Here [1] is a discussion package installation into /opt and FHS, also a good read about debian policy [2] for add-on software

[1] http://unix.stackexchange.com/questions/10127/why-did-my-package-get-installed-to-opt

[2] http://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html#OPTADDONAPPLICATIONSOFTWAREPACKAGES
Comment 12 Peter Åstrand cendio 2016-08-16 09:14:41 CEST
Google Chrome had this problem, since they are installing into /opt. Lintian warns when run without arguments, but not when executed with:

"/usr/bin/lintian --no-cfg --fail-on-warnings --profile ubuntu/aptdaemon"

This is because ubuntu/aptdaemon has:

Extends: debian/aptdaemon

...which has:

Disable-Tags:
        dir-or-file-in-opt,
        missing-dependency-on-libc,
        statically-linked-binary

IMO, our goal should be to do what Google Chrome does.
Comment 13 Henrik Andersson cendio 2016-08-16 15:27:18 CEST
(In reply to comment #12)
> Google Chrome had this problem, since they are installing into /opt. Lintian
> warns when run without arguments, but not when executed with:
> 
> "/usr/bin/lintian --no-cfg --fail-on-warnings --profile ubuntu/aptdaemon"
> 
> This is because ubuntu/aptdaemon has:
> 
> Extends: debian/aptdaemon
> 
> ...which has:
> 
> Disable-Tags:
>         dir-or-file-in-opt,
>         missing-dependency-on-libc,
>         statically-linked-binary
> 
> IMO, our goal should be to do what Google Chrome does.

We can't do that due to chrome doesn't ship any marked conffiles. We did move from /opt/.../etc to /etc/opt because of non-etc-file-marked-as-configfile was triggered.
Comment 14 Henrik Andersson cendio 2016-08-16 15:28:39 CEST
Reported a bug [1] upstream that aptdaemon lintian profile should disable 
dir-or-file-in-etc-opt for local package installation

[1] https://bugs.launchpad.net/aptdaemon/+bug/1613715
Comment 15 Henrik Andersson cendio 2016-08-17 09:18:33 CEST
One hack around the problem could be to move back config files from /etc/opt into /opt/thinlinc and with that get the non-etc-file-marked-as-configfile error. This tag is enabled in profiles but never marked as non overridable and there for we could ship an override file to ignore this error.
Comment 18 Henrik Andersson cendio 2016-08-17 13:13:06 CEST
(In reply to comment #15)
> One hack around the problem could be to move back config files from /etc/opt
> into /opt/thinlinc and with that get the non-etc-file-marked-as-configfile
> error. This tag is enabled in profiles but never marked as non overridable and
> there for we could ship an override file to ignore this error.

Commit r31610 moves the config files from /etc/opt back to /opt/thinlinc/etc which now makes the deb package to install nicely on ubuntu 16.04
Comment 19 Henrik Andersson cendio 2016-08-17 14:50:54 CEST
(In reply to comment #18)
> 
> Commit r31610 moves the config files from /etc/opt back to /opt/thinlinc/etc
> which now makes the deb package to install nicely on ubuntu 16.04
>

Verified that installation goes through nicely on:

  - Ubuntu 16.04
  - Ubuntu 14.04
Comment 21 Thomas Nilefalk cendio 2016-08-18 15:18:57 CEST
Verified on Xubuntu by running

    lintian --no-cfg --profile ubuntu/aptdaemon <package>

with no errors and 2 overridden lintian tags.
Comment 22 Thomas Nilefalk cendio 2016-08-18 15:22:10 CEST
This was tested on Xubuntu and installation of 4.6.0 through gnome-software did *not* exhibiy any error dialogues.

Possibly the original problem only affects certain flavours of Ubuntu where the GUI software installer runs lintian.

Note You need to log in before you can comment on or make changes to this bug.