Blob Blame History Raw
%if %($(pkg-config emacs) ; echo $?)
%define emacs_version 22.1
%define emacs_lispdir %{_datadir}/emacs/site-lisp
%define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d
%else
%define emacs_version %(pkg-config emacs --modversion)
%define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
%define emacs_startdir %(pkg-config emacs --variable sitestartdir)
%endif

Name:           vala
Version:        0.5.2
Release:        4%{?dist}
Summary:        A modern programming language for GNOME

Group:          Development/Languages
# Most files are LGPLv2.1+, curses.vapi is 2-clause BSD
License:        LGPLv2+ and BSD
URL:            http://live.gnome.org/Vala
Source0:        http://download.gnome.org/sources/vala/0.5/vala-%{version}.tar.bz2
%if 0%{?rhel}
Source1:	vala-mode.rhel.el
%else
Source1:	vala-mode.el
%endif
Source2:	vala-init.el
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  gtk2-devel flex bison devhelp gecko-libs >= 1.9
BuildRequires:	emacs emacs-el
Requires:       gtk2-devel

%description
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

valac, the Vala compiler, is a self-hosting compiler that translates
Vala source code into C source and header files. It uses the GObject
type system to create classes and interfaces declared in the Vala source
code. It's also planned to generate GIDL files when gobject-
introspection is ready.

The syntax of Vala is similar to C#, modified to better fit the GObject
type system.


%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description    devel
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

This package contains development files for %{name}. This is not necessary for
using the %{name} compiler.


%package        tools
Summary:        Tools for creating projects and bindings for %{name}
Group:          Development/Languages
License:        LGPLv2+
Requires:       %{name} = %{version}-%{release}
Requires:       gnome-common intltool libtool
Provides:       %{name}-vapigen = %{version}-%{release}
Obsoletes:      %{name}-vapigen < %{version}-%{release}

%description    tools
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

This package contains tools to generate Vala projects, as well as API bindings
from existing C libraries, allowing access from Vala programs.


%package        doc
Summary:        Documentation for %{name}
Group:          Documentation
License:        LGPLv2+
Requires:       %{name} = %{version}-%{release}
Requires:       devhelp
Provides:       %{name}-docs = %{version}-%{release}
Obsoletes:      %{name}-docs < %{version}-%{release}


%description    doc
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

This package contains documentation in a devhelp HTML book.


%package -n emacs-vala        
Summary:        Vala mode for Emacs
Group:          Applications/Editors
License:        GPLv2+
%if 0%{?rhel}
Requires:       emacs >= 21.4
%else
Requires:	emacs(bin) >= %{emacs_version}
%endif


%description -n emacs-vala
An Emacs mode for editing Vala source code.


%prep
%setup -q


%build
%configure --enable-vapigen --enable-gen-project
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
# Compile emacs module
mkdir emacs-vala && cd emacs-vala && cp -p %{SOURCE1} vala-mode.el
emacs -batch -f batch-byte-compile vala-mode.el


# checks currently utilize installed Vala, not the one being compiled
#%check
#make check


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/libvala.la

# Emacs mode files
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}
mkdir -p $RPM_BUILD_ROOT%{emacs_startdir}
cp -p emacs-vala/*.el* $RPM_BUILD_ROOT%{emacs_lispdir}
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}


%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL MAINTAINERS NEWS README THANKS
%{_bindir}/valac
%{_datadir}/vala
%{_libdir}/libvala.so.*
%{_mandir}/*/valac*

%files devel
%defattr(-,root,root,-)
%{_includedir}/vala-1.0
%{_libdir}/libvala.so
%{_libdir}/pkgconfig/vala-1.0.pc

%files tools
%defattr(-,root,root,-)
%{_bindir}/*gen*
%{_bindir}/vapicheck
%{_libdir}/vala
%{_mandir}/*/*gen*

%files doc
%defattr(-,root,root,-)
%{_datadir}/devhelp/books/vala

%files -n emacs-vala
%defattr(-,root,root,-)
%{emacs_lispdir}/*.el*
%{emacs_startdir}/*



%changelog
* Fri Dec 19 2008 Michel Salim <salimma@fedoraproject.org> - 0.5.2-4
- [RHEL/emacs-vala] depend on emacs, not emacs-bin
- [RHEL/emacs-vala] compatibility fix

* Mon Dec 15 2008 Michel Salim <salimma@fedoraproject.org> - 0.5.2-3
- Fix bug in Emacs version detection

* Sat Dec 13 2008 Michel Salim <salimma@fedoraproject.org> - 0.5.2-2
- Use buildsystem variables to determine available Emacs version
- BR on gecko-devel >= 1.9, since older version is also in RHEL repo

* Sat Dec 13 2008 Michel Salim <salimma@fedoraproject.org> - 0.5.2-1
- Update to 0.5.2

* Sun Nov 23 2008 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
- Update to 0.5.1

* Fri Aug 22 2008 Michel Salim <salimma@fedoraproject.org> - 0.3.5-1
- Update to 0.3.5

* Tue Jul 15 2008 Michel Salim <salimma@fedoraproject.org> - 0.3.4-2
- Add vala-mode for editing Vala code in Emacs

* Tue Jul  1 2008 Lennart Poettering <lpoetter@redhat.com> - 0.3.4-1
- Update to 0.3.4

* Wed Jun  4 2008 Michel Salim <salimma@fedoraproject.org> - 0.3.3-1
- Update to 0.3.3

* Fri May 16 2008 Michel Salim <salimma@fedoraproject.org> - 0.3.2-1
- Update to 0.3.2

* Thu Apr 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.2.0-1
- Update to 0.2.0

* Wed Mar  5 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.7-1
- Update to 0.1.7
- -tool subpackage now requires gnome-common, intltool and libtoolize
  for out-of-the-box vala-gen-project support

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.1.6-2
- Autorebuild for GCC 4.3

* Sat Jan 19 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.6-1
- Update to 0.1.6
- Revert vapi addition, needed declarations have been inlined (r846)
- Rename -docs subpackage to -doc, to comply with guidelines

* Tue Jan 15 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.5-5
- Manually add Gee vapi file to package (bz #428692)

* Tue Dec  4 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.5-4
- Backport patch to autodetect location of automake shared files

* Tue Dec  4 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.5-3
- Add build dependency on gtk2-devel

* Tue Dec  4 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.5-2
- Enable project generator tool

* Tue Nov 27 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.5-1
- Update to 0.1.5

* Sun Nov 11 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.4-2
- Add build dependency on devhelp

* Fri Oct 19 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.4-1
- Update to 0.1.4
- Put newly-added documentation in its own subpackage (depends on devhelp)

* Mon Sep 17 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.3-5
- vapigen subpackage: add missing Require: on perl-XML-Twig

* Sat Sep  8 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.3-4
- Split -vapigen subpackage. It is functionally self-contained and the license
  is more restricted
- Updated license declarations

* Wed Sep  5 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.3-3
- Licensing and URL updates

* Tue Sep  4 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.3-2
- Enable binding generation tools

* Sun Sep  2 2007 Michel Salim <salimma@fedoraproject.org> - 0.1.3-1
- Update to 0.1.3

* Sun Mar 25 2007 Michel Salim <salimma@fedoraproject.org> - 0.0.8-1
- Update to 0.0.8

* Wed Mar  7 2007 Michel Salim <salimma@fedoraproject.org> - 0.0.7-1
- Update to 0.0.7

* Wed Feb 28 2007 Michel Salim <salimma@fedoraproject.org> - 0.0.6-1
- Update to 0.0.6

* Mon Nov  6 2006 Michel Salim <salimma@fedoraproject.org> - 0.0.5-1
- Initial package