Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian Package File Location

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Debian Package File Location

#1 Post by ChrisOfBristol »

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 20.10

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Debian Package File Location

#2 Post by bw123 »

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
resigned by AI ChatGPT

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Debian Package File Location

#3 Post by stevepusser »

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
MX Linux packager and developer

ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Re: Debian Package File Location

#4 Post by ChrisOfBristol »

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 20.10

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Debian Package File Location

#5 Post by stevepusser »

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.
MX Linux packager and developer

ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Re: Debian Package File Location

#6 Post by ChrisOfBristol »

@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.
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-21 10:08, edited 4 times in total.
Ubuntu Budgie 20.10

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Debian Package File Location

#7 Post by stevepusser »

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.
MX Linux packager and developer

ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Re: Debian Package File Location

#8 Post by ChrisOfBristol »

@stevepusser
Do you get the same lintian errors if you build on the command line instead of with debreate, such as with the "debuild" command...?
Using debuild made all the difference as it the file permission errors didn't occur and where there were other problems it gave accurate errors which I could research.
Last edited by ChrisOfBristol on 2019-02-21 10:12, edited 2 times in total.
Ubuntu Budgie 20.10

ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Re: Debian Package File Location

#9 Post by ChrisOfBristol »

@stevepusser

Code: Select all

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.
Having sorted out the rest of it have come back to this and realised that I didn't know what I was doing - the symlinks aren't necessary!
Ubuntu Budgie 20.10

ChrisOfBristol
Posts: 38
Joined: 2012-03-28 05:43

Re: Debian Package File Location

#10 Post by ChrisOfBristol »

Closed
Ubuntu Budgie 20.10

Post Reply