diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8062fd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vmpsd-1.4.01.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index 88c93de..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: vmpsd -# $Id$ -NAME := vmpsd -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/sources b/sources index e69de29..3f070fe 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b95f6390f0a340f4f99d4e8f72201cb4 vmpsd-1.4.01.tar.gz diff --git a/vmpsd.init b/vmpsd.init new file mode 100644 index 0000000..b705a06 --- /dev/null +++ b/vmpsd.init @@ -0,0 +1,62 @@ +#!/bin/bash +# +# chkconfig: - 92 8 +# description: vmpsd is a GPL implementation of Cisco's VMPS +# processname: vmpsd +# pidfile: /var/run/vmpsd.pid +# config: /etc/sysconfig/vmpsd + +# source function library +. /etc/init.d/functions + +if test -e /etc/sysconfig/vmpsd ; then + . /etc/sysconfig/vmpsd +fi + +RETVAL=0 + +start() { + echo -n $"Starting vmpsd: " + + daemon --user nobody vmpsd $OPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vmpsd +} + +stop() { + echo -n $"Shutting down vmpsd: " + killproc vmpsd + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vmpsd +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/vmpsd ]; then + stop + start + fi + ;; + status) + status vmpsd + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL diff --git a/vmpsd.spec b/vmpsd.spec new file mode 100644 index 0000000..d3b277f --- /dev/null +++ b/vmpsd.spec @@ -0,0 +1,102 @@ +Name: vmpsd +Version: 1.4.01 +Release: 6%{?dist} +Summary: A GPL implementation of Cisco Systems' VMPS + +Group: System Environment/Daemons +# Valid license according to http://fedoraproject.org/wiki/Licensing +License: GPL+ +URL: http://vmps.sourceforge.net/ +Source0: http://downloads.sourceforge.net/vmps/%{name}-%{version}.tar.gz +Source1: vmpsd.sysconfig +Source2: vmpsd.init +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires(post): chkconfig +Requires(preun): chkconfig +# This is for /sbin/service +Requires(preun): initscripts +Requires(postun): initscripts + +%description +VMPS (VLAN Management Policy Server) is a way of assigning switch ports to +specific VLANs based on MAC address of connecting device. OpenVMPS is a GPL +implementation of VMPS. + +%prep +%setup -qn %{name} + +%build +%configure +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_initrddir} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +mkdir -p $RPM_BUILD_ROOT%{_mandir} + +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" + +install %{S:1} -p -m 0644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} +install %{S:2} -p $RPM_BUILD_ROOT%{_initrddir}/%{name} + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +/sbin/chkconfig --add %{name} + +%preun +if [ $1 -eq 0 ] ; then + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%postun +if [ "$1" -ge "1" ] ; then + /sbin/service %{name} condrestart >/dev/null 2>&1 || : +fi + +%files +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/vlan.db +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%attr(0755,root,root) %{_initrddir}/%{name} +%attr(0755,root,root) %{_bindir}/%{name} +%doc doc/NetregExtension.txt +%doc doc/VQP-spec.txt +%doc doc/vlan.db.example +%doc COPYING.GPL ChangeLog AUTHORS +%{_mandir}/man1/%{name}.1.gz + +%changelog +* Mon Sep 7 2009 Colin Coe - 1.4.01-6%{?dist} +- Remove condrestart from post section as it's now in the postun section +- Stop packaging the INSTALL file + +* Sun Sep 6 2009 Colin Coe - 1.4.01-5 +- Add condrestart in postun +- Add ChangeLog and COPYING.GPL to files section + +* Sat Sep 5 2009 Colin Coe - 1.4.01-4 +- Add condrestart into post section +- Use macros in files section +- Remove '$DESTDIR=$RPM_BUILD_ROOT' from make in build section +- Do parallel make +- Don't start service by default +- Add Requires for post and preun +- Correct the Source0 URL +- Move clean to after install + +* Tue Sep 1 2009 Colin Coe - 1.4.01-3 +- Split /etc/sysconfig/vmpsd and /etc/rc.d/init.d/vmpsd out of the spec file +- Corrected license from GPLv2 to GPL+ +- Ensured that the make is done in the build section + +* Thu Aug 20 2009 Colin Coe - 1.4.01-2 +- Tidied spec file and silenced rpmlint output + +* Mon Aug 17 2009 Colin Coe - 1.4.01-1 +- Initial Packaging diff --git a/vmpsd.sysconfig b/vmpsd.sysconfig new file mode 100644 index 0000000..cd7c043 --- /dev/null +++ b/vmpsd.sysconfig @@ -0,0 +1 @@ +OPTIONS="-f /etc/vmps.db -l 0x700"