Package init

This commit is contained in:
overweight 2019-09-30 11:16:58 -04:00
commit 1ec71fe959
8 changed files with 3771 additions and 0 deletions

23
setserial-2.17-fhs.patch Normal file
View File

@ -0,0 +1,23 @@
--- setserial-2.17/Makefile.in.fhs Wed Jun 14 15:42:39 2000
+++ setserial-2.17/Makefile.in Wed Jun 14 15:44:25 2000
@@ -3,6 +3,8 @@
srcdir = @srcdir@
VPATH = @srcdir@
+bindir = @bindir@
+mandir = @mandir@
VERSION = @RELEASE_VERSION@
INSTALL = @INSTALL@
@@ -26,9 +28,8 @@
nroff -man setserial.8 > setserial.cat
install: setserial setserial.8
- $(INSTALL_PROGRAM) setserial $(DESTDIR)/bin
- $(STRIP) $(DESTDIR)/bin/setserial
- $(INSTALL_DATA) setserial.8 $(DESTDIR)/usr/man/man8
+ $(INSTALL_PROGRAM) setserial $(DESTDIR)$(bindir)
+ $(INSTALL_DATA) setserial.8 $(DESTDIR)$(mandir)/man8
clean:
$(RM) setserial setserial.o setserial.cat *~

65
setserial-2.17-rc.patch Normal file
View File

@ -0,0 +1,65 @@
--- setserial-2.17/rc.serial.rc Thu Jan 27 15:47:30 2000
+++ setserial-2.17/rc.serial Tue Sep 11 17:54:26 2001
@@ -19,7 +19,7 @@
#
RCLOCKFILE=/var/lock/subsys/serial
-DIRS="/lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ."
+DIRS="/lib/modules/`uname -r`/kernel/drivers/char /lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ."
PATH=/bin:/sbin:/usr/bin
DRIVER=serial
DRIVER_NAME=serial
@@ -79,10 +79,11 @@
if test $action = stop ; then
if test -n ${SETSERIAL} -a "$LOADED" != "no" -a \
- `head -1 /etc/serial.conf`X = "###AUTOSAVE###X" ; then
+ "$(head -1 /etc/serial.conf 2>/dev/null)" = "###AUTOSAVE###" ; then
echo -n "Saving state of serial devices... "
grep "^#" /etc/serial.conf > /etc/.serial.conf.new
- ${SETSERIAL} -G -g ${ALLDEVS} >> /etc/.serial.conf.new
+ ${SETSERIAL} -G -g ${ALLDEVS} \
+ 2>/dev/null >> /etc/.serial.conf.new
mv /etc/serial.conf /etc/.serial.conf.old
mv /etc/.serial.conf.new /etc/serial.conf
echo "done."
@@ -108,22 +109,26 @@
# If not stop, it must be a start....
#
-if test -n $MODULE -a "$LOADED" != "yes" ; then
+if test -n "$MODULE" -a "$LOADED" != "yes" ; then
+ MAPFILE=$(mktemp /tmp/$DRIVER.map.XXXXXX) \
+ || { echo "Couldn't create secure temporary file"; exit 1; }
+ ERRORS=$(mktemp /tmp/$DRIVER.XXXXXX) \
+ || { echo "Couldn't create secure temporary file"; exit 1; }
if insmod -fm $MODULE $DRIVER_ARG \
- > /tmp/$DRIVER.map 2> /tmp/$DRIVER.$$; then :;
+ > "${MAPFILE}" 2> "${ERRORS}"; then :;
else
echo "Couldn't load $DRIVER_NAME driver."
- echo "See error logs in /tmp/$DRIVER.$$"
+ echo "See error logs in ${ERRORS}"
exit 1
fi
- /bin/rm -f /tmp/$DRIVER.$$
+ /bin/rm -f "${ERRORS}"
fi
-if test -f /etc/serial.conf ; then
- if test -n ${SETSERIAL} ; then
+if test -f "/etc/serial.conf" ; then
+ if test -n "${SETSERIAL}" ; then
grep -v ^# < /etc/serial.conf | while read device args
do
- ${SETSERIAL} -z $device $args
+ ${SETSERIAL} -z $device $args 2>/dev/null
done
fi
else
@@ -131,4 +136,4 @@
fi
touch ${RCLOCKFILE}
-${SETSERIAL} -bg ${ALLDEVS}
+${SETSERIAL} -bg ${ALLDEVS} 2>/dev/null

View File

@ -0,0 +1,11 @@
--- setserial-2.17/README.readme Tue Sep 11 17:59:52 2001
+++ setserial-2.17/README Tue Sep 11 18:00:27 2001
@@ -13,6 +13,6 @@
The simplest way to configure the serial ports is to copy the provided
rc.serial file to the appropriate /etc/rc.d directory. For example,
-to install rc.serial on a RedHat system, copy rc.serial to
-/etc/rc.d/init.d/serial, and then run the command "chkconfig -add serial".
+to install rc.serial on a Fedora system, copy rc.serial to
+/etc/rc.d/init.d/serial, and then run the command "chkconfig --add serial".

View File

@ -0,0 +1,11 @@
--- setserial-2.17/setserial.c.spelling 2003-01-10 17:21:24.000000000 +0000
+++ setserial-2.17/setserial.c 2003-01-10 17:21:39.000000000 +0000
@@ -707,7 +707,7 @@
fprintf(stderr, "\t spd_warp\tuse 460kb instead of 38.4kb\n");
fprintf(stderr, "\t spd_cust\tuse the custom divisor to set the speed at 38.4kb\n");
fprintf(stderr, "\t\t\t\t(baud rate = baud_base / custom_divisor)\n");
- fprintf(stderr, "\t spd_normal\tuse 38.4kb when a buad rate of 38.4kb is selected\n");
+ fprintf(stderr, "\t spd_normal\tuse 38.4kb when a baud rate of 38.4kb is selected\n");
fprintf(stderr, "\n");
fprintf(stderr, "Use a leading '0x' for hex numbers.\n");
fprintf(stderr, "CAUTION: Using an invalid port can lock up your machine!\n");

BIN
setserial-2.17.tar.gz Normal file

Binary file not shown.

3576
setserial-aarch64.patch Normal file

File diff suppressed because it is too large Load Diff

30
setserial-hayesesp.patch Normal file
View File

@ -0,0 +1,30 @@
diff -up setserial-2.17/setserial.c.hayesesp setserial-2.17/setserial.c
--- setserial-2.17/setserial.c.hayesesp 2010-02-15 12:20:59.104048442 +0000
+++ setserial-2.17/setserial.c 2010-02-15 12:21:42.368924088 +0000
@@ -356,7 +356,7 @@ void set_multiport(char *device, int fd,
}
#endif
-#ifdef TIOCGHAYESESP
+#if defined(TIOCGHAYESESP) && defined(HAVE_LINUX_HAYESESP_H)
void print_hayesesp(int fd)
{
struct hayes_esp_config esp;
@@ -453,7 +453,7 @@ void get_serial(char *device)
print_flags(&serinfo, "\tFlags: ", "");
printf("\n\n");
-#ifdef TIOCGHAYESESP
+#if defined(TIOCGHAYESESP) && defined(HAVE_LINUX_HAYESESP_H)
print_hayesesp(fd);
#endif
} else if (verbosity==0) {
@@ -593,7 +593,7 @@ void set_serial(char *device, char ** ar
}
set_multiport(device, fd, &arg);
break;
-#ifdef TIOCGHAYESESP
+#if defined(TIOCGHAYESESP) && defined(HAVE_LINUX_HAYESESP_H)
case CMD_RX_TRIG:
case CMD_TX_TRIG:
case CMD_FLOW_OFF:

55
setserial.spec Normal file
View File

@ -0,0 +1,55 @@
%define _bindir /bin
Name: setserial
Version: 2.17
Release: 48
Summary: A utility for configuring serial ports
License: GPL+
URL: https://setserial.sourceforge.net
Source0: https://sourceforge.net/projects/setserial/files/setserial/%{version}/%{name}-%{version}.tar.gz
# https://sourceforge.net/p/setserial/patches/
Patch0: setserial-2.17-fhs.patch
Patch1: setserial-2.17-rc.patch
# https://src.fedoraproject.org/rpms/setserial/tree/
Patch2: setserial-2.17-readme.patch
Patch3: setserial-2.17-spelling.patch
Patch4: setserial-hayesesp.patch
Patch5: setserial-aarch64.patch
BuildRequires: gcc groff git
%description
setserial is a program designed to set and/or report the
configuration information associated with a serial port.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1 -S git
%build
%set_build_flags
CFLAGS="$CFLAGS $LDFLAGS"
%configure
%make_build
%install
install -d %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_mandir}/man8
%make_install
%files
%defattr(-,root,root)
%doc rc.serial
%{_bindir}/setserial
%files help
%defattr(-,root,root)
%doc README
%{_mandir}/man*/*.gz
%changelog
* Fri Sep 06 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.17-48
- Package init