jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.16k stars 1.07k forks source link

replace solaris packaging tools #489

Open marcewho opened 11 years ago

marcewho commented 11 years ago

Directory Structure


bash-3.2# ls -la
total 40
drwxr-xr-x   3 root     root         305 Jul 12 14:50 .
drwxrwxrwt   9 root     sys          958 Jul 12 14:50 ..
-rw-r--r--   1 root     root         152 Jul 12 14:50 pkginfo
-rw-r--r--   1 root     root        1069 Jul 12 14:50 pkgmap
drwxr-xr-x   4 root     root         237 Jul 12 14:50 root
bash-3.2#

pkginfo


bash-3.2# cat pkginfo
PKG=
NAME=
VERSION=
ARCH=
CLASSES=
CATEGORY=
VENDOR=
PSTAMP=
EMAIL=
BASEDIR=/

pkgmap ( this is the tricky part, might want to read http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Fpkgmap_4.htm )


bash-3.2# cat pkgmap
# Each pkgmap must have one line that provides information about the number and maximum size (in 512-byte blocks) of parts that make up the package. 
# This line is in the following format ":number_of_parts  maximum_part_size"
# part fstype class pathname mode owner group size cksum modtime
: 1 8612
1 d none /etc 0755 root root
1 d none /etc/init.d 0755 root root
1 f none /etc/init.d/ddmi 0755 root root 1052 23604 1359526212
1 d none /etc/rc3.d 0755 root root
1 s none /etc/rc3.d/S99local_ddmi=../init.d/ddmi
1 d none /var 0755 root root
1 d none /var/HPDDMIData 0755 root root
1 d none /var/opt 0755 root root
1 d none /var/opt/HPDDMIAgent 0755 root root
1 d none /var/opt/HPDDMIAgent/Plugins 0755 root root
1 d none /var/opt/HPDDMIAgent/Plugins/usage 0755 root root
1 f none /var/opt/HPDDMIAgent/Plugins/usage/discusge 0555 root root 1050516 24048 1330672471
1 f none /var/opt/HPDDMIAgent/Plugins/usage/plugin.ini 0644 root root 104 7572 1359526800
1 f none /var/opt/HPDDMIAgent/acstrust.cert 0444 root root 1416 50076 1358068484
1 f none /var/opt/HPDDMIAgent/agentca.pem 0444 root root 3187 1867 1358068484
1 d none /var/opt/HPDDMIAgent/bin 0755 root root
1 f none /var/opt/HPDDMIAgent/bin/discagnt 0555 root root 3134456 25441 1330672471
1 f none /var/opt/HPDDMIAgent/bin/discagnt.ini 0444 root root 100 7325 1358068484
1 i pkginfo 152 11774 1373658628
bash-3.2#

Most of the content can be gathered with find


find  -printf '%y none %p %m root root %s\n' 

The missing parts are:


bash-3.2# ls -la root/
total 32
drwxr-xr-x   4 root     root         237 Jul 12 14:50 .
drwxr-xr-x   3 root     root         305 Jul 12 14:50 ..
drwxr-xr-x   3 root     root         180 Jul 12 14:50 etc
drwxr-xr-x   3 root     root         177 Jul 12 14:50 var
bash-3.2#

Package it


tar cvzf ddmi-agent.0.1.sol10-x86.pkg.tar.gz .
jordansissel commented 11 years ago

fpm -t solaris outputs packages installable with pkgadd -d thepackage

I did some scouring for old packages, found them on OpenCSW - The file format of solaris srv4 packages is called "package stream":

% file ant-1.7.0,REV=2007.09.17-SunOS5.8-all-CSW.pkg
ant-1.7.0,REV=2007.09.17-SunOS5.8-all-CSW.pkg: pkg Datastream (SVR4)
% head -1 ant-1.7.0,REV=2007.09.17-SunOS5.8-all-CSW.pkg 
# PaCkAgE DaTaStReAm

This is the file format that we want to reproduce, I think. I can roughly read it with a text editor, but the header for each file is a bit non obvious.