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
-
- Posts: 38
- Joined: 2012-03-28 05:43
Debian Package File Location
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?
/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
Re: Debian Package File Location
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
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
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 72 times
Re: Debian Package File Location
You can create the symlink in a debian/links file or debian/package.links file. From the dh_link manpage:
so an example would be
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).
Code: Select all
usr/lib/package/something usr/bin/something
MX Linux packager and developer
-
- Posts: 38
- Joined: 2012-03-28 05:43
Re: Debian Package File Location
I'm glad it's obvious to someone as a beginner I find the error messages are somewhat terse.Well, seems kind of obvious
To me "E: <myapp>: executable-desktop-file usr/share/applications/<myapp>.desktop 0755" and your comment
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."desktop can't be executable at that location, policy violation?
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.the permissions are wrong on the dir you create,
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".
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.It would be great if you got a mentor, try that one #debian-mentor or something.
I'll see what I can find.Try one of the IRC channels for debian packaging.
Ubuntu Budgie 20.10
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 72 times
Re: Debian Package File Location
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
-
- Posts: 38
- Joined: 2012-03-28 05:43
Re: Debian Package File Location
@stevepusser Re your second post:
Will consider your first post later in the week, thanks.
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.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 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.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.
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
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 72 times
Re: Debian Package File Location
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
-
- Posts: 38
- Joined: 2012-03-28 05:43
Re: Debian Package File Location
@stevepusser
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.Do you get the same lintian errors if you build on the command line instead of with debreate, such as with the "debuild" command...?
Last edited by ChrisOfBristol on 2019-02-21 10:12, edited 2 times in total.
Ubuntu Budgie 20.10
-
- Posts: 38
- Joined: 2012-03-28 05:43
Re: Debian Package File Location
@stevepusser
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!
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.
Ubuntu Budgie 20.10
-
- Posts: 38
- Joined: 2012-03-28 05:43