SPECS: openvcp-web.spec - cleanups, still untested

baggins baggins at pld-linux.org
Sat Sep 22 02:31:31 CEST 2007


Author: baggins                      Date: Sat Sep 22 00:31:31 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- cleanups, still untested

---- Files affected:
SPECS:
   openvcp-web.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/openvcp-web.spec
diff -u SPECS/openvcp-web.spec:1.1 SPECS/openvcp-web.spec:1.2
--- SPECS/openvcp-web.spec:1.1	Sat Sep 22 01:55:54 2007
+++ SPECS/openvcp-web.spec	Sat Sep 22 02:31:26 2007
@@ -11,56 +11,63 @@
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	webapps
 Requires(triggerpostun):	sed >= 4.0
-# see SOURCES/webapps.README for description and complete listing
-#Requires:	webserver(access)
-#Requires:	webserver(alias)
-#Requires:	webserver(auth)
-#Requires:	webserver(cgi)
-#Requires:	webserver(indexfile)
-#Requires:	webserver(php)
+Requires:	webserver(access)
+Requires:	webserver(alias)
+Requires:	webserver(auth)
+Requires:	php >= 5.0
+Requires:	php-gd
+Requires:	php-mysql
+Requires:	php-socket
+Requires:	php-gettext
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_webapps	/etc/webapps
 %define		_webapp		%{name}
 %define		_sysconfdir	%{_webapps}/%{_webapp}
-#%define		_appdir		%{_datadir}/%{_webapp}
-
-# in case _sysconfdir is not in webapps dir, run this replace pattern
-# before copy-pasting to your spec: :%s#%{_sysconfdir}#%{_webapps}/%{_webapp}#g
+%define		_appdir		%{_datadir}/%{_webapp}
 
 %description
 VServer Control Panel Web interface.
 
 %prep
-%setup -q
+%setup -q -n %{name}-%{version}-rc2
 
-cat > apache.conf <<'EOF'
+cat > httpd.conf <<'EOF'
 Alias /%{name} %{_appdir}
 <Directory %{_appdir}>
-	Allow from all
+	RewriteEngine On
+	RewriteRule ^openvcp(.*)$ index.php$1
+
+	Order Deny,Allow
+	Deny from all
+	Allow from localhost
+</Directory>
+
+<Directory %{_appdir}/core>
+	Order Deny,Allow
+	Deny from all
 </Directory>
 EOF
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
-#install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/cache/openvcp-web}
+
+install core/openvcp.conf $RPM_BUILD_ROOT%{_sysconfdir}
 
-#install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
-install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+# That way we won't miss any new files on package update
+cp -a index.php core mods themes $RPM_BUILD_ROOT%{_appdir}
+rm -rf $RPM_BUILD_ROOT%{_appdir}/core/{cache,.htaccess,mysql.sql,openvcp.conf}
+
+ln -sf /var/cache/openvcp-web $RPM_BUILD_ROOT%{_appdir}/core/cache
+ln -sf %{_sysconfdir}/openvcp.conf $RPM_BUILD_ROOT%{_appdir}/core/openvcp.conf
+
+install httpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-# %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
-#
-# Usage:
-#   %%webapp_register HTTPD WEBAPP
-#   %%webapp_unregister HTTPD WEBAPP
-
 %triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
 
@@ -81,12 +88,14 @@
 
 %files
 %defattr(644,root,root,755)
+%doc AUTHORS INSTALL README core/mysql.sql
 %dir %attr(750,root,http) %{_sysconfdir}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+#%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
-#%{_appdir}
+#%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
+%{_appdir}
+%dir %attr(770,httpd,httpd) /var/cache/openvcp-web
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -94,6 +103,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2007/09/22 00:31:26  baggins
+- cleanups, still untested
+
 Revision 1.1  2007/09/21 23:55:54  baggins
 - initial revison, quite raw
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/openvcp-web.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list