admin管理员组

文章数量:1356889

Here is an MWE to create a simple test package with 2 files.

$ cat hello.sh 
#!/usr/bin/sh
cat mydatafolder/data.txt

$ cat mydatafolder/data.txt 
Hello World!

hello-world-1.0 $ tree -L 1
.
├── debian
├── hello.sh
└── mydatafolder

3 directories, 1 file

Now how do I refer to data.txt so that the same incantation works both while creating the package and after installing it.

Here is what I tried:

hello-world-1.0$ cat debian/install 
hello.sh usr/bin
mydatafolder/* usr/share/mydatafolder

hello-world-1.0$ echo $XDG_DATA_DIRS 
/usr/share/gnome:/usr/local/share/:/usr/share/

When I create and install the package it says :

$ hello.sh
cat: mydatafolder/data.txt: No such file or directory

Should'nt mydatafolder which is in /usr/share/ be in the list of folders in $XDG_DATA_DIRS ? Is that not how it works?

本文标签: debUsing the XDG standard to refer to files in an installed Debian packageStack Overflow