PLIST files - SynoCommunity/spksrc GitHub Wiki

What is a PLIST file used for?

A PLIST file has one main purpose: minimize the size of a (cross) package.

To achieve that result, during building the package, the following happens:

  • Anything not included in PLIST is not included in $(STAGING_DIR);
  • spksrc/mk/spksrc.strip.mk strips unnecessary information from binary files (specifically from the file types bin and lib)

When to use PLIST.auto?

The PLIST.auto empty file allows using the content of the auto-generated work-<arch>-<dsm-version>/dependency.plist.auto file for processing the list of files to be included in the SPK package creation for this specific dependency.

This should only be used for trivial packages such as web-site or other ensemble of static files. It can also be used in exceptional cases when the dependency is much too complex and varies depending of the arch being built.

How do I prepare a PLIST file?

When you build a package with make arch-<ARCH>, spksrc/mk/spksrc.install.mk creates a file called <package>.plist in $(WORK_DIR). This file can be used as a starting point to create a correct PLIST file.

  1. Save the temporary file as PLIST in the <package> directory.

  2. Note that the file originally contains all the files created during the build process. Any files that are not needed for the package to work should be removed from the PLIST file. Examples of removable files are README files, man files, most files in the /include directory and files ending on .a, .la, .mo, .pc, .pyc

  3. All remaining files should be prepended with the correct file type, with a colon (:) as delimiter:

  • bin is used for binary files, commonly found in /bin or /sbin folders
  • lib is used for libraries (i.e files ending on .so), commonly found in /lib folder
  • lnk is used for linker files to libraries, commonly found in /lib folder
  • rsc is used for all other files.

You should prepend the file type as follows: <file type>:<file>. Example: bin:bin/python2.7

Example

Shown below is the python.plist.tmp file, along with the resulting PLIST file.

Note that the complete python.plist.tmp file is truncated to fit as an example. For clarity, #not needed is added to show which files were stripped, either because they are not needed for Python to work, or because they fall into the removable files category.

bin/2to3
bin/idle
bin/pydoc
bin/smtpd.py
bin/python
bin/python2
bin/python2.7
bin/python2.7-config                 #not needed
include/python2.7/abstract.h         #not needed
[..]
lib/libpython2.7.so
lib/libpython2.7.so.1.0
[..]
lib/python2.7/site-packages/README   #README: not needed
lib/python2.7/zipfile.py             #not needed
share/man/man1/python.1              #man: not needed
etc/mime.types
include/python2.7/pyconfig.h

is converted to:

bin:bin/2to3
bin:bin/idle
bin:bin/pydoc
bin:bin/smtpd.py
lnk:bin/python
lnk:bin/python2
bin:bin/python2.7
lnk:lib/libpython2.7.so
lib:lib/libpython2.7.so.1.0
rsc:lib/python2.7
lib:lib/python2.7/lib-dynload/*.so
rsc:etc/mime.types
rsc:include/python2.7/pyconfig.h
⚠️ **GitHub.com Fallback** ⚠️