Blob Blame Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
#
# See note below about byte compiling
#
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

Name:           pyjamas
Version:        0.7
Release:        21%{?dist}
Summary:        A python to Javascript compiler, Widget set, Framework and Toolkit

Group:          Development/Languages
License:        ASL 2.0 and MIT
URL:            http://pyjs.org/
# When using a SVN snapshot:
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
#  svn export -r 2416 https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk pyjamas-20100414
#  tar -czvf pyjamas-20100414.tar.gz pyjamas-20100414
Source0:	http://downloads.sourceforge.net/project/pyjamas/pyjamas/0.7/pyjamas-0.7.tgz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:	python2-setuptools

%description
Pyjamas is a python to Javascript compiler, Widget set, 
Framework and Toolkit for Application development that 
runs on Web browsers. The developer need not know 
anything about AJAX: all the AJAX tricks, for all major 
browsers, are entirely taken care of.

#package desktop
#ummary:         Desktop version of pyjamas
#roup:           Development/Languages
#equires:        %{name} = %{version}-%{release}
#equires:	 xulrunner
#equires:	 pywebkitgtk
#equires:        hulahop
#icense:         ASL 2.0 and Python and GPLv2+

#description desktop
#he Desktop version of Pyjamas takes the original Python application 
#which, in the browser version, is put through a Javascript Compiler), 
#nd executes it directly, through the standard Python Interpreter, 
#nmodified. The Pyjamas Infrastructure then uses XULRunner as 
#he Browser Engine, to render the application's widgets.

%package ui
Summary:         User interface widgets for pyjamas
Group:           Development/Languages
Requires:        %{name} = %{version}-%{release}
License:         ASL 2.0

%description ui
This package contains the User-Interface Widgets that are 
common to both Pyjamas and Pyjamas-Desktop.

%package examples
Summary:         Example files for pyjamas
Group:           Development/Languages
Requires:        %{name} = %{version}-%{release}
License:         ASL 2.0 and BSD and GPL+ and GPLv2+ and LGPLv2+ and MIT and Python and (MPLv1.1+ or LGPLv2+ or GPLv2+)

%description examples
This package includes the example files that ship with pyjamas. 

%package doc
Summary:         Documentation files for pyjamas
Group:           Development/Languages
Requires:        %{name} = %{version}-%{release}
License:         ASL 2.0

%description doc
This package includes the documentation files that ship with pyjamas.

%prep
%setup -q

%build
python bootstrap.py $RPM_BUILD_ROOT/usr/share/pyshared $RPM_BUILD_ROOT/usr/share/pyjamas .
python run_bootstrap_first_then_setup.py build
python run_bootstrap_first_then_pyjd_setup.py build

%install
rm -rf $RPM_BUILD_ROOT
export QA_SKIP_BUILD_ROOT=1
python run_bootstrap_first_then_pyjd_setup.py install --root=$RPM_BUILD_ROOT
python run_bootstrap_first_then_setup.py install --root=$RPM_BUILD_ROOT

# Install scripts. 
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -p bin/pyjsbuild $RPM_BUILD_ROOT/usr/bin/pyjsbuild
install -p bin/pyjscompile $RPM_BUILD_ROOT/usr/bin/pyjscompile

# Fix installed pyjd to not include the build root in path
sed -i -e "s|$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT/%{python_sitelib}/pyjd/__init__.py
sed -i -e "s|$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT/%{_bindir}/pyjsbuild
sed -i -e "s|$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT/%{_bindir}/pyjscompile

# install doc files
cp -a doc $RPM_BUILD_ROOT/%{_datadir}/pyjamas/doc

# NOTE: we only byte-compile the library files installed in the normal
# fedora python_sitelib. All other .py files are left alone. 
# This is due to those files replacing/overriding core modules. 
# They should never be run from anything but pyjamas itself, nor 
# should they be byte compiled. 

#  byte-compile the library .py files only.
( RPM_BUILD_ROOT=$RPM_BUILD_ROOT/%{python_sitelib}/; export RPM_BUILD_ROOT; /usr/lib/rpm/brp-python-bytecompile %{__python} )

# remove desktop for now since hulahop is gone. 
rm -f $RPM_BUILD_ROOT/%{python_sitelib}/Pyjamas_Desktop-*.egg-info
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pyjd

%files
%doc CHANGELOG COPYING copyright CREDITS INSTALL.txt README TODO
%{python2_sitelib}/pyjs
%{python2_sitelib}/Pyjamas-*.egg-info
%{_datadir}/pyjamas
%{_bindir}/pyjscompile
%{_bindir}/pyjsbuild
%exclude %{_datadir}/pyjamas/examples
%exclude %{_datadir}/pyjamas/doc
%exclude %{_datadir}/pyjamas/library/pyjamas/ui
#exclude %{python_sitelib}/pyjd

#files desktop
#defattr(-,root,root,-)
#{python_sitelib}/Pyjamas_Desktop-*.egg-info
#{python_sitelib}/pyjd

%files ui
%{_datadir}/pyjamas/library/pyjamas/ui

%files examples
%{_datadir}/pyjamas/examples

%files doc
%{_datadir}/pyjamas/doc

%changelog
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.7-19
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-16
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Feb 12 2012 Kevin Fenzi <kevin@scrye.com> 0.7-9
- Drop desktop subpackage. hulahop no longer exists. 

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jul 30 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-7
- Rebuild for python 2.7

* Wed Jun 02 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-6
- Further fix Licensing tags. 

* Fri May 28 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-5
- Adjusting Licensing tags. 

* Fri May 28 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-4
- Fix python-bytecode-inconsistent-mtime error
- Adjusted Licensing tags.

* Thu May 27 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-3
- Reworked note about byte compiling
- Fixed spelling mistake
- Changed sitelib to not be a full wildcard. 

* Fri Apr 30 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-2
- Install pyjsbuild and pyjscompile scripts

* Mon Apr 26 2010 Kevin Fenzi <kevin@tummy.com> - 0.7-1
- Initial version