File Mono_ASP.NET_MonoBlog.spec of Package Mono_ASP.NET_MonoBlog
Name: Mono_ASP.NET_MonoBlog
Summary: BlogX ASP.NET 1.1 weblog engine
Group: Mono/ASP.NET
Version: 0.24
Release: 1
URL: http://forge.novell.com/modules/xfmod/project/?monoblog
Packager: Joseph Hill <jhill@arcfocus.com>
License: Shared Source License for ASP.NET Source Projects
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: mono-web xsp
Source0: monoblog-1_0_1.tar.gz
%define aspPrefix /usr/share/mono/asp.net
%define appsPrefix %{aspPrefix}/apps
%define appsDataPrefix %{aspPrefix}/data
%define appsApacheConfPrefix %{aspPrefix}/conf
%define appLocation %{appsPrefix}/%{name}-%{version}
%define appDataLocation %{appsDataPrefix}/%{name}-%{version}
%define appApacheConfLocation %{appsApacheConfPrefix}/%{name}-%{version}
%define appVirtualPath /BlogX
%define appInstanceName BlogX
%define xspConfigsLocation /etc/xsp/1.0
%define xspAvailableApps %{xspConfigsLocation}/applications-available
%define xspEnabledApps %{xspConfigsLocation}/applications-enabled
%description
Mono Blog is a Mono-compatible version of the BlogX weblog engine originally developed by Chris Anderson. Because BlogX is written in C# and uses XML to store content, it is one of the easiest complete, open-source ASP.NET 1.1 applications to get running on Mono.
%prep
%setup -q -n BlogX
%build
make -C BlogXRuntime/ clean
make -C WeblogX/ clean
make -C BlogXRuntime/
cp -rap BlogXRuntime/bin/Debug/BlogXRuntime.dll* WeblogX/bin/
cp -rap BlogXRuntime/bin/Debug/BlogXRuntime.dll WeblogX
make -C WeblogX/
rm WeblogX/BlogXRuntime.dll
%clean
rm -rf "$RPM_BUILD_ROOT"
%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%{appApacheConfLocation}
cp -rap ./* $RPM_BUILD_ROOT%{appLocation}/
mkdir $RPM_BUILD_ROOT%{appLocation}/WeblogX/logs
mkdir $RPM_BUILD_ROOT%{appLocation}/WeblogX/content
chmod a+rw $RPM_BUILD_ROOT%{appLocation}/WeblogX/logs
chmod a+rw $RPM_BUILD_ROOT%{appLocation}/WeblogX/content
## 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}/WeblogX</path>
<enabled>true</enabled>
</web-application>
EOF
## Create the .conf file for apache and mod_mono
cat <<EOF > $RPM_BUILD_ROOT%{appApacheConfLocation}/%{name}.conf
Alias %{appVirtualPath} %{appLocation}/WeblogX
MonoApplicationsConfigFile %{name} %{xspAvailableApps}/%{name}.webapp
MonoServerPath %{name} "/usr/bin/mod-mono-server"
<Location %{appVirtualPath}>
Allow from all
Order allow,deny
SetHandler mono
MonoSetServerAlias %{name}
</Location>
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
%post
cat <<EOF
Application name as installed is: %{name}-%{version}
Please read /usr/share/doc/packages/xsp/README.asp-apps for more information
EOF
%files
%defattr(-, root, root)
%{appLocation}
%{appDataLocation}
%{appApacheConfLocation}
%{xspConfigsLocation}