PLIST files - lwfitzgerald/spksrc GitHub Wiki
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 typesbin
andlib
)
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.
-
Save the temporary file as
PLIST
in the<package>
directory. -
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
-
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
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