1 ZPM - the ultimate package manager
2 ==================================
4 Like "git" for packages.
6 Would like a zpm-status and zpm-log, which should do things like
7 list incompletely installed packages, perhaps unacknowledged notes,
8 and so forth. zpm log should mainly show install/upgrade/deletes,
9 and repository actions.
11 Any machine readable outputs or inputs should be json, or something
12 easily parsable by shell and awk
14 Specifying the Package Database
15 -------------------------------
17 -f /path/to/db/or/file
18 env ZPMFILE only for single package ops
20 sourced in /etc/zpm.conf by setting environment variable?
21 default to /var/lib/zpm/local.zpm
23 Should probably distinguish here between the "package" and the "localdb".
24 They're not different technically, but
25 thus zpm install -f /path will still record in the ZPMDB
27 Specifying a Package Within a DB
28 --------------------------------
30 Need a name,version,release triple
32 But any string can be used, the system will attempt to disambiguate.
33 Can use zpm-findpkg to show how it would be interpreted.
35 Otherwise drawn from (first wins):
39 If you need specific versions:
43 Or use zpm-findpkg -a to find all packages that match
45 and any of those can be embedded in the them.
46 but start with either full triple in either ZPMPKG or -p,
47 or implied if neither is set
48 zpm-findpkg will return a triple, so can always run
59 gpg signatures :- use own signatures, or figure out PD way to get gpg
61 sha3 sums - not implemented
63 package contents integrity
64 sha256 sums of installed files
65 sha3 sums - not implemented
66 sha1 sums - not implemented
67 lists of directory contents
69 package database editing
70 mark a file as a configuration file
73 creating a package from the current state of an installed package
76 create a package from a tarball
84 build from shell scripts
88 write ahead log for package filesystem operations
89 it should always be possible for the package system
90 to figure out if it was interrupted
92 install, uninstall, upgrade, and downgrade hooks
96 network fetching of packages and package databases
97 reference counting of dynamic libs
99 simple packaging constructs
100 use shell scripts where possible
101 use shell functions as hooks and callbacks
103 A package is an SQLite database file.
105 Multiple packages in the same file.
107 need to mark a package as held for no automatic upgrade
109 configure to run a command after any package work
111 System Administration
112 ---------------------
116 zpm install <pkgname>
120 zpm repo add <repo_url>
122 List the files owned by a package
124 zpm contents <pkgname>
126 Capture current state of configuration files
128 zpm capture <pkgname>
130 Create a package file from an installed package
134 Extract file content from a package
136 zpm extract <hash> <path>
141 # add a new remote, -n don't do a pull immediately
142 zpm remote add [-n] <name> <url>
144 # show all the remotes
146 # set the preference level, higher is better
147 # perhaps remote "order" with lower better
148 # alpha by name on ties
149 zpm remote preference <name> <number>
151 zpm remote pull [name ...] # all if no name
152 zpm remote drop <name ...>
153 zpm remote freeze <name ...> # prevent updates?
154 # fetch content of remotes, cached in filesystem?
155 zpm remote fetch [-a] [package ...]
162 Build a package in the current directory
166 Create a package from a tarball
168 zpm build -t <tarfile> <packagefile>
170 Import the contents of one package file into another
172 zpm merge <basefile> <otherfile>
174 Create a package from a list of file names on stdin
176 find <find_options> | zpm build -s <packagefile>
178 Create a new empty package
180 zpm newpackage <packagefile>
182 Add a file to a package in a package db
184 zpm addtopackage <packagefile> <filepath>
186 Mark a file as a configuration file
188 zpm mark -c <packagefile> <path>
190 Mark a package as finished building
192 zpm complete <packagefile> <packagename>
197 Show the elf libraries needed by a program or library
201 Show the elf library provided by a library file
205 Get the sha256 hash of a file
209 Get the unix timestamp of a file
211 zpm stat -f '%m' <file>
213 Get the uid of a file
215 zpm stat -f '%u' <file>
220 A repository is just an archive of packages, which amounts to package metadata,
221 plus possibly file path and hash information. That is, the packages and
222 packagefiles tables, and possibly the elf information. Could be pretty much
223 everything except the actual file content. Could put a repo column on all of
224 those tables, with NULL being no repo information. Otherwise separate tables.
225 For the file paths, or at least the repo, need a url, could require it to be
226 automatically constructed from the repo url, possibly with escapes.
228 Need a repo table with the remote repo name (locally decided), remote repo url,
229 and perhaps preference and trust policy.
233 zpm repo add <name> <url> # repo info download/fetch url
234 zpm repo sync [name] # all if no name
235 zpm repo preference <pref> [name ...]
236 zpm repo clone <name> # download all packages to some destination
238 This might mean that the package identifier tuple would be the repo, name, version, release. Which is getting a bit complex, so we need some way to
239 set sensible defaults.
244 A building a package with zpm build.
246 Source a build script named ZBUILD, or package.build. Not sure which.
247 Either way, build script itself shouldn't do anything other
248 than setting variables and defining functions.
252 srcdir: where the source code is unpacked
256 source: a list of urls, suitable for curl to download
257 checksum: a corresponding list of sha256 checksums
258 PACKAGE: the name of the package
259 VERSION: the package version
263 install: should install the package under $pkgtree
264 can create more than one package under $pkgbase
266 postpackage: optional a function to run after the package file is created,
267 one arg, path to zpm file
269 build: compile the package
271 internal zpm functions:
276 There are no "subpackages", but you can tag paths
277 at install time you can include or exclude paths
278 you get ((tag match include) and (tag not match exclude))
279 default include is all, and default exclude is none
281 might use ^: for standard "what is this" tags,
282 and ^@ for "sub-package" tagging, or what amount
283 to optional parts of an install
285 A tag must be no whitespace and no shell metacharacters
289 Hmm, it would make sense to tag regardless of package.
290 perhaps require -A or somesuch.
292 setting tags when building a package:
294 zpm tag [-r] -f $pkgfile <glob> tag [...]
298 zpm tag -a -f $pkgfile <glob> tag [...]
302 zpm tag -d -f $pkgfile <glob> tag [...]
306 zpm tag -l -f $pkgfile <glob>
308 test tag: i.e. does a file have (all) given tag(s)
310 zpm tag -t -f $pkgfile <glob> tag [...]
315 dev: headers and static libraries
316 doc: man pages and other documentation
319 shlib: shared libraries
321 maybe prefix standard tags with ':' and then anything else
322 is free to be used. need a way to list all package tags