packages: martian/martian.spec, martian/martian.init (NEW) - add pldized in...
glen
glen at pld-linux.org
Sat Aug 13 13:39:41 CEST 2011
Author: glen Date: Sat Aug 13 11:39:41 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- add pldized initscript
---- Files affected:
packages/martian:
martian.spec (1.3 -> 1.4) , martian.init (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/martian/martian.spec
diff -u packages/martian/martian.spec:1.3 packages/martian/martian.spec:1.4
--- packages/martian/martian.spec:1.3 Sat Aug 13 13:10:41 2011
+++ packages/martian/martian.spec Sat Aug 13 13:39:35 2011
@@ -19,9 +19,9 @@
%define _enable_debug_packages 0
%endif
-%define rel 0.6
+%define rel 0.7
%define pname martian
-Summary: martian / linmodem package
+Summary: Martian / Linmodem package
Name: %{pname}%{_alt_kernel}
Version: 20100123
Release: %{rel}
@@ -34,17 +34,22 @@
# Source0-md5: 17205efb777bb48fdf6b76210cf5f8f6
Source1: http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/ltmdmobj.o-8.31-gcc4.gz
# Source1-md5: 14df61d5307f6960ff9de42567db4db9
+Source2: martian.init
URL: http://martian.barrelsoutofbond.org/
BuildRequires: bash
-Provides: martian_dev = %{release}
+BuildRequires: rpmbuild(macros) >= 1.379
%if %{with kernel}
%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
-BuildRequires: rpmbuild(macros) >= 1.379
%endif
+Requires(post,preun): /sbin/chkconfig
+Requires: rc-scripts
# x86_64 kernel module likely builds too, but userspace is 32bit only due pre-provided binary .o
ExclusiveArch: %{ix86}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# may not be stripped, see modem/tweakrelocsdynamic.c
+%define _noautostrip .*/martian_modem
+
%description
Martian is software to serve the Agere Systems PCI WinModem under
LINUX. These are modems built on DSP 164x (Mars) series. Project's
@@ -61,9 +66,6 @@
Requires(postun): %releq_kernel
%endif
-# may not be stripped, see modem/tweakrelocsdynamic.c
-%define _noautostrip .*/martian_modem
-
%description -n kernel%{_alt_kernel}-misc-martian
Linux Lucent/Agere Systems PCI WinModem driver.
@@ -92,7 +94,7 @@
%if %{with userspace}
install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/rc.d/init.d}
# install startup sccript
-install -p scripts/%{pname} $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/martian_modem
# install the martian modem
install -p modem/martian_modem $RPM_BUILD_ROOT%{_sbindir}
%endif
@@ -104,34 +106,42 @@
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+/sbin/chkconfig --add martian_modem
+%service martian_modem restart
+
%post -n kernel%{_alt_kernel}-misc-martian
%depmod %{_kernel_ver}
%postun -n kernel%{_alt_kernel}-misc-martian
%depmod %{_kernel_ver}
-%if %{with kernel}
-%files -n kernel%{_alt_kernel}-misc-martian
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/*.ko*
-%endif
-
%if %{with userspace}
%files
%defattr(644,root,root,755)
%doc README INSTALL ChangeLog Concept
%doc Cleaning.txt sample.txt
%doc modem/ASWMLICENSE
-%attr(754,root,root) /etc/rc.d/init.d/martian
+%attr(754,root,root) /etc/rc.d/init.d/martian_modem
%attr(755,root,root) %{_sbindir}/martian_modem
%endif
+%if %{with kernel}
+%files -n kernel%{_alt_kernel}-misc-martian
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}/misc/*.ko*
+%endif
+
+
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
* %{date} PLD Team <feedback at pld-linux.org>
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.4 2011/08/13 11:39:35 glen
+- add pldized initscript
+
Revision 1.3 2011/08/13 11:10:41 glen
- disable martian_modem stripping. WORKS NOW (got OK on ATZ minicom)
================================================================
Index: packages/martian/martian.init
diff -u /dev/null packages/martian/martian.init:1.1
--- /dev/null Sat Aug 13 13:39:41 2011
+++ packages/martian/martian.init Sat Aug 13 13:39:35 2011
@@ -0,0 +1,144 @@
+#!/bin/sh
+#
+# Init file for martian_modem
+#
+# chkconfig: 2345 45 55
+#
+# description: martian_modem long service description
+#
+# processname: martian_modem
+# config:
+# pidfile:
+#
+### BEGIN INIT INFO
+# Provides: martian_modem
+# Default-Start: 2 3 4 5
+# Short-Description: martian_modem
+# Description: martian_modem
+### END INIT INFO
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Set defaults
+DEVICE=/dev/ttySM0
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/martian_modem ] && . /etc/sysconfig/martian_modem
+
+# configtest itself
+# must return non-zero if check failed
+# output is discarded if checkconfig is ran without details
+configtest() {
+ if ! is_module martian_dev; then
+ nls "kernel module %s is not loaded!" martian_dev
+ return 1
+ fi
+ return 0
+}
+
+# wrapper for configtest
+checkconfig() {
+ local details=${1:-0}
+
+ if [ $details = 1 ]; then
+ # run config test and display report (status action)
+ show "Checking %s configuration" "Martian Modem"; busy
+ local out
+ out=$(configtest 2>&1)
+ RETVAL=$?
+ if [ $RETVAL = 0 ]; then
+ ok
+ else
+ fail
+ fi
+ [ "$out" ] && echo >&2 "$out"
+ else
+ # run config test and abort with nice message if failed
+ # (for actions checking status before action).
+ configtest >/dev/null 2>&1
+ RETVAL=$?
+ if [ $RETVAL != 0 ]; then
+ show "Checking %s configuration" "Martian Modem"; fail
+ nls 'Configuration test failed. See details with %s "checkconfig"' $0
+ exit $RETVAL
+ fi
+ fi
+}
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/martian_modem ]; then
+ msg_already_running "Martian Modem"
+ return
+ fi
+
+ [ "$DEVICE" = "/dev/ttySM0" ] && DEVICE=
+
+ checkconfig
+ msg_starting "Martian Modem"
+
+ daemon /usr/sbin/martian_modem --daemon $OPTIONS $DEVICE
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/martian_modem
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/martian_modem ]; then
+ msg_not_running "Martian Modem"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "Martian Modem"
+ killproc martian_modem
+ rm -f /var/lock/subsys/martian_modem
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/martian_modem ]; then
+ msg_not_running "Martian Modem"
+ RETVAL=$1
+ return
+ fi
+
+ checkconfig
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ checkconfig
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ checkconfig|configtest)
+ checkconfig 1
+ ;;
+ status)
+ status martian_modem
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/martian/martian.spec?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list