# RPM spec file for Gtk2HS -*-rpm-spec-*- # # $Id: WashNGo.spec,v 1.2 2005/02/11 07:56:02 thor Exp $ %{!?ghc_version: %{expand: %%define ghc_version %(ghc -V | sed 's/.* //')}} %{!?ghcver: %{expand: %%define ghcver ghc%(echo %ghc_version | tr -d .)}} %define pkgstore /usr/lib/WashNGo-%{version}/ghc-%{ghc_version} %define pkgscripts %{pkgstore}/pkg-scripts Summary: WashNGo = Web Authoring System Haskell Name: WashNGo-%{ghcver} Version: 2.9 Release: 3.tgm License: Like BSD w/ adv. clause Group: Development/Libraries URL: http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH/ Source0: http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH/WashNGo-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: haddock BuildRequires: ghc >= %{ghc_version} Patch: WashNGo-2.9-ghc-O2.diff %description WashNGo is a complete, ready-to-go build of WASH/CGI and its related libraries. WASH/CGI is an embedded, domain-specific language for server-side Web scripting with Sessions, Compositional Forms, Persistence, and Graphics. It offers an advanced web-programming model that greatly simplifies interactions and eliminates a large class of errors possible with traditional approaches. %prep %setup -q -n WashNGo-%{version} %patch -p1 %build runhaskell ./Setup.lhs configure --ghc --prefix=%{_prefix} runhaskell ./Setup.lhs build runhaskell ./Setup.lhs haddock %install rm -rf %{buildroot} runhaskell Setup.lhs copy --destdir=%{buildroot} mkdir -p %{buildroot}%{pkgscripts} runhaskell ./Setup.lhs register --gen-script runhaskell ./Setup.lhs unregister --gen-script mv register.sh unregister.sh %{buildroot}%{pkgscripts} %clean rm -rf %{buildroot} # SCRIPTS # # Scripts for registering/unregistering w/ GHC. Note that # the scripts are called in the following order: # # %pre for new version of package being installed # ... (all new files are installed) # %post for new version of package being installed # # %preun for old version of package being removed # ... (all old files are removed) # %postun for old version of package being removed %pre # in case we're upgrading to a library having the same Cabal # name+version as the currently installed library, we need to # unregister the old library first, so that the register script in # %post may succeed. (note that this command runs *before* the new # package's files are installed, and thus will execute the *previous* # version's unregister script, if the script exists in the same location # as the about-to-be-installed library's script) [ "$1" = 2 ] && %{pkgscripts}/unregister.sh >& /dev/null || : %post %{pkgscripts}/register.sh >& /dev/null %preun # always unregister the library before we remove its files # (see %postun, however) %{pkgscripts}/unregister.sh >& /dev/null || : %postun # if we're upgrading, the %preun step may have unregistered # the *new* version of the library (if it had an identical # Cabal name+version, even though the RPM release differs); # therefore, we must attempt to re-register it [ "$1" = 1 ] && %{pkgscripts}/register.sh >& /dev/null || : %files %defattr(-,root,root,-) %{_bindir}/* %{pkgstore} %doc dist/doc/html %doc README %doc LICENSE %changelog * Wed Aug 23 2006 - 2.9-3.tgm - Updated for now-Cabalized WashNGo 2.9 * Fri Jul 15 2005 Tom Moertel - - Updated for WashNGo 2.4.6 * Tue Mar 22 2005 Tom Moertel - - Updated for WashNGo 2.3.1 - Updated for new ghc-pkg in GHC 6.4 * Sat Mar 12 2005 Tom Moertel - - Allow ghc_version and ghcver to be set on cmd line via --define 'var val' - Automatically default ghc_version and ghcver to version of ghc shell finds * Fri Feb 11 2005 Tom Moertel - 2.0.6-1.fc3.tgm - Fixed WASH/CGI URL * Thu Feb 10 2005 Tom Moertel - - Initial spec (borrows heavily from Jens-Ulrik Holger Petersen's gtk2hs.spec)