diff --git a/.gitignore b/.gitignore index e69de29..86b1cc2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/SocketW031026.tar.gz diff --git a/SocketW.spec b/SocketW.spec new file mode 100644 index 0000000..e105432 --- /dev/null +++ b/SocketW.spec @@ -0,0 +1,83 @@ +Name: SocketW +Version: 031026 +Release: 3%{?dist} +Summary: Streaming socket C++ library designed to be easy to use +License: LGPLv2+ +Group: System Environment/Libraries +Source0: http://www.digitalfanatics.org/cal/socketw/files/%{name}%{version}.tar.gz +Patch0: SocketW031026-path.patch +# Reported upstream by mail. Did not found open bugtracker. +Patch1: SocketW031026-include.patch +# Fedora specific +Patch2: SocketW031026.honor-Fedora-flags.patch +Url: http://www.digitalfanatics.org/cal/socketw/ +BuildRequires: openssl-devel, dos2unix + +%description +It supports Unix sockets and TCP/IP sockets with optional SSL/TLS (OpenSSL) +support. It allows you to write portable and secure network applications quickly +without needing to spend time learning low-level system functions or reading +OpenSSL manuals. + +%package devel +Summary: Files for compiling software that uses %{name} +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q -n %{name}%{version} + +%patch0 -p1 -b .path +%patch1 -d src -p0 -b .include +%patch2 -p1 -b .fedora-flags + +%build +make %{?_smp_mflags} shared CXXFLAGS="$RPM_OPT_FLAGS" + +%install +make DESTDIR=%{buildroot} PREFIX=%{buildroot}%{_prefix} PREFIX_H=%{buildroot}%{_includedir}/%{name} PREFIX_L=%{buildroot}%{_libdir} install + +# Remove static +rm %{buildroot}%{_libdir}/*.a + +# correct README encoding +iconv -f ISO-8859-1 -t UTF-8 README > README.new +touch --reference README README.new +mv README.new README + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc LICENSE README WhatsNew Todo examples docs +%{_libdir}/libSocketW.so.0 +%{_libdir}/libSocketW.so.0.* + +%files devel +%{_includedir}/%{name}/ +%{_libdir}/libSocketW.so + +%changelog +* Sat Feb 9 2013 Pavel Alexeev - 031026-3 +- Change group and small adjust -devel summary (thanks to Michael Schwendt). + +* Mon Nov 26 2012 Pavel Alexeev - 031026-2 +- Changes inspired by Volker Fröhlich review comments. Thanks. +- For devel requirement add %%{?_isa}. +- Correct README encoding +- Remove %%defattr +- Add to docs Todo file and examples docs dirs. +- Drop the "It is a" from the summary. +- Mail about forgotten include (Patch1: SocketW031026-include.patch) to upstream + author. Add patch comment. +- Try honnor Fedora compile flags. Add patch2. + +* Sun Aug 26 2012 Pavel Alexeev - 031026-1 +- Spec imported from https://build.opensuse.org/package/view_file?file=SocketW.spec&package=SocketW&project=devel%3Alibraries%3Ac_c%2B%2B + and reworked. +- Mailed to author request to update FSF address in license. diff --git a/SocketW031026-include.patch b/SocketW031026-include.patch new file mode 100644 index 0000000..c8143e8 --- /dev/null +++ b/SocketW031026-include.patch @@ -0,0 +1,10 @@ +--- sw_base.cxx.old 2009-12-19 21:19:31.057051328 -0800 ++++ sw_base.cxx 2009-12-19 21:19:44.939551918 -0800 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #ifndef __WIN32__ + #include diff --git a/SocketW031026-path.patch b/SocketW031026-path.patch new file mode 100644 index 0000000..1f4e1bc --- /dev/null +++ b/SocketW031026-path.patch @@ -0,0 +1,23 @@ +diff -Naur SocketW031026.orig/src/Makefile SocketW031026/src/Makefile +--- SocketW031026.orig/src/Makefile 2003-10-26 17:18:16.000000000 +0100 ++++ SocketW031026/src/Makefile 2012-02-26 21:45:09.000000000 +0100 +@@ -36,14 +36,14 @@ + install: shared + @mkdir -p $(PREFIX_H) + install -c -m 644 *.h $(PREFIX_H) +- @mkdir -p $(PREFIX)/lib +- install -c -m 644 libSocketW.a $(PREFIX)/lib +- install -c libSocketW.so.$(API_VER).$(SW_VER) $(PREFIX)/lib +- @cd $(PREFIX)/lib;\ ++ @mkdir -p $(PREFIX_L) ++ install -c -m 644 libSocketW.a $(PREFIX_L) ++ install -c libSocketW.so.$(API_VER).$(SW_VER) $(PREFIX_L) ++ @cd $(PREFIX_L);\ + ln -sf libSocketW.so.$(API_VER).$(SW_VER) libSocketW.so.$(API_VER);\ + ln -sf libSocketW.so.$(API_VER) libSocketW.so + @echo "** Headerfiles installed in $(PREFIX_H)" +- @echo "** Library files installed in $(PREFIX)/lib" ++ @echo "** Library files installed in $(PREFIX_L)" + + clean: + @rm -f *.o *.so *.so.* *.a *.dll *.def diff --git a/SocketW031026.honor-Fedora-flags.patch b/SocketW031026.honor-Fedora-flags.patch new file mode 100644 index 0000000..6b8807e --- /dev/null +++ b/SocketW031026.honor-Fedora-flags.patch @@ -0,0 +1,24 @@ +diff -NaurEbBH SocketW031026.orig/Makefile.conf SocketW031026/Makefile.conf +--- SocketW031026.orig/Makefile.conf 2012-11-26 23:48:50.000000000 +0400 ++++ SocketW031026/Makefile.conf 2012-11-26 23:49:13.980284680 +0400 +@@ -10,7 +10,7 @@ + PREFIX_H =$(PREFIX)/include + + # Compile flags passed to the compiler +-CFLAGS =-Wall -O3 -ffast-math ++CFLAGS +=-Wall -O3 -ffast-math + SW_CFLAGS = + + # Libs config +diff -NaurEbBH SocketW031026.orig/src/Makefile SocketW031026/src/Makefile +--- SocketW031026.orig/src/Makefile 2012-11-26 23:43:37.000000000 +0400 ++++ SocketW031026/src/Makefile 2012-11-26 23:49:40.614735386 +0400 +@@ -2,7 +2,7 @@ + + include ../Makefile.conf + +-CFLAGS += $(SW_CFLAGS) -fPIC -I./ ++CFLAGS += $(SW_CFLAGS) $(CXXFLAGS) -fPIC -I./ + LIBS = $(SW_LIBS) + + SW_VER = 031026 diff --git a/sources b/sources index e69de29..2865033 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +8faf5f9413ae0f741c758f03db49cbef SocketW031026.tar.gz