LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File Mono-ASP.NET-ClubWebSite.spec of Package Mono_ASP.NET_ClubWebSite (Project Mono:Community)

Name: Mono_ASP.NET_ClubWebSite
Summary: Club web site template (starter kit)
Group: Mono/ASP.NET
Version: 1.0.0
Release: 12 
Vendor: Novell, Inc
URL: http://mono-project.com/
Packager: Marek Habersack <mhabersack@novell.com>
License: Microsoft Permissive License
BuildArch: noarch
Buildroot: %{_tmppath}/%{name}-%{version}-root
Source0: %{name}-%{version}.tar.gz
Source1: Npgsql2.dll
Source2: Npgsql2.dll.mdb
Source3: PostgreSQLProviders.dll
Source4: PostgreSQLProviders.dll.mdb
Source5: EventCalendar.dll
Patch: %{name}-%{version}.patch

%define aspPrefix /usr/share/mono/asp.net
%define appsPrefix %{aspPrefix}/apps
%define appsDataPrefix %{aspPrefix}/data
%define appLocation %{appsPrefix}/%{name}-%{version}
%define appDataLocation %{appsDataPrefix}/%{name}-%{version}
%define appVirtualPath /ClubWebSite
%define appInstanceName Club Web Site
%define xspConfigsLocation /etc/xsp/2.0
%define xspAvailableApps %{xspConfigsLocation}/applications-available
%define xspEnabledApps %{xspConfigsLocation}/applications-enabled
%define apacheConfigLocation %{aspPrefix}/conf/%{name}-%{version}

## MODIFY: start
%description 
 This is a port of the Microsoft Club Web Site ASP.NET 2.0 sample
 application to Linux/PostgreSQL. Changes made to the original source
 are kept to the minimum required to support PostgreSQL RDBMS instead
 of the MS SQL one.
## MODIFY: end

%prep
%setup -q
%patch -p1

%build
rm -rf $RPM_BUILD_ROOT
echo No build necessary
true

%install
install -d -m 755 $RPM_BUILD_ROOT%{appLocation}
install -d -m 755 $RPM_BUILD_ROOT%{appDataLocation}
install -d -m 755 $RPM_BUILD_ROOT%{xspAvailableApps}
install -d -m 755 $RPM_BUILD_ROOT%{xspEnabledApps}
install -d -m 755 $RPM_BUILD_ROOT%{apacheConfigLocation}

install -d -m 755 $RPM_BUILD_ROOT%{appLocation}/bin
install -d -m 755 $RPM_BUILD_ROOT%{appLocation}/Upload

install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT%{appLocation}/bin

## Install the application init data below, e.g.:
mv ./App_Data/*.sql $RPM_BUILD_ROOT%{appDataLocation}/
mv ./App_Data/init.sh $RPM_BUILD_ROOT%{appDataLocation}/init
chmod +x $RPM_BUILD_ROOT%{appDataLocation}/init

## Install application itself, e.g.:
cp -rap ./* $RPM_BUILD_ROOT%{appLocation}/

## Create the .webapp config file
cat <<EOF > $RPM_BUILD_ROOT%{xspAvailableApps}/%{name}.webapp
<?xml version="1.0" ?>
<web-application>
  <name>%{appInstanceName}</name>
  <vpath>%{appVirtualPath}</vpath>
  <path>%{appLocation}</path>
  <enabled>true</enabled>
</web-application>
EOF

## Create the application info file (modify the init variables as 
## required by your application
cat <<EOF > $RPM_BUILD_ROOT%{appDataLocation}/info
Name="%{name}"
Version="%{version}"
InstanceName="%{appInstanceName}"
WebappFile="%{xspAvailableApps}/%{name}.webapp"
NeedsInit="true"
Initialized="false"
EOF

## Create the apache config file
cat <<EOF > $RPM_BUILD_ROOT%{apacheConfigLocation}/%{name}.conf
Alias /ClubWebSite %{appLocation}
MonoApplicationsConfigFile ClubWebSite %{xspAvailableApps}/%{name}.webapp
MonoServerPath ClubWebSite "/usr/bin/mod-mono-server2"
#MonoServerPath ClubWebSite "/opt/novell/mono/bin/mod-mono-server2"
MonoSetEnv ClubWebSite MONO_IOMAP=all
<Location /ClubWebSite>
	Allow from all
	Order allow,deny
	SetHandler mono
	MonoSetServerAlias ClubWebSite
</Location>
EOF

%post
cat <<EOF
Application name as installed is: %{name}-%{version}
Please read /usr/share/doc/packages/xsp/README.asp-apps for more information
EOF
%clean
rm -rf $RPM_BUILD_ROOT 

%files
%defattr(-, root, root)
%{appLocation}
%{appDataLocation}
%{xspConfigsLocation}
%{apacheConfigLocation}
%attr(-,wwwrun,root) %{appLocation}
%dir %{_datadir}/mono
%dir %{_sysconfdir}/xsp
%dir %{appsDataPrefix}
%dir %{appsPrefix}
%dir %{aspPrefix}
%dir %{aspPrefix}/conf