Index: trunk/tools/ts-specs/TSisaexec.spec |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +%include Solaris.inc |
| 3 | + |
| 4 | +Name: TSisaexec |
| 5 | +Summary: TS version of isaexec |
| 6 | +Version: 2618 |
| 7 | +Source1: isaexec.c |
| 8 | + |
| 9 | +SUNW_BaseDir: %{_basedir} |
| 10 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 11 | +%include default-depend.inc |
| 12 | + |
| 13 | +# Requires: |
| 14 | + |
| 15 | +%prep |
| 16 | +%setup -q -T -c -n %name-%version |
| 17 | + |
| 18 | +%build |
| 19 | +cc %optflags %_ldflags %SOURCE1 -o isaexec |
| 20 | + |
| 21 | +%install |
| 22 | +rm -rf $RPM_BUILD_ROOT |
| 23 | +mkdir -p $RPM_BUILD_ROOT%{_libdir} |
| 24 | +cp isaexec $RPM_BUILD_ROOT%{_libdir} |
| 25 | + |
| 26 | +%clean |
| 27 | +rm -rf $RPM_BUILD_ROOT |
| 28 | + |
| 29 | +%files |
| 30 | +%defattr (-, root, bin) |
| 31 | +%dir %attr (0755, root, bin) %{_libdir} |
| 32 | +%attr (0755, root, bin) %{_libdir}/isaexec |
| 33 | + |
| 34 | +%changelog |
| 35 | +* Thu Jan 29 2009 - river@wikimedia.org |
| 36 | +- initial spec |
Index: trunk/tools/ts-specs/base-specs/pbzip2.spec |
— | — | @@ -0,0 +1,32 @@ |
| 2 | +# |
| 3 | +# Copyright (c) 2006 Sun Microsystems, Inc. |
| 4 | +# This file and all modifications and additions to the pristine |
| 5 | +# package are under the same license as the package itself. |
| 6 | + |
| 7 | +%include Solaris.inc |
| 8 | + |
| 9 | +Name: TSpbzip2 |
| 10 | +Summary: parallel bzip2 |
| 11 | +Version: 1.0.5 |
| 12 | +Source: http://compression.ca/pbzip2/pbzip2-%{version}.tar.gz |
| 13 | + |
| 14 | +SUNW_BaseDir: %{_basedir} |
| 15 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 16 | +%include default-depend.inc |
| 17 | + |
| 18 | +%prep |
| 19 | +%setup -q -n pbzip2-%version |
| 20 | + |
| 21 | +# The makefile for pbzip2 requires so much patching, we don't even |
| 22 | +# bother with it. Build and install by hand. |
| 23 | +%build |
| 24 | +$CXX $CXXFLAGS $LDFLAGS -mt pbzip2.cpp -o pbzip2 -lbz2 |
| 25 | + |
| 26 | +%install |
| 27 | +mkdir -p $RPM_BUILD_ROOT$BINDIR |
| 28 | +cp pbzip2 $RPM_BUILD_ROOT$BINDIR |
| 29 | +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 |
| 30 | +cp pbzip2.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
| 31 | + |
| 32 | +%clean |
| 33 | +rm -rf $RPM_BUILD_ROOT |
Index: trunk/tools/ts-specs/TSpbzip2.spec |
— | — | @@ -0,0 +1,92 @@ |
| 2 | +# |
| 3 | +# Copyright (c) 2006 Sun Microsystems, Inc. |
| 4 | +# This file and all modifications and additions to the pristine |
| 5 | +# package are under the same license as the package itself. |
| 6 | + |
| 7 | +%include Solaris.inc |
| 8 | + |
| 9 | +%ifarch amd64 sparcv9 |
| 10 | +%include arch64.inc |
| 11 | +%use pbzip264=pbzip2.spec |
| 12 | +%endif |
| 13 | +%include base.inc |
| 14 | +%use pbzip2=pbzip2.spec |
| 15 | + |
| 16 | +Name: TSpbzip2 |
| 17 | +Summary: parallel bzip2 |
| 18 | +Version: %{pbzip2.version} |
| 19 | + |
| 20 | +SUNW_BaseDir: %{_basedir} |
| 21 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 22 | +%include default-depend.inc |
| 23 | + |
| 24 | +Requires: TSisaexec |
| 25 | +BuildRequires: TSisaexec |
| 26 | + |
| 27 | +%prep |
| 28 | +rm -rf %name-%version |
| 29 | +mkdir %name-%version |
| 30 | + |
| 31 | +%ifarch amd64 sparcv9 |
| 32 | +mkdir %name-%version/%_arch64 |
| 33 | +%pbzip264.prep -d %name-%version/%_arch64 |
| 34 | +%endif |
| 35 | + |
| 36 | +mkdir %name-%version/%{base_arch} |
| 37 | +%pbzip2.prep -d %name-%version/%{base_arch} |
| 38 | + |
| 39 | +%build |
| 40 | +export CXX=CC |
| 41 | + |
| 42 | +%ifarch amd64 sparcv9 |
| 43 | +%include arch64.inc |
| 44 | +export CXXFLAGS="%cxx_optflags -m64" |
| 45 | +%pbzip264.build -d %name-%version/%_arch64 |
| 46 | +%endif |
| 47 | +%include base.inc |
| 48 | +export LDFLAGS="" |
| 49 | +export CXXFLAGS="%cxx_optflags" |
| 50 | +%pbzip2.build -d %name-%version/%{base_arch} |
| 51 | + |
| 52 | +%install |
| 53 | +rm -rf $RPM_BUILD_ROOT |
| 54 | + |
| 55 | +%ifarch amd64 sparcv9 |
| 56 | +%include arch64.inc |
| 57 | +export BINDIR=%{_bindir} |
| 58 | +%pbzip264.install -d %name-%version/%_arch64 |
| 59 | +%endif |
| 60 | +%include base.inc |
| 61 | +export BINDIR=%{_bindir} |
| 62 | + |
| 63 | +%pbzip2.install -d %name-%version/%{base_arch} |
| 64 | +mkdir -p $RPM_BUILD_ROOT%{_bindir}/%{base_isa} |
| 65 | +mv $RPM_BUILD_ROOT%{_bindir}/pbzip2 $RPM_BUILD_ROOT%{_bindir}/%{base_isa} |
| 66 | + |
| 67 | +ln -s ../lib/isaexec $RPM_BUILD_ROOT%{_bindir}/pbzip2 |
| 68 | +ln -s pbzip2 $RPM_BUILD_ROOT%{_bindir}/pbunzip2 |
| 69 | +ln -s pbzip2 $RPM_BUILD_ROOT%{_bindir}/pbzcat |
| 70 | + |
| 71 | +%clean |
| 72 | +rm -rf $RPM_BUILD_ROOT |
| 73 | + |
| 74 | +%files |
| 75 | +%defattr (-, root, bin) |
| 76 | +%dir %attr (0755, root, bin) %{_bindir} |
| 77 | +%hard %{_bindir}/pbzip2 |
| 78 | +%{_bindir}/pbunzip2 |
| 79 | +%{_bindir}/pbzcat |
| 80 | +%dir %attr (0755, root, bin) %{_bindir}/%{base_isa} |
| 81 | +%{_bindir}/%{base_isa}/* |
| 82 | +%ifarch amd64 sparcv9 |
| 83 | +%dir %attr (0755, root, bin) %{_bindir}/%_arch64 |
| 84 | +%{_bindir}/%_arch64/* |
| 85 | +%endif |
| 86 | +%dir %attr (0755, root, sys) %{_datadir} |
| 87 | +%dir %attr (0755, root, bin) %{_mandir} |
| 88 | +%dir %attr (0755, root, bin) %{_mandir}/man1 |
| 89 | +%{_mandir}/man1/*.1 |
| 90 | + |
| 91 | +%changelog |
| 92 | +* Thu Jan 29 2009 - river@loreley.flyingparchment.org.uk |
| 93 | +- Initial spec |
Index: trunk/tools/ts-specs/ext-sources/isaexec.c |
— | — | @@ -0,0 +1,79 @@ |
| 2 | +/* |
| 3 | + * CDDL HEADER START |
| 4 | + * |
| 5 | + * The contents of this file are subject to the terms of the |
| 6 | + * Common Development and Distribution License (the "License"). |
| 7 | + * You may not use this file except in compliance with the License. |
| 8 | + * |
| 9 | + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
| 10 | + * or http://www.opensolaris.org/os/licensing. |
| 11 | + * See the License for the specific language governing permissions |
| 12 | + * and limitations under the License. |
| 13 | + * |
| 14 | + * When distributing Covered Code, include this CDDL HEADER in each |
| 15 | + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
| 16 | + * If applicable, add the following below this CDDL HEADER, with the |
| 17 | + * fields enclosed by brackets "[]" replaced with your own identifying |
| 18 | + * information: Portions Copyright [yyyy] [name of copyright owner] |
| 19 | + * |
| 20 | + * CDDL HEADER END |
| 21 | + */ |
| 22 | +/* |
| 23 | + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. |
| 24 | + * Use is subject to license terms. |
| 25 | + */ |
| 26 | + |
| 27 | +#pragma ident "%Z%%M% %I% %E% SMI" |
| 28 | + |
| 29 | +#include <stdio.h> |
| 30 | +#include <stdlib.h> |
| 31 | +#include <string.h> |
| 32 | +#include <errno.h> |
| 33 | +#include <libintl.h> |
| 34 | +#include <unistd.h> |
| 35 | +#include <locale.h> |
| 36 | + |
| 37 | +/*ARGSUSED*/ |
| 38 | +int |
| 39 | +main(int argc, char **argv, char **envp) |
| 40 | +{ |
| 41 | + const char *execname; |
| 42 | + const char *fname; |
| 43 | + |
| 44 | +#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ |
| 45 | +#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */ |
| 46 | +#endif |
| 47 | + (void) setlocale(LC_ALL, ""); |
| 48 | + (void) textdomain(TEXT_DOMAIN); |
| 49 | + |
| 50 | + /* |
| 51 | + * Get the exec name. |
| 52 | + */ |
| 53 | + if ((execname = getexecname()) == NULL) { |
| 54 | + (void) fprintf(stderr, |
| 55 | + gettext("%s: getexecname() failed\n"), |
| 56 | + argv[0]); |
| 57 | + return (1); |
| 58 | + } |
| 59 | + |
| 60 | + /* |
| 61 | + * Get the base name of the executable. |
| 62 | + */ |
| 63 | + fname = strrchr(execname, '/'); |
| 64 | + fname = (fname != NULL) ? (fname+1) : execname; |
| 65 | + |
| 66 | + if (isaexec(execname, argv, envp) == -1) { |
| 67 | + if (errno == ENOENT) { |
| 68 | + (void) fprintf(stderr, |
| 69 | + gettext("%s: cannot find/execute \"%s\"" |
| 70 | + " in ISA subdirectories\n"), |
| 71 | + argv[0], fname); |
| 72 | + return (1); |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + (void) fprintf(stderr, |
| 77 | + gettext("%s: isaexec(\"%s\") failed\n"), |
| 78 | + argv[0], fname); |
| 79 | + return (1); |
| 80 | +} |