SPECS: proftpd-mod_shaper.spec - builds now

glen glen at pld-linux.org
Sat Apr 29 15:58:09 CEST 2006


Author: glen                         Date: Sat Apr 29 13:58:09 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- builds now

---- Files affected:
SPECS:
   proftpd-mod_shaper.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/proftpd-mod_shaper.spec
diff -u SPECS/proftpd-mod_shaper.spec:1.1 SPECS/proftpd-mod_shaper.spec:1.2
--- SPECS/proftpd-mod_shaper.spec:1.1	Sat Apr 29 15:36:00 2006
+++ SPECS/proftpd-mod_shaper.spec	Sat Apr 29 15:58:04 2006
@@ -1,6 +1,7 @@
 # $Revision$, $Date$
+%define		mod_name	mod_shaper
 Summary:	PROfessional FTP Daemon with apache-like configuration syntax
-Name:		proftpd-mod_shaper
+Name:		proftpd-%{mod_name}
 Version:	0.5.6
 Release:	0.1
 License:	GPL v2+
@@ -8,11 +9,13 @@
 Source0:	http://www.castaglia.org/proftpd/modules/proftpd-mod-shaper-%{version}.tar.gz
 # Source0-md5:	a81c3ed2d45f7c938416a970fd559703
 URL:		http://www.castaglia.org/proftpd/modules/mod_shaper.html
+BuildRequires:	proftpd-devel
+BuildRequires:	rpmbuild(macros) >= 1.268
+Requires:	proftpd >= 1:1.3.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_sysconfdir		/etc/ftpd
-%define		_localstatedir	/var/run
-%define		_libexecdir		%{_prefix}/%{_lib}/%{name}
+%define		_libexecdir		%{_prefix}/%{_lib}/proftpd
 
 %description
 The mod_shaper module is designed to split overall rates, both
@@ -23,22 +26,42 @@
 uploaded via the APPE, STOR, and STOU commands.
 
 %prep
-%setup -q -n mod_shaper
+%setup -q -n %{mod_name}
 
 %build
-%configure
-%{__make}
+%{__cc} %{rpmcflags} -I/usr/include/proftpd %{mod_name}.c -shared -o %{mod_name}.so
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_sysconfdir}/conf.d}
+install %{mod_name}.so $RPM_BUILD_ROOT%{_libexecdir}
+echo 'LoadModule        %{mod_name}.c' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{mod_name}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+if [ "$1" = "1" ]; then
+	if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then
+		%service -q rc-inetd reload
+	elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then
+		%service -q proftpd restart
+	fi
+fi
+
+%postun
+if [ "$1" = "0" ]; then
+	if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf; then
+		%service -q rc-inetd reload
+	elif grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf; then
+		%service -q proftpd restart
+	fi
+fi
+
 %files
 %defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{mod_name}.conf
+%attr(755,root,root) %{_libexecdir}/%{mod_name}.so
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -46,6 +69,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2006/04/29 13:58:04  glen
+- builds now
+
 Revision 1.1  2006/04/29 13:36:00  glen
 - new, impossible to build outside proftpd sources
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/proftpd-mod_shaper.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list