FlexSDK RPM

Contents

Compiling from source

SVN branch 3.x/3.3.0

Build instructions

  1. Create a directory for source, build, etc., e.g.

    mkdir ~/flexsdk

  2. Checkout Adobe Flex SDK source from svn, e.g.

    cd ~/flexsdk
    svn checkout http://opensource.adobe.com/svn/opensource/flex/sdk/branches/3.x

  3. It can be useful at this point to copy the (large!) svn checkout in case you want to rollback to a pristine checkout without messing about with svn commands, i.e.

    tar cvfz 3.x.pristine.tar.gz 3.x

  4. Make sure you have required openjdk and ant packages on your system:

    sudo yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel ant ant-nodeps

  5. The adobe build documentation suggests you should have three environment variables properly set: JAVA_HOME, ANT_HOME, and PATH. On a stock f10 install with the packages installed and the svn checkout as done in the previous steps, only JAVA_HOME and PATH need to be defined and can be set thus:

    export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64
    export PATH=$JAVA_HOME/bin:~/flexsdk/3.x/bin:$PATH

    although you should double check that this is a reasonable definition for JAVA_HOME by checking the output of 'ls -l /etc/alternatives/java'

  6. At this point, you should be able to build everything from adobe (including stuff that is currently license-encumbered, FIXME) by doing

    cd ~/flexsdk/3.x
    ant

No proper upstream source tarball!

Forked JARs

Notes for proper RPMization of Flex SDK

To define, proper RPM passes Fedora Review http://fedoraproject.org/wiki/Packaging:ReviewGuidelines and esp. in this case http://fedoraproject.org/wiki/Packaging:Java

It must be buildable from source and not include any pre-built binaries, reuse JARs available as Fedora RPMs and not include own, patched, copies of JARs.

Quick intro to SDK structure: http://opensource.adobe.com/wiki/display/flexsdk/SDK+Organization

TODO lookup relevant adobe jiras, should be fixed in >= 3.2 ZIPs

TODO verify latest 3.3 ZIP and svn branch

RPM from flex_sdk*mpl.zip (repackaged prebuilt binaries)

Name:		flexsdk
Version:	3.1.0.2710
Release:	1%{?dist}
Summary:	Framework for building expressive web applications
Group:		Development/Languages
License:	MPLv1.1+ASL
URL:		http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
Source0:	http://flexorg.wip3.adobe.com/flexsdk/%{version}/flex_sdk_%{version}_mpl.zip
BuildArch:      noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	java-devel >= 1.6.0
Requires:	java >= 1.6.0
Requires:       xerces-j2
# XXX needs patched versions, not upstream!
#Requires:       velocity >= 1.4
#Requires:       batik
Requires:       jakarta-commons-collections
Requires:       jakarta-commons-discovery
Requires:       jakarta-commons-logging

%define mxmlc_min_jars asc.jar flex-messaging-common.jar mxmlc.jar swfutils.jar
%define app_root %{_datadir}/%{name}
# disable debuginfo
%define debug_package %{nil}

%description
Flex is a highly productive, open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops and operating systems.

%prep
%setup -cT
jar xf %{SOURCE0}

%build
# using prebuilt flex_sdk ZIP
# XXX this is non-kosher, can't build from source until licensing conflict
# is resolved: http://bugs.adobe.com/jira/browse/SDK-16493

# http://fedoraproject.org/wiki/Packaging/Java#Wrapper_Scripts
cat > mxmlc <<\EOF
#!/bin/bash
. /usr/share/java-utils/java-functions
# Fedora provided: velocity batik-all xml-commons-apis-ext
set_classpath mxmlc swfutils asc flex-messaging-common commons-collections commons-discovery commons-logging xalan-j2 xerces-j2 flex-batik flex-velocity
set_flags -Xmx384m -Dsun.io.useCanonCaches=false
FLEX_HOME=/usr/share/flexsdk
MAIN_CLASS=flex2.tools.Compiler
run +flexlib="$FLEX_HOME/frameworks" "$@"
EOF

# http://fedoraproject.org/wiki/Packaging/Java#class-path-in-manifest
# sed 1-liner from above doesn't work b/c mxmlc.jar has multi-line Class-Path value
# XXX can't remove the field from the manifest using jar umf
# so just set to empty value for now. rpmlint will still complain b/c of lame check,
# but class-path-in-manifest is effectively disabled.
cd lib
echo "Class-Path: " > remove-class-path-in-manifest
for j in %{mxmlc_min_jars}; do
  jar umf remove-class-path-in-manifest $j 2> /dev/null
done
mkdir repack
cd repack
for j in ../batik*jar; do
  jar xf $j
done
jar cvf ../flex-batik.jar *

%install
rm -rf %{buildroot}
install -d -m0755 %{buildroot}%{_bindir}
install -d -m0755 %{buildroot}%{_javadir}
install -d -m0755 %{buildroot}%{app_root}/frameworks/libs/player/9
install -d -m0755 %{buildroot}%{app_root}/frameworks/locale/en_US
install -d -m0755 %{buildroot}%{app_root}/frameworks/rsls

install -m0755 -t %{buildroot}%{_bindir} mxmlc

cd lib
install -p -m0644 -t %{buildroot}%{_javadir} %{mxmlc_min_jars}
# XXX install patched batik and velocity
install -p -m0644 -t %{buildroot}%{_javadir} flex-batik.jar
install -p -m0644 mm-velocity-1.4.jar  %{buildroot}%{_javadir}/flex-velocity.jar

cd ../frameworks
install -p -m0644 -t %{buildroot}/%{app_root}/frameworks \
  flex-config.xml flash-unicode-table.xml mxml-manifest.xml localFonts.ser

cd libs
install -p -m0644 -t %{buildroot}%{app_root}/frameworks/libs \
  flex.swc  framework.swc  rpc.swc  utilities.swc
install -p -m0644 -t %{buildroot}%{app_root}/frameworks/libs/player/9 \
  player/9/playerglobal.swc

cd ../rsls
install -p -m0644 -t %{buildroot}%{app_root}/frameworks/rsls \
  framework_3.1.0.2710.swf  rpc_3.1.0.2710.swf

cd ../locale/en_US
install -p -m0644 -t %{buildroot}%{app_root}/frameworks/locale/en_US \
  framework_rb.swc  rpc_rb.swc

%clean
rm -rf ${buildroot}

%files
%defattr(-,root,root,-)
%doc license-mpl.htm
%{_bindir}/mxmlc
%{_javadir}
%{app_root}

%changelog
* Fri Oct 10 2008 Alan Pevec <apevec@redhat.com> 3.1.0.2710-1
- Initial nosrc packaging.
MediaWiki