rpms/brazil/devel brazil-build.xml, NONE, 1.1 brazil-remove-proprietary-sun-api.patch, NONE, 1.1 brazil.spec, NONE, 1.1 get-brazil.sh, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Mat Booth (mbooth) fedora-extras-commits at redhat.com
Wed Apr 30 17:55:03 UTC 2008


Author: mbooth

Update of /cvs/pkgs/rpms/brazil/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29255/devel

Modified Files:
	.cvsignore sources 
Added Files:
	brazil-build.xml brazil-remove-proprietary-sun-api.patch 
	brazil.spec get-brazil.sh 
Log Message:
Initial checkin of package.




--- NEW FILE brazil-build.xml ---
<project default="all" basedir=".">

  <target name="init">
    <!-- package info -->
    <property name="name" value="Brazil"/>
    <property name="version" value="2.3"/>

    <!-- dirs -->
    <property name="build" value="./build"/>
    <property name="build.src" value="${build}/src"/>
    <property name="build.dest" value="${build}/classes"/>
    <property name="build.javadoc" value="${build}/javadoc"/>

    <!-- compiler options -->
    <property name="target" value="1.1"/>
    <property name="source" value="1.2"/>
  </target>

  <target name="prepare" depends="init">
    <!-- create dirs -->
    <mkdir dir="${build}"/>
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.dest}"/>
    <mkdir dir="${build.javadoc}"/>

    <!-- copy source -->
    <copy todir="${build.src}">
      <fileset dir="./srcs">
        <include name="com/sun/server/*.java"/>
        <include name="sunlabs/brazil/asterisk/*.java"/>
        <include name="sunlabs/brazil/filter/*.java"/>
        <include name="sunlabs/brazil/handler/*.java"/>
        <include name="sunlabs/brazil/properties/*.java"/>
        <include name="sunlabs/brazil/proxy/*.java"/>
        <include name="sunlabs/brazil/server/*.java"/>
        <include name="sunlabs/brazil/session/*.java"/>
        <include name="sunlabs/brazil/sunlabs/*.java"/>
        <include name="sunlabs/brazil/template/*.java"/>
        <include name="sunlabs/brazil/util/*.java"/>
        <include name="sunlabs/brazil/util/http/*.java"/>
        <include name="sunlabs/brazil/util/regexp/*.java"/>
      </fileset>
    </copy>
  </target>

  <target name="compile" depends="prepare">
    <!-- build classes -->
    <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="true"
           optimize="true"
           deprecation="true"
           target="${target}"
           source="${source}">
    </javac>
  </target>

  <target name="brazil" depends="compile">
    <!-- build jar file -->
    <jar destfile="${build}/brazil.jar" index="yes">
      <manifest>
        <attribute name="Main-Class" value="sunlabs.brazil.server.Main"/>
      </manifest>
      <fileset dir="${build.dest}" includes="**/*.class"/>
    </jar>
  </target>

  <target name="brazil-javadoc" depends="prepare">
    <!-- build javadocs -->
    <javadoc sourcepath="${build.src}"
             destdir="${build.javadoc}"
             packagenames="*"
             author="true"
             version="true"
             use="true"
             splitindex="true"
             noindex="false"
             windowtitle="${name} ${version}"
             doctitle="${name} ${version} JavaDoc">
      <link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
    </javadoc>
  </target>

  <target name="all" depends="brazil,brazil-javadoc"/>

  <target name="clean" depends="init">
    <!-- remove build files -->
    <delete dir="${build}"/>
  </target>

</project>


brazil-remove-proprietary-sun-api.patch:

--- NEW FILE brazil-remove-proprietary-sun-api.patch ---
--- srcs/sunlabs/brazil/sunlabs/RestartHandler.java	2007-12-24 13:44:40.000000000 +0000
+++ srcs/sunlabs/brazil/sunlabs/RestartHandler.java	2007-12-24 13:45:40.000000000 +0000
@@ -49,8 +49,8 @@
 import sunlabs.brazil.server.Request;
 import sunlabs.brazil.server.Server;
 
-import sun.misc.Signal;
-import sun.misc.SignalHandler;
+//import sun.misc.Signal;
+//import sun.misc.SignalHandler;
 
 /**
  * Restart the server when a sigHUP is received.
@@ -81,7 +81,8 @@
  * </dl>
  */
 
-public class RestartHandler implements Handler, SignalHandler {
+//public class RestartHandler implements Handler, SignalHandler {
+public class RestartHandler implements Handler {
     Server server;		// reference to our server
     String prefix;		// our name in the config file
     boolean shouldKeep;		// keep existing config
@@ -99,7 +100,7 @@
 	    configFile = new File(file);
 	}
 	lastModified = 0;	// in case we've been started differently
-	Signal.handle(new Signal("HUP"), this);
+//	Signal.handle(new Signal("HUP"), this);
 	return true;
     }
 
@@ -111,7 +112,7 @@
     /**
      * Restart the server after re-reading the config file
      */
-
+/*
     public void
     handle(Signal sig) {
 	server.log(Server.LOG_DIAGNOSTIC, prefix,
@@ -148,4 +149,5 @@
 	    }
 	}
     }
+    */
 }


--- NEW FILE brazil.spec ---
%define gcj_support 1

Name:      brazil
Version:   2.3
Release:   3%{?dist}
Summary:   Extremely small footprint Java HTTP stack
Group:     Development/Libraries
License:   SPL
URL:       http://research.sun.com/brazil/

# source tarball and the script used to fetch it from Sun's Download Center
# script usage:
# $ sh get-brazil.sh
Source0:   %{name}-%{version}.tar.gz
Source1:   get-brazil.sh

# upsteam's build script doesn't build javadocs, so use our own, better script
Source2:   brazil-build.xml

# patch for removing sun proprietary signal handling api not in gcj
Patch0:    brazil-remove-proprietary-sun-api.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%if %{gcj_support}
BuildRequires:    gcc-java
BuildRequires:    java-gcj-compat-devel
Requires(post):   java-gcj-compat
Requires(postun): java-gcj-compat
%else
BuildArch:        noarch
%endif
BuildRequires:    java-devel
BuildRequires:    jpackage-utils
BuildRequires:    ant
Requires:         java
Requires:         jpackage-utils

%description
Brazil is as an extremely small footprint HTTP stack and flexible architecture 
for adding URL-based interfaces to arbitrary applications and devices from Sun 
Labs. This package contains the core set of classes that are not dependent on 
any other external Java libraries.

%package javadoc
Summary:   Javadocs for %{name}
Group:     Documentation
Requires:  %{name} = %{version}-%{release}
Requires:  jpackage-utils

%description javadoc
API documentation for %{name}.

%package demo
Summary:   Demos for %{name}
Group:     Development/Libraries
Requires:  %{name} = %{version}-%{release}
Requires:  tcl

%description demo
Demonstrations and samples for %{name}.

%prep
%setup -q -n %{name}-%{version}

# apply patches
%patch0 -p0

# fix permissions and interpreter in sample scripts
grep -lR -e ^\#\!/usr/sfw/bin/tclsh8.3 samples | xargs sed --in-place "s|/usr/sfw/bin/tclsh8.3|/usr/bin/tclsh|"
grep -lR -e ^\#\!/usr/bin/tclsh        samples | xargs chmod 755
grep -lR -e ^\#\!/bin/sh               samples | xargs chmod 755

%build
cp -p %{SOURCE2} build.xml
ant all

%install
rm -rf %{buildroot}

# jars
mkdir -p %{buildroot}%{_javadir}
cp -p build/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/javadoc/* %{buildroot}%{_javadocdir}/%{name}

# samples
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr samples %{buildroot}%{_datadir}/%{name}

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

%clean
rm -rf %{buildroot}

%if %{gcj_support}
%post -p %{_bindir}/rebuild-gcj-db
%postun -p %{_bindir}/rebuild-gcj-db
%endif

%files
%defattr(-,root,root,-)
%doc srcs/license.terms
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%if %{gcj_support}
%{_libdir}/gcj/%{name}
%endif

%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}

%files demo
%defattr(-,root,root,-)
%doc %{_datadir}/%{name}/samples/README
%{_datadir}/%{name}

%changelog
* Fri Apr 18 2008 Mat Booth <fedora at matbooth.co.uk> 2.3-3
- Minor grammatical corrections.

* Sun Apr 13 2008 Mat Booth <fedora at matbooth.co.uk> 2.3-2
- Updated package for new Java guidelines.
- Spec now builds a demo package containing the samples.

* Wed Dec 24 2007 Mat Booth <fedora at matbooth.co.uk> 2.3-1
- Initial release.


--- NEW FILE get-brazil.sh ---
#!/bin/sh
NAME="brazil"
VERSION=2.3

echo "Downloading jar..."
# Upstream lives in the Sun Download Center, which normally requires a login
# and limits the number of times you can download the package, /however/, the
# download link from the project page at http://research.sun.com/brazil/ goes
# to a page that performs some magic that apparently obviates all of these
# restrictions entirely. Considering that this magic is performed by one of
# upstream's own pages, I think it's fair to use that mechanism to download it,
# which is the reason for the following bit of fruity script:
POST_URL=$(wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --keep-session-cookies --save-cookies=cookie \
	http://www.experimentalstuff.com/Technologies/Brazil/download.html -O - | grep jsessionid | cut -d \" -f 4)
POST_SESSION=$(echo $POST_URL | cut -d = -f 3)
wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --load-cookies=cookie --keep-session-cookies --save-cookies=cookie \
	--referer=http://www.experimentalstuff.com/Technologies/Brazil/download.html --post-data "url=$POST_URL&session=$POST_SESSION&licenseOK=accept" \
	http://www.experimentalstuff.com/Technologies/Brazil/download.html -O - >/dev/null
URL=$(wget -q --user-agent="Mozilla/5.0 (U) Firefox/2.0.0.10" --load-cookies=cookie --keep-session-cookies --save-cookies=cookie \
	--referer=http://www.experimentalstuff.com/Technologies/Brazil/download.html --post-data "noTemplate=true&product=$NAME-$VERSION.jar" \
	http://www.experimentalstuff.com/Technologies/download.html -O - | grep location= | cut -d \" -f 2)
wget -q --no-cookies $URL -O $NAME-$VERSION.jar
rm cookie

echo "Unzipping jar..."
mkdir $NAME-$VERSION
unzip -q -d $NAME-$VERSION $NAME-$VERSION.jar 1>/dev/null 2>/dev/null
rm $NAME-$VERSION.jar

# jettison empty files and pre-built binaries and javadocs
rm $NAME-$VERSION/*.changed
rm -rf $NAME-$VERSION/com $NAME-$VERSION/contrib $NAME-$VERSION/sunlabs $NAME-$VERSION/tcl $NAME-$VERSION/tests \
	$NAME-$VERSION/html $NAME-$VERSION/META-INF

# remove source from a different project with a different license
rm $NAME-$VERSION/samples/conman/misc/app_meetme.c

echo "Creating tarball '$NAME-$VERSION.tar.gz'..."
tar -czf $NAME-$VERSION.tar.gz $NAME-$VERSION


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/brazil/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	26 Apr 2008 16:39:35 -0000	1.1
+++ .cvsignore	30 Apr 2008 17:54:25 -0000	1.2
@@ -0,0 +1 @@
+brazil-2.3.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/brazil/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	26 Apr 2008 16:39:35 -0000	1.1
+++ sources	30 Apr 2008 17:54:25 -0000	1.2
@@ -0,0 +1 @@
+002bef01a5dd2cb64e73f5b71aa85cc6  brazil-2.3.tar.gz




More information about the fedora-extras-commits mailing list