Commits

Anonymous committed fd03fe8

added lcms spec file example. started validation prototype script

Comments (0)

Files changed (4)

components/gnu-file/Makefile

 BUILD_PKG_DEPENDENCIES= make \
 	                wget \
 			gnu-coreutils \
-			$(C_COMPILER) \
 			gnu-grep \
-			developer/object-file
 
 build:  unpack
 	$(MAKE) check_dependencies

components/lcms/Makefile

 PATH=/usr/bin:/usr/gnu/bin
 
 COMPONENT_NAME=		lcms
-COMPONENT_VERSION=	1.19
+COMPONENT_VERSION=	2-2.0
 COMPONENT_DESCRIPTION=	"Little Color Management System"
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_SRC=		$(COMPONENT_NAME)$(COMPONENT_VERSION)
 COMPONENT_COPYRIGHT=	$(COMPONENT_SRC)/COPYING
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
-COMPONENT_ARCHIVE_HASH=	d5b075ccffc0068015f74f78e4bc39138bcfe2d4
-COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/lcms/$(COMPONENT_NAME)/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)?use_mirror=voxel
+#COMPONENT_ARCHIVE_HASH=	4f192cfd36d8b819e6885571401f949220609005
+COMPONENT_ARCHIVE_URL=	http://download.sourceforge.net/project/lcms/lcms/2.0/$(COMPONENT_ARCHIVE)
+#COMPONENT_ARCHIVE_HASH=	d5b075ccffc0068015f74f78e4bc39138bcfe2d4
+#COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/lcms/$(COMPONENT_NAME)/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)?use_mirror=voxel
 
 include ../../make-rules/prep.mk
 include ../../make-rules/configure.mk

spec-files/lcms.spec

+#
+# spec file for package lcms
+#
+%include Solaris.inc
+%define	src_name lcms
+%define src_url http://download.sourceforge.net/project/lcms/lcms/
+
+# The system doesn't support package names such as:
+# text/less
+
+Name:                lcms
+Summary:             An open source color management engine
+License:             GPL
+Group:               Utilities
+Distribution:        OpenSolaris
+Version:             2-2.0a
+Source:              %{src_url}/2.0/%{src_name}%{version}.tar.gz
+SUNW_BaseDir:        %{_basedir}
+SUNW_Copyright:      %{name}.copyright
+BuildRoot:           %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+
+# OpenSolaris IPS Manifest Fields
+Meta(info.upstream):            Marti Maria
+Meta(info.maintainer):          Marti Maria
+Meta(info.repository_url):      http://www.littlecms.com/
+Meta(pkg.summary):              open source color management engine
+
+%description
+Little CMS intends to be a small-footprint color management engine, 
+with special focus on accuracy and performance.
+
+# Examples only:
+Requires:            SUNWglib2
+BuildRequires:       SUNWglib2-devel
+
+%prep
+%setup -q -n %{src_name}-2.0
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+  CPUS=1
+fi
+./configure --prefix=%{_prefix} \
+            --libdir=%{_libdir} \
+            --bindir=%{_bindir} \
+            --datadir=%{_datadir}
+make -j $CPUS
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+#rm -rf $RPM_BUILD_ROOT
+
+%files
+%{_bindir}/*
+%{_libdir}/*
+%{_datadir}/*
+%{_includedir}/*
+
+%changelog
+Wed 19 May 2010 erwann.chenede@sun.com
+- Initial spec

spec-files/validation/validation.pl

+#!/bin/perl
+
+sub traverse {
+    my ($dir, @callbacks) = @_;
+    my $present;
+    
+    opendir $present, $dir or return();
+
+    for (grep { ! /^(\.|\.\.)$/ } readdir $present) {
+        my $path = "$dir/$_";
+
+	foreach $validation (@callbacks) 
+	{
+	  &$validation($path);
+	}
+        traverse($path, @callbacks) if -d $path;
+    }
+
+    closedir $present;
+    return();
+}
+
+sub checkManpage {
+  my $file = shift;
+  if (-T $file) {
+    if ($file =~ /\/man\//) {
+      my $attribute_section = 0;
+      open (FILE, $file);
+      while (<FILE>) {
+	if (/\.so /) { return; }#reference only manpage 
+	if (/.SH.*ATTRIBUTES/) {
+	  $attribute_section = 1;
+	}
+      }
+      close (FILE);
+      if ($attribute_section == 0) {
+	print "MAN CHECK : Error in $file\n\tNo attribute section missing\n";
+      }
+    }
+  }
+  return;
+}
+
+
+sub checkExecutableNotWritable {
+  my $file = shift;
+  if (not -d $file and -x $file and -w $file)
+  {
+    print "ATTRIBUTE CHECK : Error in $file\n\texecutable file should not be writable\n";
+  }
+  return;
+}
+
+@validationFcts = (\&checkManpage, \&checkExecutableNoWritable);
+
+
+traverse($ARGV[0], @validationFcts);
+