jabberd.patch

Marcin Sztolcman msztolcman at post.pl
Sun Apr 24 09:51:08 CEST 2005


Marcin Sztolcman wrote:

witam
przypominam sie z tym:

> jabberd.spec - przy probie budowania bez sqlite nie instalowal
> db-setup.sqlite, ale w docach na sile chcial go wrzucac, przez co sie
> wysypywal.

i dorzucam patcha do lstat.spec ktory dodaje bconda do budowania go z 
apache1. domyslnie dalej jest apache2.
nie wiem czy wszystko dobrze zrobilem, ale u mnie dla apache1 na pewno 
poprawnie sie buduje, dla apache2 tez.

	Marcin Sztolcman

-- 
Marcin ``MySZ`` Sztolcman
http://diary.urzenia.net :: mailto:http://urzenia.net/email
-------------- next part --------------
--- lstat.spec.org	2005-02-25 14:24:52.000000000 +0100
+++ lstat.spec	2005-04-24 09:48:56.000000000 +0200
@@ -3,12 +3,15 @@
 # - allow to show while configure where are: "w","users","sh","ipchains","df","fping","ifconfig","install","perl","chmod","iptables","uptime","htpasswd"
 #   Or guess it...
 # - make .htaccess files in /etc/lstat and symlink them into proper places...
+# Conditional build:
+%bcond_with	apache1
+#
 %include	/usr/lib/rpm/macros.perl
 Summary:	LinuxStat is for generating and displaying different statistics
 Summary(pl):	LinuxStat służy do generowania i prezentacji różnych statystyk
 Name:		lstat
 Version:	2.3.2
-Release:	9
+Release:	10
 Epoch:		1
 License:	GPL
 Group:		Applications/Networking
@@ -19,7 +22,7 @@
 Patch1:		%{name}-PLD.patch
 Patch2:		%{name}-perlhandler.patch
 URL:		http://lstat.sourceforge.net/
-BuildRequires:	apache-mod_auth
+BuildRequires:	apache%{?with_apache1:1}-mod_auth
 BuildRequires:	perl-base
 BuildRequires:	perl-CGI
 BuildRequires:	rpm-perlprov
@@ -31,9 +34,15 @@
 Requires(post,preun):	grep
 Requires(preun):	apache
 Requires(preun):	fileutils
+%if %{with apache1}
+Requires:	apache1-mod_auth
+Requires:	apache1-mod_dir
+Requires:	apache1-mod_perl
+%else
 Requires:	apache-mod_auth
 Requires:	apache-mod_dir
 Requires:	apache-mod_perl
+%endif
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -42,7 +51,11 @@
 %define		_wwwuser		http
 %define		_wwwgroup		http
 %define		_wwwrootdir		/usr/share
+%if %{with apache1}
+%define		_httpdconf		/etc/apache/apache.conf
+%else
 %define		_httpdconf		/etc/httpd/httpd.conf/httpd.conf
+%endif
 
 %description
 LinuxStat is for generating and displaying different statistics of
@@ -73,7 +86,12 @@
 %build
 %{__perl} ./configure \
 	--apache \
+%if %{with apache1}
+	--mod_perl1 \
+	--with-lstatconf=/etc/apache/conf.d/ \
+%else
 	--mod_perl2 \
+%endif
 	--with-httpdconf=%{_httpdconf} \
 	--with-prefix=%{_prefix} \
 	--with-bin=%{_bindir} \
@@ -99,7 +117,11 @@
 
 install %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lstatd
 
+%if %{with apache1}
+sed -i -e "s#lstat/#lstat#g" $RPM_BUILD_ROOT%{_sysconfdir}/apache/conf.d/lstat.conf
+%else
 sed -i -e "s#lstat/#lstat#g" $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/lstat.conf
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -112,9 +134,16 @@
 	echo "Run \"/etc/rc.d/init.d/lstatd start\" to start counting statistics."
 fi
 
+
+%if %{with apache1}
+if [ -f /var/lock/subsys/apache ]; then
+	/etc/rc.d/init.d/apache restart 1>&2
+fi
+%else
 if [ -f /var/lock/subsys/httpd ]; then
 	/etc/rc.d/init.d/httpd restart 1>&2
 fi
+%endif
 /usr/bin/Mkgraph.pl
 
 %preun
@@ -125,12 +154,29 @@
 	fi
 
 /sbin/chkconfig --del lstatd
+%if %{with apache1}
+	if [ -f /var/lock/subsys/apache ]; then
+		/etc/rc.d/init.d/apache restart 1>&2
+	fi
+%else
 	if [ -f /var/lock/subsys/httpd ]; then
 		/etc/rc.d/init.d/httpd restart 1>&2
 	fi
+%endif
 fi
 
 %triggerpostun -- %{name} <= 1:2.3.3-5
+%if %{with apache1}
+if [ -s /etc/apache/conf.d/lstat.conf ]; then
+	sed -i -e "s#/home/services/apache/lstat/#/usr/share/lstat/#g" /etc/apache/conf.d/lstat.conf
+fi
+if [ -s /etc/lstat/config ]; then
+	sed -i -e "s#/home/services/apache/lstat/#/usr/share/lstat/#g" /etc/lstat/config
+fi
+if [ -s /home/services/apache/lstat/.htaccess ]; then
+	mv /home/services/apache/lstat/.htaccess /usr/share/lstat/
+fi
+%else
 if [ -s /etc/httpd/httpd.conf/lstat.conf ]; then
 	sed -i -e "s#/home/services/httpd/lstat/#/usr/share/lstat/#g" /etc/httpd/httpd.conf/lstat.conf
 fi
@@ -140,6 +186,7 @@
 if [ -s /home/services/httpd/lstat/.htaccess ]; then
 	mv /home/services/httpd/lstat/.htaccess /usr/share/lstat/
 fi
+%endif
 
 %files
 %defattr(644,root,root,755)
@@ -147,7 +194,11 @@
 %attr(754,root,root) %{_initdir}/lstatd
 %dir %{_sysconfdir}/lstat
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/lstat/config
+%if %{with apache1}
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/apache/conf.d/lstat.conf
+%else
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/httpd.conf/lstat.conf
+%endif
 %dir %{_wwwrootdir}/lstat
 %dir %{_wwwrootdir}/lstat/doc
 %dir %{_wwwrootdir}/lstat/icons


More information about the pld-devel-pl mailing list