aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/c-ares/Makefile45
-rw-r--r--examples/c-ares/c-ares.license10
-rw-r--r--examples/c-ares/c-ares.p5m93
-rw-r--r--rules/32.mk29
-rw-r--r--rules/64.mk29
-rw-r--r--rules/archive.mk64
-rw-r--r--rules/autotools.mk59
-rw-r--r--rules/common.mk90
-rw-r--r--rules/ips.mk117
-rwxr-xr-xscripts/download-archive25
-rwxr-xr-xscripts/unpack-archive28
-rwxr-xr-xscripts/validate-archive55
-rw-r--r--trans/actuators49
-rw-r--r--trans/archive-libraries-drop2
-rw-r--r--trans/autopyc29
-rw-r--r--trans/defaults114
-rw-r--r--trans/devel50
-rw-r--r--trans/docs49
-rw-r--r--trans/libtool-drop2
-rw-r--r--trans/locale31
20 files changed, 970 insertions, 0 deletions
diff --git a/examples/c-ares/Makefile b/examples/c-ares/Makefile
new file mode 100644
index 0000000..66dfa3c
--- /dev/null
+++ b/examples/c-ares/Makefile
@@ -0,0 +1,45 @@
+
+# We are going to package for IPS ;-)
+include /usr/share/cibs/rules/ips.mk
+
+# We are using tarball(s)
+include /usr/share/cibs/rules/archive.mk
+
+# We are using GNU configure
+include /usr/share/cibs/rules/autotools.mk
+
+# We will build 32-bit version
+include /usr/share/cibs/rules/32.mk
+
+# ... and 64-bit
+include /usr/share/cibs/rules/64.mk
+
+
+summary := C library that performs DNS requests and name resolves asynchronously
+license := MIT
+
+# build-depends +=
+# build-conflicts +=
+
+home := http://c-ares.haxx.se
+name := c-ares
+version := 1.9.1
+archive := $(name)-$(version).tar.gz
+download := $(home)/download/$(archive)
+checksum := \
+ sha1:fe41e47f300bfd587b7f552a141ad3bf85437b0f \
+ sha256:023f28001f2f839645c8700187391a011198950c73ddd91510c7549d87373936 \
+ md5:389db4917a3b58c4ce4ebfe961fd84c4 \
+ size:782945
+
+# archives := more.zip tarballs.tar.bz2
+# download_more.zip := ftp://...
+# download_tarballs.tar.bz2 := https://...
+# checksum_more.zip := ...
+# checksum_tarballs.tar.bz2 := ...
+#
+# patch::
+# autoreconf -vi
+
+
+
diff --git a/examples/c-ares/c-ares.license b/examples/c-ares/c-ares.license
new file mode 100644
index 0000000..f0a205f
--- /dev/null
+++ b/examples/c-ares/c-ares.license
@@ -0,0 +1,10 @@
+Copyright 1998 by the Massachusetts Institute of Technology.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided that
+the above copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting documentation, and that
+the name of M.I.T. not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior permission.
+M.I.T. makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
diff --git a/examples/c-ares/c-ares.p5m b/examples/c-ares/c-ares.p5m
new file mode 100644
index 0000000..cca0962
--- /dev/null
+++ b/examples/c-ares/c-ares.p5m
@@ -0,0 +1,93 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+
+set name=pkg.fmri value=pkg:/library/c-ares@$(ips_version)
+set name=pkg.summary value="$(summary)"
+set name=info.upstream-url value="$(home)"
+set name=info.source_url value="$(download)"
+license c-ares.license license="$(license)"
+
+
+dir path=usr
+dir path=usr/lib
+dir path=usr/lib/$(MACH64)
+dir path=usr/lib/$(MACH64)/pkgconfig
+dir path=usr/lib/pkgconfig
+dir path=usr/share
+dir path=usr/share/man
+dir path=usr/share/man/man3
+dir path=usr/include
+file path=usr/lib/$(MACH64)/libcares.so.2.0.0
+file path=usr/lib/$(MACH64)/pkgconfig/libcares.pc
+file path=usr/lib/pkgconfig/libcares.pc
+file path=usr/lib/libcares.so.2.0.0
+file path=usr/share/man/man3/ares_parse_soa_reply.3
+file path=usr/share/man/man3/ares_timeout.3
+file path=usr/share/man/man3/ares_parse_ptr_reply.3
+file path=usr/share/man/man3/ares_query.3
+file path=usr/share/man/man3/ares_free_hostent.3
+file path=usr/share/man/man3/ares_free_data.3
+file path=usr/share/man/man3/ares_gethostbyname.3
+file path=usr/share/man/man3/ares_parse_mx_reply.3
+file path=usr/share/man/man3/ares_save_options.3
+file path=usr/share/man/man3/ares_expand_string.3
+file path=usr/share/man/man3/ares_get_servers.3
+file path=usr/share/man/man3/ares_parse_txt_reply.3
+file path=usr/share/man/man3/ares_library_cleanup.3
+file path=usr/share/man/man3/ares_parse_srv_reply.3
+file path=usr/share/man/man3/ares_version.3
+file path=usr/share/man/man3/ares_init_options.3
+file path=usr/share/man/man3/ares_init.3
+file path=usr/share/man/man3/ares_process.3
+file path=usr/share/man/man3/ares_cancel.3
+file path=usr/share/man/man3/ares_fds.3
+file path=usr/share/man/man3/ares_destroy.3
+file path=usr/share/man/man3/ares_parse_ns_reply.3
+file path=usr/share/man/man3/ares_parse_aaaa_reply.3
+file path=usr/share/man/man3/ares_parse_naptr_reply.3
+file path=usr/share/man/man3/ares_gethostbyaddr.3
+file path=usr/share/man/man3/ares_strerror.3
+file path=usr/share/man/man3/ares_gethostbyname_file.3
+file path=usr/share/man/man3/ares_free_string.3
+file path=usr/share/man/man3/ares_search.3
+file path=usr/share/man/man3/ares_parse_a_reply.3
+file path=usr/share/man/man3/ares_library_init.3
+file path=usr/share/man/man3/ares_set_socket_callback.3
+file path=usr/share/man/man3/ares_mkquery.3
+file path=usr/share/man/man3/ares_set_servers.3
+file path=usr/share/man/man3/ares_getnameinfo.3
+file path=usr/share/man/man3/ares_expand_name.3
+file path=usr/share/man/man3/ares_dup.3
+file path=usr/share/man/man3/ares_destroy_options.3
+file path=usr/share/man/man3/ares_getsock.3
+file path=usr/share/man/man3/ares_send.3
+file path=usr/include/ares_build.h
+file path=usr/include/ares_rules.h
+file path=usr/include/ares_dns.h
+file path=usr/include/ares_version.h
+file path=usr/include/ares.h
+link path=usr/lib/libcares.so target=libcares.so.2.0.0
+link path=usr/lib/$(MACH64)/libcares.so target=libcares.so.2.0.0
+link path=usr/lib/$(MACH64)/libcares.so.2 target=libcares.so.2.0.0
+link path=usr/lib/libcares.so.2 target=libcares.so.2.0.0
diff --git a/rules/32.mk b/rules/32.mk
new file mode 100644
index 0000000..af1cf33
--- /dev/null
+++ b/rules/32.mk
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+
+build-stamp : build-32-stamp
+configure-stamp : configure-32-stamp
+install-stamp : install-32-stamp
+
+%-32-stamp: bits = 32
diff --git a/rules/64.mk b/rules/64.mk
new file mode 100644
index 0000000..0f05a1d
--- /dev/null
+++ b/rules/64.mk
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+
+build-stamp : build-64-stamp
+configure-stamp : configure-64-stamp
+install-stamp : install-64-stamp
+
+%-64-stamp: bits = 64
diff --git a/rules/archive.mk b/rules/archive.mk
new file mode 100644
index 0000000..82d46ab
--- /dev/null
+++ b/rules/archive.mk
@@ -0,0 +1,64 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+# include guard
+ifeq (,$(__archive_mk))
+
+.SECONDEXPANSION:
+
+archive-validator := /usr/share/cibs/scripts/validate-archive
+validate-%-stamp: download-%-stamp
+ if [ -n "$(checksum_$*)" ]; then \
+ $(archive-validator) $* $(checksum_$*) ; \
+ elif [ -n "$(checksum)" ]; then \
+ $(archive-validator) $* $(checksum) ; \
+ else \
+ echo "** ERROR: No checksum given" >&2; false ; \
+ fi
+ touch $@
+
+validate-stamp: $$(addprefix validate-,$$(addsuffix -stamp,$$(archives) $$(archive)))
+ touch $@
+validate:: validate-stamp
+
+
+archive-downloader := /usr/share/cibs/scripts/download-archive
+download-%-stamp:
+ [ -f "$*" ] || $(archive-downloader) "$*" $(download_$*) $(download)
+ touch $@
+
+download-stamp: $$(addprefix download-,$$(addsuffix -stamp,$$(archives) $$(archive)))
+ touch $@
+download:: download-stamp
+
+
+archive-unpacker := /usr/share/cibs/scripts/unpack-archive
+unpack-%-stamp: validate-%-stamp
+ $(archive-unpacker) $* $(sourcedir_$*) $(sourcedir)
+ touch $@
+
+unpack-stamp: $$(addprefix unpack-,$$(addsuffix -stamp,$$(archives) $$(archive)))
+
+__archive_mk := included
+endif
+
diff --git a/rules/autotools.mk b/rules/autotools.mk
new file mode 100644
index 0000000..fea7d12
--- /dev/null
+++ b/rules/autotools.mk
@@ -0,0 +1,59 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+# include guard
+ifeq (,$(__autotools_mk))
+
+include /usr/share/cibs/rules/common.mk
+
+
+configure := $(sourcedir)/configure
+configure-env = \
+ CC="$(CC)" \
+ CXX="$(CXX)" \
+
+
+configure-options = \
+ --prefix="$(prefix)" \
+ --libdir="$(libdir)" \
+ --bindir="$(bindir)" \
+ --includedir="$(includedir)" \
+
+configure-%-stamp: patch-stamp unpack-stamp
+ [ -d "$(builddir)" ] || mkdir -p "$(builddir)"
+ cd "$(builddir)" && \
+ env $(configure-env) \
+ $(configure) $(configure-options)
+ touch $@
+
+build-%-stamp: configure-%-stamp
+ cd "$(builddir)" && $(MAKE)
+ touch $@
+
+install-%-stamp: build-%-stamp
+ cd "$(builddir)" && $(MAKE) install DESTDIR="$(destdir)"
+ touch $@
+
+
+__autotools_mk := included
+endif
diff --git a/rules/common.mk b/rules/common.mk
new file mode 100644
index 0000000..ebfd992
--- /dev/null
+++ b/rules/common.mk
@@ -0,0 +1,90 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+# include guard:
+ifeq (,$(__common_mk))
+
+mach := $(shell uname -p)
+mach32 :=
+mach64 := amd64
+
+workdir := $(CURDIR)/work
+sourcedir := $(workdir)/source
+destdir := $(workdir)/proto
+builddir.32 := $(workdir)/build/32
+builddir.64 := $(workdir)/build/64
+
+CC.32 = gcc -m32
+CC.64 = gcc -m64
+CXX.32 = g++ -m32
+CXX.64 = g++ -m64
+
+export PATH := \
+ /usr/gcc/4.4/bin:/usr/gcc/4.3/bin:/usr/gnu/bin:/usr/sbin:/usr/bin:/sbin
+
+# Define LOCAL_MIRROR in environment, e. g. in ~/.bash_profile:
+mirrors := $(LOCAL_MIRROR) \
+ http://mirror.yandex.ru/gentoo-distfiles/distfiles \
+ http://mirror.ovh.net/gentoo-distfiles/distfiles
+
+prefix = /usr
+libdir.32 = $(prefix)/lib/$(mach32)
+libdir.64 = $(prefix)/lib/$(mach64)
+bindir.32 = $(prefix)/bin/$(mach32)
+bindir.64 = $(prefix)/bin/$(mach64)
+includedir.32 = /usr/include
+includedir.64 = /usr/include
+
+PKG_CONFIG_PATH.32 = /usr/gnu/lib/$(mach32)/pkg-config:/usr/lib/$(mach32)/pkg-config
+PKG_CONFIG_PATH.64 = /usr/gnu/lib/$(mach64)/pkg-config:/usr/lib/$(mach.64)/pkg-config
+export PKG_CONFIG_PATH = PKG_CONFIG_PATH.$(bits)
+
+# $(bits) are target-specific and defined in 32.mk or 64.mk
+bindir = $(bindir.$(bits))
+libdir = $(libdir.$(bits))
+includedir = $(includedir.$(bits))
+CC = $(CC.$(bits))
+CXX = $(CXX.$(bits))
+builddir = $(builddir.$(bits))
+
+
+
+# Common targets for internal usage.
+# Some modules (e. g. 32.mk, autotools.mk) add dependencies
+# to this, for example configure with autotools
+unpack-stamp patch-stamp configure-stamp build-stamp install-stamp:
+ touch $@
+
+# Common target to use from command line
+# or in component top-level Makefile:
+unpack :: unpack-stamp
+patch :: patch-stamp
+configure :: configure-stamp
+build :: build-stamp
+install :: install-stamp
+clean ::
+ rm -f *-stamp
+ rm -rf $(workdir)
+
+__common_mk := included
+endif
diff --git a/rules/ips.mk b/rules/ips.mk
new file mode 100644
index 0000000..14a4462
--- /dev/null
+++ b/rules/ips.mk
@@ -0,0 +1,117 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license
+# at http://www.opensource.org/licenses/CDDL-1.0
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each file.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved.
+#
+
+# include guard:
+ifeq (,$(__ips_mk))
+
+include /usr/share/cibs/rules/common.mk
+
+manifestdir := $(workdir)/manifest
+transdir := /usr/share/cibs/trans
+
+ifeq (,$(ips_version))
+ips_version = $(version)
+endif
+
+# Substitutions in IPS manifest:
+# XXX What about to grep all variables from component makefile?
+pkg-define = \
+-Dsummary="$(summary)" \
+-Dlicense="$(license)" \
+-Dhome="$(home)" \
+-Dname="$(name)" \
+-Dversion="$(version)" \
+-Dips_version="$(ips_version)" \
+-Darchive="$(archive)" \
+-Ddownload="$(download)" \
+-Dchecksum="$(checksum)" \
+
+pkg-define += \
+-DMACH="$(mach)" \
+-DMACH32="$(mach32)" \
+-DMACH64="$(mach64)" \
+
+
+# Where to find files:
+pkg-protos = \
+-d "$(destdir)" \
+-d "$(sourcedir)" \
+-d . \
+
+transformations := \
+$(transdir)/defaults \
+$(transdir)/actuators \
+$(transdir)/devel \
+$(transdir)/docs \
+$(transdir)/locale \
+
+
+
+# Supplied canonical manifests:
+manifests := $(wildcard *.p5m)
+
+#TODO: Expand "glob" action in manifests:
+globalizator := /usr/share/cibs/scripts/globalizator
+glob-manifests := $(manifests:%=$(manifestdir)/glob-%)
+$(glob-manifests): $(manifestdir)/glob-% : %
+ [ -d "$(manifestdir)" ] || mkdir -p "$(manifestdir)"
+ cp $< $@
+glob-stamp: $(glob-manifests)
+ touch $@
+
+
+mogrified-manifests := $(manifests:%=$(manifestdir)/mogrified-%)
+$(manifestdir)/mogrified-% : $(manifestdir)/glob-%
+ pkgmogrify $(pkg-define) \
+ $(transformations) \
+ $< | \
+ sed -e '/^$$/d' -e '/^#.*$$/d' | uniq > $@ || (rm -f $@; false)
+mogrify-stamp: $(mogrified-manifests)
+ touch $@
+
+
+depend-manifests := $(manifests:%=$(manifestdir)/depend-%)
+$(manifestdir)/depend-% : $(manifestdir)/mogrified-%
+ pkgdepend generate -m $(pkg-protos) $< > $@ || (rm -f $@; false)
+depend-stamp: $(depend-manifests)
+ touch $@
+$(depend-manifests): install-stamp
+
+res_suffix := resolved
+resolved-manifests := $(manifests:%=$(manifestdir)/depend-%.$(res_suffix))
+$(resolved-manifests): $(depend-manifests)
+ pkgdepend resolve -m -s $(res_suffix) $(depend-manifests)
+resolve-stamp: $(resolved-manifests)
+ touch $@
+
+publish-stamp: resolve-stamp
+ pkgsend -s $(ips-repo) publish --fmri-in-manifest \
+ $(pkg-protos) \
+ $(resolved-manifests)
+ touch $@
+
+publish: publish-stamp
+
+__ips_mk := included
+endif
+
diff --git a/scripts/download-archive b/scripts/download-archive
new file mode 100755
index 0000000..e8cce16
--- /dev/null
+++ b/scripts/download-archive
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+set -u
+
+fatal () {
+ echo "$@" >&2
+ exit 1
+}
+
+archive="$1"
+url="$2"
+shift 2
+
+wget=`type -p wget || true`
+curl=`type -p curl || true`
+
+if [ -n "$wget" ]; then
+ $wget -c -O "$archive" "$url" || rm -f "$archive"
+elif [ -n "$curl" ]; then
+ $curl "$url" > "$archive" || rm -f "$archive"
+else
+ fatal "Don't know howto download"
+fi
+
diff --git a/scripts/unpack-archive b/scripts/unpack-archive
new file mode 100755
index 0000000..4788fc1
--- /dev/null
+++ b/scripts/unpack-archive
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+set -u
+
+fatal () {
+ echo "$@" >&2
+ exit 1
+}
+
+archive="$1"
+sourcedir="$2"
+shift 2
+
+if ! [ -f "$archive" ]; then
+ fatal "No such file: $archive"
+fi
+
+case "$archive" in
+ *.tar.*|*.t?z|*.tbz2)
+ [ -d "$sourcedir" ] || mkdir -p "$sourcedir"
+ tar xf "$archive" -C "$sourcedir" --strip=1
+ ;;
+ *)
+ fatal "Unsupported archive: $archive"
+ ;;
+esac
+
diff --git a/scripts/validate-archive b/scripts/validate-archive
new file mode 100755
index 0000000..2d14066
--- /dev/null
+++ b/scripts/validate-archive
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+set -e
+set -u
+
+fatal () {
+ echo "$@" >&2
+ exit 1
+}
+
+archive="$1"
+shift
+
+if ! [ -f "$archive" ]; then
+ fatal "No such file: $archive"
+fi
+
+
+ok=0
+
+for item in "$@"; do
+ oIFS="$IFS"; IFS=':'
+ set -- $item
+ m="$1"
+ v="$2"
+ IFS="$oIFS"
+ case "$m" in
+ sha1|sha256|md5)
+ printf "$m: $archive: "
+ sum=`${m}sum "$archive" | awk '{print $1}'`
+ if [ "$sum" = "$v" ]; then
+ echo "OK"
+ else
+ echo "FAILED (got:$sum, expected:$v)"
+ ok=1
+ fi
+ ;;
+ size)
+ printf "$m: $archive: "
+ size=`stat -c '%s' "$archive"`
+ if [ "$size" = "$v" ]; then
+ echo "OK"
+ else
+ echo "FAILED (got:$size, expected:$v)"
+ ok=1
+ fi
+ ;;
+ *)
+ fatal "Unsupported method: $m"
+ ;;
+ esac
+done
+
+exit $ok
+
diff --git a/trans/actuators b/trans/actuators
new file mode 100644
index 0000000..e033943
--- /dev/null
+++ b/trans/actuators
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# SFW service manifests
+<transform file path=(var|lib)/svc/manifest/.*\.xml$ -> \
+ default restart_fmri svc:/system/manifest-import:default>
+
+# RBAC file fragments
+<transform file path=etc/security/[^/]+_attr.d/.+ -> \
+ default restart_fmri svc:/system/rbac:default>
+<transform file path=etc/user_attr.d/.+ -> \
+ default restart_fmri svc:/system/rbac:default>
+
+# Fonts and font configuration
+<transform file path=etc/fonts/conf\.(avail|d)/.+ -> \
+ default restart_fmri svc:/application/font/fc-cache:default>
+<transform file path=usr/share/font/.+ -> \
+ default restart_fmri svc:/application/font/fc-cache:default>
+
+# OpenGL selection scripts
+<transform file path=lib/opengl/ogl_select/.+ -> \
+ default restart_fmri svc:/application/opengl/ogl-select:default>
+
+# GNOME/XDG desktop files
+<transform file path=usr/share/applications/.*\.desktop$ -> \
+ default restart_fmri svc:/application/desktop-cache/desktop-mime-cache:default>
diff --git a/trans/archive-libraries-drop b/trans/archive-libraries-drop
new file mode 100644
index 0000000..010d1e6
--- /dev/null
+++ b/trans/archive-libraries-drop
@@ -0,0 +1,2 @@
+# stuff we drop from the proto area - not shipped
+<transform file path=.+/lib/.+\.a -> drop>
diff --git a/trans/autopyc b/trans/autopyc
new file mode 100644
index 0000000..6c9cea7
--- /dev/null
+++ b/trans/autopyc
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+# Don't bother specifying each .pyc file. Allow individual actions to
+# override this by setting pkg.tmp.autopyc to false.
+<transform file path=.*\.py$ -> default pkg.tmp.autopyc true>
+<transform file pkg.tmp.autopyc=true -> emit file path=%(path)c>
+<transform file pkg.tmp.autopyc=.* -> delete pkg.tmp.autopyc .*>
+<transform hardlink path=.*\.py$ -> emit hardlink path=%(path)c target=%(target)c>
diff --git a/trans/defaults b/trans/defaults
new file mode 100644
index 0000000..acf7b24
--- /dev/null
+++ b/trans/defaults
@@ -0,0 +1,114 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform dir path=etc$ -> default group sys>
+<transform dir path=etc/inet$ -> default group sys>
+<transform dir path=var$ -> default group sys>
+
+#
+# LP print service
+#
+<transform dir path=etc/lp/fd$ -> default owner root>
+<transform dir path=etc/lp/fd$ -> default mode 0755>
+<transform dir path=etc/lp(/.+){0,1}$ -> default owner lp>
+<transform dir path=etc/lp(/.+){0,1}$ -> default group lp>
+<transform dir path=etc/lp(/.+){0,1}$ -> default mode 0775>
+
+<transform dir path=etc/skel$ -> default group sys>
+<transform dir path=usr$ -> default group sys>
+<transform dir path=usr/lib/pkgconfig$ -> default group other>
+<transform dir path=usr/lib/.*/pkgconfig$ -> default group other>
+<transform dir path=usr/share$ -> default group sys>
+<transform dir path=usr/share/aclocal$ -> default group other>
+<transform dir path=usr/share/doc$ -> default group other>
+<transform dir path=usr/share/lib$ -> default group sys>
+<transform dir path=usr/share/lib/java$ -> default group sys>
+<transform dir path=usr/share/lib/java/javadoc$ -> default group other>
+
+#
+# Most directories and files under /etc/security are group sys
+#
+<transform dir path=etc/security$ -> default group sys>
+<transform dir path=etc/security/exec_attr.d$ -> default group sys>
+<transform file path=etc/security/exec_attr.d/.* -> default group sys>
+<transform dir path=etc/security/prof_attr.d$ -> default group sys>
+<transform file path=etc/security/prof_attr.d/.* -> default group sys>
+<transform dir path=etc/security/auth_attr.d$ -> default group sys>
+<transform file path=etc/security/auth_attr.d/.* -> default group sys>
+
+#
+# SMF directories and files
+#
+<transform dir path=lib/svc/manifest -> default group sys>
+<transform file path=lib/svc/manifest -> default group sys>
+<transform file path=lib/svc/method/.* -> default mode 0555>
+
+#
+# Many directories and files under /usr/share are group other
+#
+<transform dir path=usr/share/locale(/.+){0,2}$ -> default group other>
+<transform file path=usr/share/locale(/.+){3}$ -> default group other>
+<transform dir path=usr/share/applications$ -> default group other>
+<transform file path=usr/share/applications/.* -> default group other>
+<transform dir path=usr/share/pixmaps$ -> default group other>
+<transform file path=usr/share/pixmaps/.* -> default group other>
+
+<transform dir path=usr/gnu/share$ -> default group sys>
+
+<transform dir path=var/db$ -> default group sys>
+<transform dir path=var/lib$ -> default group other>
+<transform dir path=var/log$ -> default group sys>
+
+# usr/share/icons, and all its subdirectories at any level are group other
+<transform dir path=usr/share/icons(/.*){0,1}$ -> default group other>
+
+#
+# programs & shared objects should generally have mode 0555
+#
+<transform file path=.*lib/.*\.so.* -> default mode 0555>
+<transform file path=.*bin/.* -> default mode 0555>
+<transform file path=.*lib/inet/.* -> default mode 0555>
+
+#
+# For what's left, go with root:bin 0444 for files, 0755 for directories
+#
+<transform dir file -> default owner root>
+<transform dir file -> default group bin>
+<transform file -> default mode 0444>
+<transform dir -> default mode 0755>
+
+set name=variant.arch value=$(MACH)
+
+#
+# Defaults for legacy metadata for SVR4 package information
+#
+<transform legacy -> default vendor "Oracle Corporation">
+<transform legacy -> default hotline \
+ "Please contact your local service provider">
+<transform legacy -> default arch $(MACH)>
+<transform legacy -> default category "system">
+# This is set to the final version number delivered as SVR4 format
+<transform legacy -> default version "11.11.0,REV=2010.05.25.01.00">
+
diff --git a/trans/devel b/trans/devel
new file mode 100644
index 0000000..6dd351b
--- /dev/null
+++ b/trans/devel
@@ -0,0 +1,50 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# header files
+<transform dir file link hardlink path=usr.*/include(/.+){0,1} -> \
+ default facet.devel true>
+
+# archive libraries (on rare occasion, we should be delivering these)
+<transform file path=.*lib/.+\.a$ -> default facet.devel true>
+
+# .so links, we need to determine if this is a problem, I suspect that it is.
+#<transform link path=.*lib/.*\.so$ -> default facet.devel true>
+
+# lint libraries
+<transform file link hardlink path=.*/lib/llib-.* -> default facet.devel true>
+
+# pkg-config data
+<transform dir file link hardlink path=.*/pkgconfig(/.+\.pc){0,1}$ -> \
+ default facet.devel true>
+
+# autoconf macros
+<transform dir file link hardlink path=.*/aclocal(/.*\.m4){0,1}$ -> \
+ default facet.devel true>
+
+# Developer documentation
+<transform dir file link hardlink path=.*/man/man3.* -> \
+ default facet.devel true>
diff --git a/trans/docs b/trans/docs
new file mode 100644
index 0000000..a283ec1
--- /dev/null
+++ b/trans/docs
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+# man pages
+<transform dir file link hardlink path=usr.*/man(/.+){0,1}$ -> \
+ default facet.doc.man true>
+
+# texinfo docs
+<transform dir file link hardlink path=usr/.*/info(/.+){0,1}$ -> \
+ default facet.doc.info true>
+<transform file path=usr/.*/info/.+$ -> \
+ add restart_fmri svc:/application/texinfo-update:default>
+<transform file path=usr/.*/info/dir$ -> exit 1 "Error: packaged texinfo directory file (%<action.path>)" >
+
+# html docs
+<transform dir file link hardlink path=usr/.*/doc/.*(html?|css).* -> \
+ default facet.doc.html true>
+<transform dir file link hardlink path=usr/lib/help/.*\.html$ -> \
+ default facet.doc.html true>
+
+# pdf docs
+<transform dir file link hardlink path=usr/.*/doc/.*\.pdf$ -> \
+ default facet.doc.html true>
+
+# general documetation
+<transform dir file link hardlink path=usr/.*/doc(/.+){0,1}$ -> \
+ default facet.doc true>
diff --git a/trans/libtool-drop b/trans/libtool-drop
new file mode 100644
index 0000000..9a6aecf
--- /dev/null
+++ b/trans/libtool-drop
@@ -0,0 +1,2 @@
+# stuff we drop from the proto area - not shipped
+<transform file path=.+/lib/.+\.la -> drop>
diff --git a/trans/locale b/trans/locale
new file mode 100644
index 0000000..ef59d77
--- /dev/null
+++ b/trans/locale
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+# general locale
+<transform dir link hardlink path=.*/locale$ -> default facet.locale true>
+
+<transform dir file link hardlink \
+ path=.*/locale/([^/]+)(\..+){0,1}(/.+){0,1}$ -> \
+ default facet.locale.%<\1> true>