From 854627576c6f22337ca5070bd188bb9d9fa79da2 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Tue, 7 Jul 2009 17:09:10 -0300 Subject: [PATCH] Initial support for RPM packages. --- Makefile.am | 1 + popproxy.init | 29 +++++++++++++++++++++++++++ popproxy.spec | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 popproxy.init create mode 100644 popproxy.spec diff --git a/Makefile.am b/Makefile.am index 35b39bc..f234338 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..9a82199 --- /dev/null +++ b/popproxy.init @@ -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 index 0000000..da02e35 --- /dev/null +++ b/popproxy.spec @@ -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 +- Added remove and upgrade scripts -- 2.20.1