first experiemental commits
authorBart Smaalders <Bart.Smaalders@Sun.COM>
Thu, 15 Apr 2010 16:06:10 -0700
changeset 0 a62e9e23639a
child 1 d63a2608b656
first experiemental commits
components/Makefile.component
components/gnu-file/Makefile
components/gnu-file/file.cleanup
components/gnu-file/file.mf
components/gnu-file/file.raw.drops
transforms/actuators
transforms/remove_dependency_versions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/Makefile.component	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,80 @@
+#
+# 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.
+#
+
+# generic component build support... included
+# from individual component Makefiles.
+
+ARCH:sh = uname -p
+POUND_SIGN:sh = echo \\043
+
+RELEASE=5.11
+PKGVERS_COMPONENT= $(VERSION)
+PKGVERS_BUILTON= $(RELEASE)
+PKGVERS_BRANCH= 0.1
+PKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
+
+C_COMPILER=developer/sunstudio12u1
+
+REPO:sh = echo $REPO
+
+i386_DEFINES=           \
+        ARCH=i386       \
+        ARCH32=i86      \
+        ARCH64=amd64    \
+        i386_ONLY=''    \
+        sparc_ONLY=$(POUND_SIGN)
+
+sparc_DEFINES=          \
+        ARCH=sparc      \
+        ARCH32=sparcv7  \
+        ARCH64=sparcv9  \
+        i386_ONLY=$(POUND_SIGN) \
+        sparc_ONLY=''
+
+ARCH_DEFINES=$($(ARCH)_DEFINES)
+
+PKGMOGRIFY_MACROS=\
+	$(ARCH_DEFINES) \
+	PKGVERS=$(PKGVERS)
+
+
+BUILD_FILE_DEPENDENCIES= 
+BUILD_PKG_DEPENDENCIES= 
+
+default: package
+
+proto:
+	mkdir -p proto
+
+echo_dependencies:
+	print "BUILD_FILE_DEPENDENCIES = [$(BUILD_FILE_DEPENDENCIES:%=\"%\",)]"
+	print "BUILD_PKG_DEPENDENCIES = [$(BUILD_PKG_DEPENDENCIES:%=\"%\",)]"
+
+check_dependencies:
+	ls $(BUILD_FILE_DEPENDENCIES) > /dev/null
+	pkg list $(BUILD_PKG_DEPENDENCIES) > /dev/null
+
+provision:
+	pfexec pkg install $(BUILD_PKG_DEPENDENCIES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gnu-file/Makefile	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,88 @@
+#
+# 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.
+#
+# include global definitions
+include ../Makefile.component
+
+PACKAGES=file
+SRC=file-5.04
+VERSION=5.0.4
+SRC_LOC=ftp://ftp.fu-berlin.de/unix/tools/file
+TARBALL=$(SRC).tar.gz
+TARBALL_CHECKSUM=56ddf7135471aa656334ed8fefe1112bcccc2cc3
+PATH=/usr/bin:/usr/gnu/bin
+BUILD_PKG_DEPENDENCIES= make \
+	                wget \
+			gnu-coreutils \
+			$(C_COMPILER) \
+			gnu-grep \
+			developer/object-file
+
+build:  unpack
+	$(MAKE) check_dependencies
+	export DESTDIR=`pwd`/proto; cd $(SRC); \
+	    export PATH=$(PATH); \
+	    ./configure --prefix=/usr --exec-prefix=/usr; \
+            make; make check; make install
+	touch build
+
+package: build
+	# generate a manifest of what is in the proto area
+	pkgsend generate proto > tmp.1
+	# drop those things we're not going to ship
+	pkgmogrify tmp.1 file.raw.drops > tmp.2
+	# generate and resolve dependencies
+	pkgdepend generate -m tmp.2 proto > tmp.3
+	pkgdepend resolve -m tmp.3
+	# cleanup dependencies, add headers, expand macros
+	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) \
+            ../../transforms/remove_dependency_versions \
+            ../../transforms/actuators tmp.3.res file.cleanup  > tmp.4
+	# prepare comparison manifest
+	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) \
+            ../../transforms/remove_dependency_versions \
+            ../../transforms/actuators file.mf > file.cmp
+	# prepare publication manifest
+	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) \
+            ../../transforms/remove_dependency_versions \
+            ../../transforms/actuators file.mf > file.publish
+	# check for differences
+	pkgdiff file.cmp tmp.4	
+	# publish
+	pkgsend -s $(REPO) publish --fmri-in-manifest -d proto file.publish
+
+$(TARBALL):
+	wget $(SRC_LOC)/$(SRC).tar.gz
+	printf "%s  %s\n" $(TARBALL_CHECKSUM) $(TARBALL) | sha1sum -c 
+
+unpack: $(TARBALL)
+	gunzip < $(SRC).tar.gz | tar xf -
+	touch unpack
+
+clean:	
+	rm -fr $(SRC) build file.new tmp.* file.publish file.cmp proto unpack
+
+clobber: clean
+	rm $(TARBALL)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gnu-file/file.cleanup	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,17 @@
+# remove timestamps on dependencies (bug in pkgdepend)
+<transform depend -> edit fmri :2[0-9]{7}T[0-9]{6}Z "">
+# remove debugging info
+<transform depend -> delete pkg.debug.depend.reason .*>
+<transform depend -> delete pkg.debug.depend.type .*>
+<transform depend -> delete pkg.debug.depend.file .*>
+# remove timestamps on dirs (bug in pkgsend generate)
+<transform dir file link -> delete timestamp .*>
+# don't want size variations confusing pkgdiff
+<transform file -> delete pkg.size .*>
+# Add package header information
+set name=pkg.fmri value=pkg:/file/file@$(PKGVERS)
+set name=pkg.description \
+    value="contains unix file command"
+set name=variant.arch value=$(ARCH)
+set name=variant.opensolaris.zone value=global value=nonglobal
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gnu-file/file.mf	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,31 @@
+set name=pkg.fmri value=pkg:/file/file@$(PKGVERS)
+set name=pkg.description \
+    value="contains unix file command"
+set name=variant.arch value=$(ARCH)
+set name=variant.opensolaris.zone value=global value=nonglobal
+dir path=usr group=bin mode=0755 owner=root
+dir path=usr/bin group=bin mode=0755 owner=root
+dir path=usr/include group=bin mode=0755 owner=root
+dir path=usr/lib group=bin mode=0755 owner=root
+dir path=usr/share group=bin mode=0755 owner=root
+dir path=usr/share/man group=bin mode=0755 owner=root
+dir path=usr/share/man/man1 group=bin mode=0755 owner=root
+dir path=usr/share/man/man3 group=bin mode=0755 owner=root
+dir path=usr/share/man/man4 group=bin mode=0755 owner=root
+dir path=usr/share/misc group=bin mode=0755 owner=root
+file usr/bin/file path=usr/bin/file group=bin mode=0755 owner=root
+file usr/include/magic.h path=usr/include/magic.h group=bin mode=0644 owner=root
+file usr/lib/libmagic.so.1.0.0 path=usr/lib/libmagic.so.1.0.0 group=bin \
+    mode=0755 owner=root
+file usr/share/man/man1/file.1 path=usr/share/man/man1/file.1 group=bin \
+    mode=0644 owner=root
+file usr/share/man/man3/libmagic.3 path=usr/share/man/man3/libmagic.3 group=bin \
+    mode=0644 owner=root
+file usr/share/man/man4/magic.4 path=usr/share/man/man4/magic.4 group=bin \
+    mode=0644 owner=root
+file usr/share/misc/magic.mgc path=usr/share/misc/magic.mgc group=bin mode=0644 \
+    owner=root
+link path=usr/lib/libmagic.so target=libmagic.so.1.0.0
+link path=usr/lib/libmagic.so.1 target=libmagic.so.1.0.0
+depend fmri=pkg:/library/[email protected],5.11-0.135 type=require
+depend fmri=pkg:/system/[email protected],5.11-0.136 type=require
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gnu-file/file.raw.drops	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,4 @@
+# stuff we drop from the proto area - not shipped
+<transform file path=usr/lib/libmagic.a -> drop>
+<transform file path=usr/lib/libmagic.la -> drop>
+<transform dir path=usr/share/man/man5 -> drop>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/transforms/actuators	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+# auto import manifests when installing live
+<transform file path=(var|etc)/svc/manifest/.*\.xml -> add restart_fmri svc:/system/manifest-import:default>
+# handle rbac fragments
+<transform file path=etc/security/[^/]+_attr.d/.+ -> add restart_fmri svc:/system/rbac:default>
+<transform file path=etc/user_attr.d/.+ -> add restart_fmri svc:/system/rbac:default>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/transforms/remove_dependency_versions	Thu Apr 15 16:06:10 2010 -0700
@@ -0,0 +1,3 @@
+# transform to remove dependency verisions so comparisons work
+# across os revs w/o changes
+<transform depend -> edit fmri "@[^ \t\n\r\f\v]*" "">