Initial support for RPM packages.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 7 Jul 2009 20:09:10 +0000 (17:09 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Mon, 20 Jul 2009 17:41:25 +0000 (14:41 -0300)
Makefile.am
popproxy.init [new file with mode: 0644]
popproxy.spec [new file with mode: 0644]

index 35b39bc..f234338 100644 (file)
@@ -5,3 +5,4 @@ popproxy_SOURCES = popproxy.c log.c log.h \
        pop.c pop.h usermap.c usermap.h
 dist_sysconf_DATA = popproxy.conf
 ppmanager = ppmanager.c
+EXTRA_DIST = popproxy.init popproxy.spec
diff --git a/popproxy.init b/popproxy.init
new file mode 100644 (file)
index 0000000..9a82199
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:            popproxy
+# Required-Start:
+# Required-Stop:
+# Default-Start:       2 3 4 5
+# Default-Stop:                1
+# Short-Description: POP Proxy
+### END INIT INFO
+
+POPPROXY_BIN=/usr/sbin/popproxy
+
+case $1 in
+       start)
+               startproc $POPPROXY_BIN
+               ;;
+       stop)
+               killproc $POPPROXY_BIN
+               ;;
+       restart)
+               $0 stop
+               $0 start
+               ;;
+       *)
+               echo Not implemented. Use one of start, stop or restart.
+               exit 1
+               ;;
+esac
+
diff --git a/popproxy.spec b/popproxy.spec
new file mode 100644 (file)
index 0000000..da02e35
--- /dev/null
@@ -0,0 +1,55 @@
+Name: popproxy
+Version: 0.1
+Release: 1
+License: GPL
+Group: System Environment/Daemons
+Summary: POP3 Proxy
+Vendor: Holoscópio Tecnologia Ltda.
+URL: http://holoscopio.com/
+Source: popproxy-0.1.tar.gz
+BuildRequires: glib-devel gnutls-devel gdbm-devel
+Buildroot: %{_tmppath}/%{name}-%{version}-root
+%description
+POP3 Proxy with SSL support and user access control.
+
+%define _sysconfdir /etc
+%prep
+%setup -q
+
+%build
+%configure
+make
+
+%install
+rm -rf %{buildroot}
+%makeinstall
+install -D -m 755 popproxy.init %{buildroot}/etc/init.d/popproxy
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{_bindir}/popproxy
+%{_bindir}/ppmanager
+%config /etc/popproxy.conf
+/etc/init.d/popproxy
+%dir /etc/pki/popproxy/
+
+%post
+mkdir /var/lib/popproxy
+chkconfig --add popproxy
+
+%preun
+if [ "$1" == 0 ]; then
+  /sbin/service popproxy stop > /dev/null 2>&1
+fi
+
+%postun
+if [ "$1" -ge 1 ]; then
+  /sbin/service popproxy condrestart > /dev/null 2>&1
+fi
+
+%changelog
+* Tue Jul 07 2009 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+- Added remove and upgrade scripts