From 222cbd6a95e3d2a546684772c8085211e5d3d055 Mon Sep 17 00:00:00 2001 From: John W. Linville Date: May 02 2011 17:30:39 +0000 Subject: Initial import (#697673) --- diff --git a/.gitignore b/.gitignore index e69de29..859d29d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/sjinn-1.01.tar.gz diff --git a/sjinn-install-DESTDIR.patch b/sjinn-install-DESTDIR.patch new file mode 100644 index 0000000..f561a6a --- /dev/null +++ b/sjinn-install-DESTDIR.patch @@ -0,0 +1,40 @@ +diff -up sjinn/Makefile.orig sjinn/Makefile +--- sjinn/Makefile.orig 2011-04-18 16:59:35.023065359 -0400 ++++ sjinn/Makefile 2011-04-18 17:01:10.385873158 -0400 +@@ -7,6 +7,7 @@ INSTALL=/usr/bin/install -c + DEPEND=/usr/X11R6/bin/makedepend + TARGET=rs232 + S_LINK=sjinn ++DESTDIR= + + prefix=/usr/local + exec_prefix=${prefix} +@@ -26,18 +27,18 @@ rs232ctl.o: rs232ctl.c rs232.h + $(CC) -c rs232ctl.c $(CFLAGS) $(INC) + + install: +- $(INSTALL) $(TARGET) ${bindir} +- rm -f ${bindir}/$(S_LINK) +- ln -s ${bindir}/$(TARGET) ${bindir}/$(S_LINK) +- $(INSTALL) -m 0644 $(TARGET).1.gz ${mandir}/$(TARGET).1.gz +- rm -f ${mandir}/$(S_LINK).1.gz +- ln -s ${mandir}/$(TARGET).1.gz ${mandir}/$(S_LINK).1.gz ++ $(INSTALL) $(TARGET) $(DESTDIR)/${bindir}/$(TARGET) ++ rm -f $(DESTDIR)/${bindir}/$(S_LINK) ++ ln -s ${bindir}/$(TARGET) $(DESTDIR)/${bindir}/$(S_LINK) ++ $(INSTALL) -m 0644 $(TARGET).1.gz $(DESTDIR)/${mandir}/$(TARGET).1.gz ++ rm -f $(DESTDIR)/${mandir}/$(S_LINK).1.gz ++ ln -s ${mandir}/$(TARGET).1.gz $(DESTDIR)/${mandir}/$(S_LINK).1.gz + + uninstall: +- rm -f ${bindir}/$(S_LINK) +- rm -f ${bindir}/$(TARGET) +- rm -f ${mandir}/$(S_LINK).1.gz +- rm -f ${mandir}/$(TARGET).1.gz ++ rm -f $(DESTDIR)/${bindir}/$(S_LINK) ++ rm -f $(DESTDIR)/${bindir}/$(TARGET) ++ rm -f $(DESTDIR)/${mandir}/$(S_LINK).1.gz ++ rm -f $(DESTDIR)/${mandir}/$(TARGET).1.gz + + clean: + rm -f $(TARGET) *.o diff --git a/sjinn-install-args.patch b/sjinn-install-args.patch new file mode 100644 index 0000000..670ccdc --- /dev/null +++ b/sjinn-install-args.patch @@ -0,0 +1,12 @@ +diff -up sjinn/Makefile.orig sjinn/Makefile +--- sjinn/Makefile.orig 2011-04-18 16:56:48.092152282 -0400 ++++ sjinn/Makefile 2011-04-18 16:56:55.179063684 -0400 +@@ -29,7 +29,7 @@ install: + $(INSTALL) $(TARGET) ${bindir} + rm -f ${bindir}/$(S_LINK) + ln -s ${bindir}/$(TARGET) ${bindir}/$(S_LINK) +- $(INSTALL) $(TARGET).1.gz ${mandir}/$(TARGET).1.gz ++ $(INSTALL) -m 0644 $(TARGET).1.gz ${mandir}/$(TARGET).1.gz + rm -f ${mandir}/$(S_LINK).1.gz + ln -s ${mandir}/$(TARGET).1.gz ${mandir}/$(S_LINK).1.gz + diff --git a/sjinn-uncompress-man-pages.patch b/sjinn-uncompress-man-pages.patch new file mode 100644 index 0000000..5286eda --- /dev/null +++ b/sjinn-uncompress-man-pages.patch @@ -0,0 +1,24 @@ +diff -up sjinn/Makefile.orig sjinn/Makefile +--- sjinn/Makefile.orig 2011-04-29 11:13:38.658751152 -0400 ++++ sjinn/Makefile 2011-04-29 11:14:07.853386165 -0400 +@@ -30,15 +30,15 @@ install: + $(INSTALL) $(TARGET) $(DESTDIR)/${bindir}/$(TARGET) + rm -f $(DESTDIR)/${bindir}/$(S_LINK) + ln -s ${bindir}/$(TARGET) $(DESTDIR)/${bindir}/$(S_LINK) +- $(INSTALL) -m 0644 $(TARGET).1.gz $(DESTDIR)/${mandir}/$(TARGET).1.gz +- rm -f $(DESTDIR)/${mandir}/$(S_LINK).1.gz +- ln -s ${mandir}/$(TARGET).1.gz $(DESTDIR)/${mandir}/$(S_LINK).1.gz ++ $(INSTALL) -m 0644 $(TARGET).1 $(DESTDIR)/${mandir}/$(TARGET).1 ++ rm -f $(DESTDIR)/${mandir}/$(S_LINK).1 ++ ln -s ${mandir}/$(TARGET).1 $(DESTDIR)/${mandir}/$(S_LINK).1 + + uninstall: + rm -f $(DESTDIR)/${bindir}/$(S_LINK) + rm -f $(DESTDIR)/${bindir}/$(TARGET) +- rm -f $(DESTDIR)/${mandir}/$(S_LINK).1.gz +- rm -f $(DESTDIR)/${mandir}/$(TARGET).1.gz ++ rm -f $(DESTDIR)/${mandir}/$(S_LINK).1 ++ rm -f $(DESTDIR)/${mandir}/$(TARGET).1 + + clean: + rm -f $(TARGET) *.o diff --git a/sjinn.spec b/sjinn.spec new file mode 100644 index 0000000..2d26414 --- /dev/null +++ b/sjinn.spec @@ -0,0 +1,121 @@ +Name: sjinn +Version: 1.01 +Release: 2%{?dist} +Summary: Simple tool for sending & receiving data from RS-232 devices + +Group: Applications/Communications +License: GPLv2+ +URL: http://sjinn.sourceforge.net/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz + +# installer should use 0644 permissions for man page +# https://sourceforge.net/tracker/?func=detail&aid=3294964&group_id=26187&atid=386394 +Patch0: sjinn-install-args.patch + +# Add DESTDIR as argument for install +# https://sourceforge.net/tracker/?func=detail&aid=3294967&group_id=26187&atid=386394 +Patch1: sjinn-install-DESTDIR.patch + +# Uncompress man pages +# https://sourceforge.net/tracker/?func=detail&aid=3294981&group_id=26187&atid=386394 +Patch2: sjinn-uncompress-man-pages.patch + + +%description +S-Jinn is a free, lightweight, open-source Linux application written in +C. It is a simple command-line tool designed for sending & receiving +data from PC controlled TIA/EIA-232 (RS-232) test, measurement, +and control devices. + +Depending on your application you may be able to use stty or +C-Kermit, but I believe you will find that S-Jinn is easier-to-use, +more intuitive, and more concise in the area of command-line and/or +scripted RS-232 data acquisition and control. + +Popular Linux communications packages like Minicom will also +communicate with RS-232 devices, but they are better suited to modems, +computers, network devices, etc. They typically lack support for any +combination of UART communication settings required by many of the +RS-232 test, measurement, and control devices on the market. + +Most communications packages also lack command-line support. Some +provide scripting languages, but S-Jinn frees you from +application-specific languages. S-Jinn simply directs the data to +STDOUT where you can display it, pipe it, and/or redirect it to +be processed by your favorite Unix shell and/or scripting language +regardless of whether you prefer Bash, Python, Perl, Expect, or you +name it. + +Other S-Jinn features include the ability to: + + * Control RS-232 DTR and RTS lines from the command-line + + * Display DTR, RTS, CTS & DSR status + + * Send control characters (including the NULL character) + + * Send values in hex + + * Specify read length + + * Set programmable delay times for both send & read. + + * Support for virtually all baud rates, parity, and data lengths + found in standard PC UARTS + + * Output Formatting: ASCII, hex, ASCII-over-hex, wrap text, + truncate lines, suppress trailing line feeds + + +%prep +%setup -q -n %{name} +tar -xzf scripts.tar.gz +gunzip rs232.1.gz + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +# Fix some file permissions +chmod -x INSTALL COPYING README EXAMPLES FAQS ChangeLog Makefile \ + configure.in *.1 *.[ch] scripts/* + +# Fix end-of-line encoding +sed -i 's/\r//' COPYING + + +%build +%configure +make %{?_smp_mflags} CFLAGS="%{optflags}" prefix=%{_prefix} + + +%install +rm -rf %{buildroot} +make INSTALL="install -cDp" DESTDIR=%{buildroot} prefix=%{_prefix} \ + mandir=%{_mandir}/man1 install + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{_bindir}/rs232 +%{_bindir}/%{name} +%{_mandir}/man1/* +%doc COPYING README EXAMPLES FAQS ChangeLog scripts + + +%changelog +* Fri Apr 29 2011 John W. Linville - 1.01-2 +- Remove executable bit from source files +- Add comments for patches, including upstream bug references +- Allow rpmbuild to handle man page compression +- Use non-macro sed invocation +- Decompress scripts tarball installed as doc +- Remove unneeded make arguments during install + +* Mon Apr 18 2011 John W. Linville - 1.01-1 +- Initial release for Fedora diff --git a/sources b/sources index e69de29..219ed1e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b38969d4a614b660919090ba0c8d5c7d sjinn-1.01.tar.gz