]> pd.if.org Git - zpackage/blob - README
remove stray debug fprintf
[zpackage] / README
1 ZPM - the ultimate package manager
2 ==================================
3
4 Like "git" for packages.
5
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.
10
11 Any machine readable outputs or inputs should be json, or something
12 easily parsable by shell and awk
13
14 Specifying the Package Database
15 -------------------------------
16
17 -f /path/to/db/or/file
18 env ZPMFILE only for single package ops
19 env ZPMDB
20 sourced in /etc/zpm.conf by setting environment variable?
21 default to /var/lib/zpm/local.zpm
22
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
26
27 Specifying a Package Within a DB
28 --------------------------------
29
30 Need a name,version,release triple
31
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.
34
35 Otherwise drawn from (first wins):
36 -p <package string>
37 env ZPMPKG
38
39 If you need specific versions:
40 env ZPMPKGVER
41 env ZPMPKGREL
42
43 Or use zpm-findpkg -a to find all packages that match
44
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
49 zpm-findpkg and 
50
51 Features
52 --------
53
54 binary installs
55
56 package metadata
57
58 package integrity
59         gpg signatures :- use own signatures, or figure out PD way to get gpg
60         sha256 sums
61         sha3 sums - not implemented
62
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
68
69 package database editing
70         mark a file as a configuration file
71
72 repackaging
73         creating a package from the current state of an installed package
74
75 package a tarball
76         create a package from a tarball
77
78 package from stdin
79         like cpio
80
81 package a directory
82         like tar
83
84 build from shell scripts
85
86 rebuild a package
87
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
91
92 install, uninstall, upgrade, and downgrade hooks
93
94 dependency tracking
95
96 network fetching of packages and package databases
97 reference counting of dynamic libs
98
99 simple packaging constructs
100         use shell scripts where possible
101         use shell functions as hooks and callbacks
102
103 A package is an SQLite database file.
104
105 Multiple packages in the same file.
106
107 need to mark a package as held for no automatic upgrade
108
109 configure to run a command after any package work
110
111 System Administration
112 ---------------------
113
114 Install a package
115
116         zpm install <pkgname>
117
118 Add a repository
119
120         zpm repo add <repo_url>
121
122 List the files owned by a package
123
124         zpm contents <pkgname>
125
126 Capture current state of configuration files
127
128         zpm capture <pkgname>
129
130 Create a package file from an installed package
131
132         zpm export <pkgname>
133
134 Extract file content from a package
135
136         zpm extract <hash> <path>
137
138 Remote Repositories
139 -------------------
140
141         # add a new remote, -n don't do a pull immediately
142         zpm remote add [-n] <name> <url>
143
144         # show all the remotes
145         zpm remote list
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>
150
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 ...]
156
157         # list
158
159 Packaging Software
160 ------------------
161
162 Build a package in the current directory
163
164         zpm build
165
166 Create a package from a tarball
167
168         zpm build -t <tarfile> <packagefile>
169
170 Import the contents of one package file into another
171
172         zpm merge <basefile> <otherfile>
173
174 Create a package from a list of file names on stdin
175
176         find <find_options> | zpm build -s <packagefile>
177
178 Create a new empty package
179
180         zpm newpackage <packagefile>
181
182 Add a file to a package in a package db
183
184         zpm addtopackage <packagefile> <filepath>
185
186 Mark a file as a configuration file
187
188         zpm mark -c <packagefile> <path>
189
190 Mark a package as finished building
191
192         zpm complete <packagefile> <packagename>
193
194 Utilities
195 ---------
196
197 Show the elf libraries needed by a program or library
198
199         zpm soneed <file>
200
201 Show the elf library provided by a library file
202
203         zpm soname <file>
204
205 Get the sha256 hash of a file
206
207         zpm hash <file>
208
209 Get the unix timestamp of a file
210
211         zpm stat -f '%m' <file>
212
213 Get the uid of a file
214
215         zpm stat -f '%u' <file>
216
217 Repositories
218 ------------
219
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.
227
228 Need a repo table with the remote repo name (locally decided), remote repo url,
229 and perhaps preference and trust policy.
230
231 Something like
232
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
237
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.
240
241 Build Scripts
242 -------------
243
244 A building a package with zpm build.
245
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.
249
250 zpm build variables:
251
252 srcdir: where the source code is unpacked
253
254 variables:
255
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
260
261 functions:
262
263 install: should install the package under $pkgtree
264 can create more than one package under $pkgbase
265
266 postpackage: optional a function to run after the package file is created,
267 one arg, path to zpm file
268
269 build: compile the package
270
271 internal zpm functions:
272
273 Package File tags
274 -----------------
275
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
280
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
284
285 A tag must be no whitespace and no shell metacharacters
286
287         [a-zA-Z:=@.]+
288
289 Hmm, it would make sense to tag regardless of package.
290 perhaps require -A or somesuch.
291
292 setting tags when building a package:
293
294         zpm tag [-r] -f $pkgfile <glob> tag [...]
295
296 add tags
297
298         zpm tag -a -f $pkgfile <glob> tag [...]
299
300 remove tags
301
302         zpm tag -d -f $pkgfile <glob> tag [...]
303
304 list tags
305         
306         zpm tag -l -f $pkgfile <glob>
307
308 test tag: i.e. does a file have (all) given tag(s)
309
310         zpm tag -t -f $pkgfile <glob> tag [...]
311
312 Standard tags
313 -------------
314
315 dev: headers and static libraries
316 doc: man pages and other documentation
317 man: man pages
318 lib: libraries
319 shlib: shared libraries
320
321 maybe prefix standard tags with ':' and then anything else
322 is free to be used.  need a way to list all package tags
323 zpm pkgtags ?