Debian Package File Location

News and discussion about development of the Debian OS itself

Debian Package File Location

Postby ChrisOfBristol » 2019-02-11 13:31

I have produced a .deb file for my Python application which works. I want to to check that I have done things correctly, but there is so much documentation that it's difficult to see what I have done wrong.

/usr/share/applications contains <myapp>.desktop
/usr/bin contains a shortcut created by a bash script on installation
/usr/share/<myapp> contains everything else.

There are several Lintian errors/warnings:
A few like this referring to directory permissions, which I don't understand as they refer to directories created by the system:
W: <myapp>: non-standard-dir-perm usr/ 0775 != 0755

These all refer to the desktop file - are these not allowed?
E: <myapp>: executable-desktop-file usr/share/applications/<myapp>.desktop 0755
W: <myapp>: executable-not-elf-or-script usr/share/applications/<myapp>.desktop
W: <myapp>: non-standard-file-perm usr/share/applications/<myapp>.desktop 0664 != 0644

It doesn't like the scripts that create/remove the shortcut either:
W: <myapp>: maintainer-script-ignores-errors postinst
W: <myapp>: maintainer-script-ignores-errors prerm
How am I supposed to create the shortcut without them? Perhaps I should be using something other than a shortcut to start the program?
Ubuntu Budgie 18.10
ChrisOfBristol
 
Posts: 28
Joined: 2012-03-28 05:43

Re: Debian Package File Location

Postby bw123 » 2019-02-11 14:14

Well, seems kind of obvious, the permissions are wrong on the dir you create, and .desktop can't be executable at that location, policy violation?
https://www.debian.org/doc/manuals/main ... l#lintians
https://duckduckgo.com/html/?q=debian+m ... res-errors

Try one of the IRC channels for debian packaging. I don't have the list handy. It would be great if you got a mentor, try that one #debian-mentor or something.
https://wiki.debian.org/DebianMentorsFaq
User avatar
bw123
 
Posts: 3757
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Debian Package File Location

Postby stevepusser » 2019-02-11 20:26

You can create the symlink in a debian/links file or debian/package.links file. From the dh_link manpage:

Code: Select all
FILES

debian/package.links
    Lists pairs of source and destination files to be symlinked. Each pair should be put on its own line, with the source and destination separated by whitespace.
    In each pair the source file (called target by ln(1)) comes first and is followed by the destination file (called link name by ln(1)). Thus the pairs of source and destination files in each line are give in the same order as they would be given to ln(1).
    In contrast to ln(1), source and destination paths must be absolute (the leading slash is optional).


so an example would be

Code: Select all
usr/lib/package/something usr/bin/something
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, 4..20.6 kernel, wine-staging 4.0 final, Sayonara 1.1.1, Calibre 3.39.1, Pale Moon 28.3.1
User avatar
stevepusser
 
Posts: 10513
Joined: 2009-10-06 05:53

Re: Debian Package File Location

Postby ChrisOfBristol » 2019-02-11 20:56

Well, seems kind of obvious
I'm glad it's obvious to someone :) as a beginner I find the error messages are somewhat terse.
To me "E: <myapp>: executable-desktop-file usr/share/applications/<myapp>.desktop 0755" and your comment
desktop can't be executable at that location, policy violation?
meant "you can't put the .desktop file here", but there are loads of others there, and https://developer.gnome.org/integration ... es.html.en says "Place this file in the /usr/share/applications directory". I have now realised that it meant "You may put it here, but it shouldn't have the executable property."

the permissions are wrong on the dir you create,

The Lintian check was done by Debreate, so it looks as though it is doing something wrongly, For example it is complaining about the permissions on OS directories like /usr! (marked <<<<<) Obviously the system directories aren't wrong but the others are, I'll have to add a fix to the script.

W: <myapp>: non-standard-dir-perm usr/ 0775 != 0755 <<<<<
W: <myapp>: non-standard-dir-perm usr/share/ 0775 != 0755 <<<<<
W: <myapp>: non-standard-dir-perm usr/share/applications/ 0775 != 0755 <<<<<
W: <myapp>: non-standard-file-perm usr/share/applications/<myapp>.desktop 0664 != 0644
W: <myapp>: non-standard-dir-perm usr/share/doc/ 0775 != 0755 <<<<<
W: <myapp>: non-standard-dir-perm usr/share/doc/<myapp>/ 0775 != 0755
W: <myapp>: non-standard-file-perm usr/share/doc/<myapp>/changelog.gz 0664 != 0644
W: <myapp>: non-standard-file-perm usr/share/doc/<myapp>/copyright 0664 != 0644
W: <myapp>: non-standard-dir-perm usr/share/<myapp>/ 0775 != 0755

"It doesn't like the scripts that create/remove the shortcut either:"
I've added "set -e".

It would be great if you got a mentor, try that one #debian-mentor or something.

Tried that a couple of years ago, two people said they would help then disappeared without trace, so I decided I would have to manage without. Maybe I should try again, when I've sorted out the file permissions.

Try one of the IRC channels for debian packaging.

I'll see what I can find.
Ubuntu Budgie 18.10
ChrisOfBristol
 
Posts: 28
Joined: 2012-03-28 05:43

Re: Debian Package File Location

Postby stevepusser » 2019-02-12 19:06

Do you get the same lintian errors if you build on the command line instead of with debreate, such as with the "debuild" command from devscripts? I'd also try removing the executable bit from the desktop file and see if the Debian build process restores it automatically, if it even needs to be set.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, 4..20.6 kernel, wine-staging 4.0 final, Sayonara 1.1.1, Calibre 3.39.1, Pale Moon 28.3.1
User avatar
stevepusser
 
Posts: 10513
Joined: 2009-10-06 05:53

Re: Debian Package File Location

Postby ChrisOfBristol » 2019-02-12 20:49

@stevepusser Re your second post:
Do you get the same lintian errors if you build on the command line instead of with debreate, such as with the "debuild" command from devscripts?

The only remaining Lintian errors are about file permissions. I think I tried something like debuild a couple of years ago but didn't know enough about Debian to be able to use it. I have found Debreate very usable. Now I understand the packaging process a bit better (and since my app will mostly package correctly, I won't get flooded with mystifying error messages), I could try debuild again. The alternative of fixing the Debreate-caused file permissions at some point in the process might be more work. To be fair to the Debreate people I'll report the bug too (may be my misuse of course).
I'd also try removing the executable bit from the desktop file and see if the Debian build process restores it automatically, if it even needs to be set.
I did finally work out that it was the file permissions of the desktop file that were the problem, not its presence in that directory. Once I removed the 'execute' Lintian was happy with it and it works without it.

Will consider your first post later in the week, thanks.
Last edited by ChrisOfBristol on 2019-02-12 21:44, edited 3 times in total.
Ubuntu Budgie 18.10
ChrisOfBristol
 
Posts: 28
Joined: 2012-03-28 05:43

Re: Debian Package File Location

Postby stevepusser » 2019-02-12 21:39

I've used debian/links files in the past myself, so I know they work, and are much simpler than using postinst scripts to accomplish the same thing.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, 4..20.6 kernel, wine-staging 4.0 final, Sayonara 1.1.1, Calibre 3.39.1, Pale Moon 28.3.1
User avatar
stevepusser
 
Posts: 10513
Joined: 2009-10-06 05:53

Re: Debian Package File Location

Postby ChrisOfBristol » 2019-02-13 17:26

5.13. package.links
If you need to create additional symlinks[my bold] in package build directories as package maintainer, you should install them using dh_link(1) by listing their full paths of source and destination files in a package.links file.

@stevepusser
stevepusser wrote:debian/links files

I don't want 'addtitional symlinks', just a link for /usr/bin to run the program which is in /user/share/<maypp>. First thing for me to establish is whether that is the correct way to do it. If so, I'll leave it as there isn't much to it, just 3 lines in DEBIAN/postinst:
Code: Select all
#! /bin/bash
set -e
ln -s "/usr/share/<myapp>/<myapp>.py" "/usr/bin/<myapp>"
Ubuntu Budgie 18.10
ChrisOfBristol
 
Posts: 28
Joined: 2012-03-28 05:43


Return to Debian Development

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable